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

la coloration syntaxique d'emacs et c'est ch....
This commit is contained in:
Rodolphe Quiedeville 2005-08-02 08:58:01 +00:00
parent b1a181dd88
commit caa72ac888

View File

@ -172,18 +172,14 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
print '</div>'; print '</div>';
} }
$js_OpenPopupWindow = "function PopupPostalCode(postalcode,objectville) include("./soc.js.php");
{
var url = 'searchpostalcode.php?cp=' + postalcode + '&targetobject=window.opener.document.formsoc.' + objectville.name; print '<script language="javascript">'."\n";
// alert(url); print $js_OpenPopupWindow;
var hWnd = window.open(url, \"SearchPostalCodeWindow\", \"width=\" + 300 + \",height=\" + 150 + \",resizable=yes,scrollbars=yes\"); print "\n</script>\n";
if((document.window != null) && (!hWnd.opener))
hWnd.opener = document.window;
}
";
print "<script language=\"javascript\">\n$js_OpenPopupWindow\n</script>\n";
print '<form action="soc.php" method="post" name="formsoc">'; print '<form action="soc.php" method="post" name="formsoc">';
print '<input type="hidden" name="codeclient_modifiable" value="1">'; print '<input type="hidden" name="codeclient_modifiable" value="1">';
print '<input type="hidden" name="codefournisseur_modifiable" value="1">'; print '<input type="hidden" name="codefournisseur_modifiable" value="1">';
@ -194,21 +190,24 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
// On positionne pays_id, pays_code et libelle du pays choisi // 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:''); $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; $sql = "SELECT code, libelle from ".MAIN_DB_PREFIX."c_pays where rowid = ".$soc->pays_id;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
} }
else { else
{
dolibarr_print_error($db); dolibarr_print_error($db);
} }
$soc->pays_code=$obj->code; $soc->pays_code=$obj->code;
$soc->pays=$obj->libelle; $soc->pays=$obj->libelle;
} }
if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS")) { if ($step==1 && defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id); $form->select_pays($soc->pays_id);
print '</td></tr>'; print '</td></tr>';
@ -223,12 +222,15 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
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('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>'; 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")) { if (defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td width="140">'.$langs->trans('Country').'</td><td colspan="3">';
print $soc->pays; print $soc->pays;
print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">'; print '<input type="hidden" name="pays_id" value="'.$soc->pays_id.'">';
print '</td></tr>'; print '</td></tr>';
} else { }
else
{
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($soc->pays_id); $form->select_pays($soc->pays_id);
print '</td></tr>'; print '</td></tr>';
@ -292,7 +294,8 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
print '<tr><td colspan="4" align="center">'; print '<tr><td colspan="4" align="center">';
if (defined("COMPANY_CREATE_TWO_STEPS")) { if (defined("COMPANY_CREATE_TWO_STEPS"))
{
print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> &nbsp; &nbsp; '; print '<input type="submit" name="createpreviousstep" value="'.$langs->trans('PreviousStep').'"> &nbsp; &nbsp; ';
} }
print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n"; print '<input type="submit" value="'.$langs->trans('AddCompany').'"></td></tr>'."\n";