Fix: Respect W3C
This commit is contained in:
parent
13ff44a6d0
commit
573bd4f625
@ -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 "<br>".$langs->trans("BoxesDesc")."<br>\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")."<br>\n";
|
||||
|
||||
/*
|
||||
* Recherche des boites actives par position possible
|
||||
* On stocke les boites actives par $boxes[position][id_boite]=1
|
||||
|
||||
@ -35,14 +35,6 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
print_titre($langs->trans("OtherSetup"));
|
||||
|
||||
//print_r(get_defined_constants());
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
$typeconst=array('yesno','texte','chaine');
|
||||
|
||||
@ -63,6 +55,9 @@ if ($_GET["action"] == 'delete')
|
||||
}
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("OtherSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -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='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
||||
|
||||
|
||||
print_titre($langs->trans("DelaysOfToleranceBeforeWarning"));
|
||||
print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"));
|
||||
|
||||
print "<br>".$langs->transnoentities("DelaysOfToleranceDesc",img_warning())."<br>\n";
|
||||
print $langs->transnoentities("DelaysOfToleranceDesc",img_warning())."<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
@ -78,9 +78,8 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_titre($langs->trans("GUISetup"));
|
||||
print_fiche_titre($langs->trans("GUISetup"));
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
{
|
||||
|
||||
@ -71,30 +71,31 @@ $form = new Form($db);
|
||||
$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
||||
|
||||
|
||||
print_titre($langs->trans("GlobalSetup"));
|
||||
print_fiche_titre($langs->trans("GlobalSetup"));
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
|
||||
{
|
||||
/*
|
||||
/**
|
||||
* Edition des paramètres
|
||||
*/
|
||||
print '
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function save_refresh()
|
||||
if ($conf->use_javascript)
|
||||
{
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
// location.href = "index.php?action=updateedit";
|
||||
print '
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
function save_refresh()
|
||||
{
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
// location.href = "index.php?action=updateedit";
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
';
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
';
|
||||
|
||||
|
||||
print '<form method="post" action="index.php" name="form_index">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
$var=true;
|
||||
@ -112,7 +113,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
@ -486,7 +487,8 @@ else
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="tabAction" href="index.php?action=edit">'.$langs->trans("Edit").'</a>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -327,5 +327,11 @@ foreach ($orders as $key => $value)
|
||||
}
|
||||
print "</table></div>\n";
|
||||
|
||||
|
||||
// Pour eviter bug mise en page IE
|
||||
print '<div class="tabsAction">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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 "<br>".$langs->trans("DefaultRightsDesc")."<br><br>\n";
|
||||
print $langs->trans("DefaultRightsDesc")."<br><br>\n";
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user