Skip to content
Snippets Groups Projects
Commit caa72ac8 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Separation du code javascript dans un fichier a part, le code js casse

la coloration syntaxique d'emacs et c'est ch....
parent b1a181dd
No related branches found
No related tags found
No related merge requests found
......@@ -172,18 +172,14 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
print '</div>';
}
$js_OpenPopupWindow = "function PopupPostalCode(postalcode,objectville)
{
var url = 'searchpostalcode.php?cp=' + postalcode + '&targetobject=window.opener.document.formsoc.' + objectville.name;
// alert(url);
var hWnd = window.open(url, \"SearchPostalCodeWindow\", \"width=\" + 300 + \",height=\" + 150 + \",resizable=yes,scrollbars=yes\");
if((document.window != null) && (!hWnd.opener))
hWnd.opener = document.window;
}
";
include("./soc.js.php");
print '<script language="javascript">'."\n";
print $js_OpenPopupWindow;
print "\n</script>\n";
print "<script language=\"javascript\">\n$js_OpenPopupWindow\n</script>\n";
print '<form action="soc.php" method="post" name="formsoc">';
print '<input type="hidden" name="codeclient_modifiable" value="1">';
print '<input type="hidden" name="codefournisseur_modifiable" value="1">';
......@@ -194,114 +190,121 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
// On positionne pays_id, pays_code et libelle du pays choisi
$soc->pays_id=$_POST["pays_id"]?$_POST["pays_id"]:(defined(MAIN_INFO_SOCIETE_PAYS)?MAIN_INFO_SOCIETE_PAYS:'');
if ($soc->pays_id) {
if ($soc->pays_id)
{
$sql = "SELECT code, libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$soc->pays_id;
$resql=$db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
}
else {
dolibarr_print_error($db);
}
{
$obj = $db->fetch_object($resql);
}
else
{
dolibarr_print_error($db);
}
$soc->pays_code=$obj->code;
$soc->pays=$obj->libelle;
}
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS")) {
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id);
print '</td></tr>';
print '<input type="hidden" name="step" value="'.$step.'">';
print '<input type="hidden" name="action" value="create">';
}
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id);
print '</td></tr>';
print '<input type="hidden" name="step" value="'.$step.'">';
print '<input type="hidden" name="action" value="create">';
print '<tr><td colspan="4" align="center"><input type="submit" name="createnextstep" value="'.$langs->trans('NextStep').'"></td></tr>'."\n";
}
}
if ($step==2 || ! defined("COMPANY_CREATE_TWO_STEPS")) {
print '<tr><td>'.$langs->trans('CustomerCode').'</td><td colspan="3"><input size="16" type="text" name="code_client" maxlength="15" value="'.$soc->code_client.'"></td>';
print '<tr><td>'.$langs->trans('SupplierCode').'</td><td colspan="3"><input size="16" type="text" name="code_fournisseur" maxlength="15" value="'.$soc->code_fournisseur.'"></td>';
if (defined("COMPANY_CREATE_TWO_STEPS")) {
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
print $soc->pays;
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">';
print '</td></tr>';
} else {
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id);
print '</td></tr>';
}
print '<input type="hidden" name="step" value="'.$step.'">';
print '<input type="hidden" name="action" value="add">';
if (defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
print $soc->pays;
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">';
print '</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id);
print '</td></tr>';
}
print '<input type="hidden" name="step" value="'.$step.'">';
print '<input type="hidden" name="action" value="add">';
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
print $soc->adresse;
print '</textarea></td></tr>';
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"';
if ($conf->filltownfromzip) print ' onblur="PopupPostalCode(cp.value,ville)"';
print '>';
if ($conf->filltownfromzip) print ' <input type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="PopupPostalCode(cp.value,ville)">';
print '</td>';
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>';
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
$form->select_departement($soc->departement_id,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0));
print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>';
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>';
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="15" maxlength="9" value="'.$soc->siren.'"></td>';
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>';
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2">&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">';
$form->select_forme_juridique($soc->forme_juridique_code,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0));
print '</td></tr>';
print '<tr><td>'.$langs->trans("Type").'</td><td>';
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id);
print '</td>';
print '<td>'.$langs->trans("Staff").'</td><td>';
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
print '</td></tr>';
print '<tr><td>'.$langs->trans('TVAIntra').'</td><td colspan="3">';
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">';
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
print '</td></tr>';
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
print $soc->adresse;
print '</textarea></td></tr>';
print '<tr><td>'.$langs->trans('Zip').'</td><td><input size="6" type="text" name="cp" value="'.$soc->cp.'"';
if ($conf->filltownfromzip) print ' onblur="PopupPostalCode(cp.value,ville)"';
print '>';
if ($conf->filltownfromzip) print ' <input type="button" name="searchpostalcode" value="'.$langs->trans('FillTownFromZip').'" onclick="PopupPostalCode(cp.value,ville)">';
print '</td>';
print '<td>'.$langs->trans('Town').'</td><td><input type="text" name="ville" value="'.$soc->ville.'"></td></tr>';
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
$form->select_departement($soc->departement_id,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0));
print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$soc->tel.'"></td>';
print '<td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$soc->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3"><input type="text" name="url" size="40" value="'.$soc->url.'"></td></tr>';
print '<tr><td>'.$langs->transcountry('ProfId1',$soc->pays_code).'</td><td><input type="text" name="siren" size="15" maxlength="9" value="'.$soc->siren.'"></td>';
print '<td>'.$langs->transcountry('ProfId2',$soc->pays_code).'</td><td><input type="text" name="siret" size="15" maxlength="14" value="'.$soc->siret.'"></td></tr>';
print '<tr><td>'.$langs->transcountry('ProfId3',$soc->pays_code).'</td><td><input type="text" name="ape" size="5" maxlength="4" value="'.$soc->ape.'"></td><td colspan="2">&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('JuridicalStatus').'</td><td colspan="3">';
$form->select_forme_juridique($soc->forme_juridique_code,(defined("COMPANY_CREATE_TWO_STEPS")?$soc->pays_code:0));
print '</td></tr>';
print '<tr><td>'.$langs->trans("Type").'</td><td>';
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id);
print '</td>';
print '<td>'.$langs->trans("Staff").'</td><td>';
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
print '</td></tr>';
print '<tr><td>'.$langs->trans('TVAIntra').'</td><td colspan="3">';
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">';
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
print '</td></tr>';
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select name="client">';
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
print '<option value="0"'.($soc->client==0?' selected':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
print '</select></td>'."\n";
print '<td>'.$langs->trans('Supplier').'</td><td>'."\n";
$form->selectyesnonum("fournisseur",$soc->fournisseur);
print '</td></tr>'."\n";
print '<tr><td colspan="4" align="center">';
if (defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> &nbsp; &nbsp; ';
}
print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n";
}
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td><select name="client">';
print '<option value="2"'.($soc->client==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
print '<option value="1"'.($soc->client==1?' selected':'').'>'.$langs->trans('Customer').'</option>';
print '<option value="0"'.($soc->client==0?' selected':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
print '</select></td>'."\n";
print '<td>'.$langs->trans('Supplier').'</td><td>'."\n";
$form->selectyesnonum("fournisseur",$soc->fournisseur);
print '</td></tr>'."\n";
print '<tr><td colspan="4" align="center">';
if (defined("COMPANY_CREATE_TWO_STEPS")) {
print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> &nbsp; &nbsp; ';
}
print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n";
}
print '</table>'."\n";
print '</form>'."\n";
}
}
elseif ($_GET["action"] == 'edit')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment