From 573bd4f625ccb50f5aa1a09f50c06e0ba4be0930 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Oct 2005 21:05:13 +0000 Subject: [PATCH] Fix: Respect W3C --- htdocs/admin/boxes.php | 107 +++++++++++++++++++-------------------- htdocs/admin/const.php | 11 ++-- htdocs/admin/delais.php | 5 +- htdocs/admin/ihm.php | 3 +- htdocs/admin/index.php | 36 ++++++------- htdocs/admin/modules.php | 6 +++ htdocs/admin/perms.php | 12 ++--- 7 files changed, 91 insertions(+), 89 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 6c59784ed88..2efb12030dd 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -21,9 +21,9 @@ */ /** - \file htdocs/admin/boxes.php - \brief Page d'administration/configuration des boites - \version $Revision$ + \file htdocs/admin/boxes.php + \brief Page d'administration/configuration des boites + \version $Revision$ */ require("./pre.inc.php"); @@ -43,29 +43,21 @@ $boxes = array(); if ($_POST["action"] == 'add') { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes WHERE box_id=".$_POST["boxid"]." AND position=".$_POST["pos"]; - $result = $db->query($sql); - - $num = $db->num_rows($result); - if ($num == 0) + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes WHERE box_id=".$_POST["boxid"]." AND position=".$_POST["pos"]; + $result = $db->query($sql); + + $num = $db->num_rows($result); + if ($num == 0) { - // Si la boite n'est pas deja active - $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_POST["boxid"].",".$_POST["pos"].");"; - $result = $db->query($sql); + // Si la boite n'est pas deja active + $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id, position) values (".$_POST["boxid"].",".$_POST["pos"].");"; + $result = $db->query($sql); } - - Header("Location: boxes.php"); + + Header("Location: boxes.php"); + exit; } - -llxHeader(); - -print_titre($langs->trans("Boxes")); - -print "
".$langs->trans("BoxesDesc")."
\n"; - - - if ($_GET["action"] == 'delete') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["rowid"]; @@ -74,52 +66,59 @@ if ($_GET["action"] == 'delete') if ($_GET["action"] == 'switch') { - // On permute les valeur du champ box_order des 2 lignes de la table boxes - $db->begin(); + // On permute les valeur du champ box_order des 2 lignes de la table boxes + $db->begin(); - $sql="SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["switchfrom"]; - $resultfrom = $db->query($sql); - if ($resultfrom) + $sql="SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["switchfrom"]; + $resultfrom = $db->query($sql); + if ($resultfrom) { - $objfrom = $db->fetch_object($resultfrom); + $objfrom = $db->fetch_object($resultfrom); } - else + else { - dolibarr_print_error($db); - } - - $sql="SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["switchto"]; - $resultto = $db->query($sql); - - if ($resultto) - { - $objto = $db->fetch_object($resultto); - } - else - { - dolibarr_print_error($db); + dolibarr_print_error($db); } - if ($objfrom && $objto) { - $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order=".$objto->box_order." WHERE rowid=".$_GET["switchfrom"]; - $resultupdatefrom = $db->query($sql); - if (! $resultupdatefrom) { dolibarr_print_error($db); } - $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order=".$objfrom->box_order." WHERE rowid=".$_GET["switchto"]; - $resultupdateto = $db->query($sql); - if (! $resultupdateto) { dolibarr_print_error($db); } - } + $sql="SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE rowid=".$_GET["switchto"]; + $resultto = $db->query($sql); - if ($resultupdatefrom && $resultupdateto) + if ($resultto) { - $db->commit(); + $objto = $db->fetch_object($resultto); } - else + else { - $db->rollback(); + dolibarr_print_error($db); + } + + if ($objfrom && $objto) { + $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order=".$objto->box_order." WHERE rowid=".$_GET["switchfrom"]; + $resultupdatefrom = $db->query($sql); + if (! $resultupdatefrom) { dolibarr_print_error($db); } + $sql="UPDATE ".MAIN_DB_PREFIX."boxes set box_order=".$objfrom->box_order." WHERE rowid=".$_GET["switchto"]; + $resultupdateto = $db->query($sql); + if (! $resultupdateto) { dolibarr_print_error($db); } + } + + if ($resultupdatefrom && $resultupdateto) + { + $db->commit(); + } + else + { + $db->rollback(); } } + +llxHeader(); + +print_fiche_titre($langs->trans("Boxes")); + +print $langs->trans("BoxesDesc")."
\n"; + /* * Recherche des boites actives par position possible * On stocke les boites actives par $boxes[position][id_boite]=1 diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 996c8ab8d4b..6a0187c5a7e 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -35,14 +35,6 @@ if (!$user->admin) accessforbidden(); -llxHeader(); - - -print_titre($langs->trans("OtherSetup")); - -//print_r(get_defined_constants()); -print "
\n"; - $typeconst=array('yesno','texte','chaine'); @@ -63,6 +55,9 @@ if ($_GET["action"] == 'delete') } +llxHeader(); + +print_fiche_titre($langs->trans("OtherSetup")); print ''; print ''; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 2390a8c3b76..7d1fab6f3ab 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -26,6 +26,7 @@ \brief Page d'administration des d?lais de retard \version $Revision$ */ + require("./pre.inc.php"); $langs->load("admin"); @@ -65,9 +66,9 @@ $form = new Form($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -print_titre($langs->trans("DelaysOfToleranceBeforeWarning")); +print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning")); -print "
".$langs->transnoentities("DelaysOfToleranceDesc",img_warning())."
\n"; +print $langs->transnoentities("DelaysOfToleranceDesc",img_warning())."
\n"; print "
\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 212c5e32355..68a5a56077f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -78,9 +78,8 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') llxHeader(); -print_titre($langs->trans("GUISetup")); +print_fiche_titre($langs->trans("GUISetup")); -print "
\n"; if (isset($_GET["action"]) && $_GET["action"] == 'edit') { diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 1df33bd4a80..77ea430746e 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -71,30 +71,31 @@ $form = new Form($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -print_titre($langs->trans("GlobalSetup")); +print_fiche_titre($langs->trans("GlobalSetup")); -print "
\n"; - if ((isset($_GET["action"]) && $_GET["action"] == 'edit') || (isset($_POST["action"]) && $_POST["action"] == 'updateedit') ) { - /* + /** * Edition des paramètres */ - print ' - + '; } - --> - - '; - + print ''; print ''; $var=true; @@ -112,7 +113,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') $var=!$var; print ''; $var=!$var; @@ -486,7 +487,8 @@ else print '
'; print ''.$langs->trans("Edit").''; print '
'; - + + print '
'; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index cf0ef43b955..57a437266a4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -327,5 +327,11 @@ foreach ($orders as $key => $value) } print "
'.$langs->trans("Country").''; - $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',' onChange="save_refresh()"'); + $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',($conf->use_javascript?' onChange="save_refresh()"':'')); print '
\n"; + +// Pour eviter bug mise en page IE +print '
'; +print '
'; + + llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index cdf79a2dd1f..9f87259cbec 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -37,23 +37,23 @@ if (!$user->admin) if ($_GET["action"] == 'add') { - $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1 WHERE id =".$_GET["pid"]; - $db->query($sql); + $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1 WHERE id =".$_GET["pid"]; + $db->query($sql); } if ($_GET["action"] == 'remove') { - $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0 WHERE id =".$_GET["pid"]; - $db->query($sql); + $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0 WHERE id =".$_GET["pid"]; + $db->query($sql); } llxHeader(); -print_titre($langs->trans("DefaultRights")); +print_fiche_titre($langs->trans("DefaultRights")); -print "
".$langs->trans("DefaultRightsDesc")."

\n"; +print $langs->trans("DefaultRightsDesc")."

\n"; print '';