Fix contextpage lost on submitting form or sorting

This commit is contained in:
Laurent Destailleur 2016-06-07 14:06:00 +02:00
parent c7065cc3b8
commit 5db6bcd4a8
30 changed files with 66 additions and 38 deletions

View File

@ -128,9 +128,10 @@ if ($result)
if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')';
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($statut != '') $param.="&statut=".$statut;
if ($date_select) $param.="&date_select=".$date_select;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lastname) $param.="&search_lastname=".$search_lastname;
if ($search_login) $param.="&search_login=".$search_login;
if ($search_acount) $param.="&search_account=".$search_account;

View File

@ -155,6 +155,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url);
$listofextcals=array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode;
if ($resourceid > 0) $param.="&resourceid=".$resourceid;

View File

@ -354,7 +354,8 @@ if ($result)
}
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;

View File

@ -381,7 +381,8 @@ if ($resql)
$num = $db->num_rows($resql);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($socid > 0) $param.='&socid='.$socid;
if ($viewstatut != '') $param.='&viewstatut='.$viewstatut;
if ($orderday) $param.='&orderday='.$orderday;

View File

@ -72,6 +72,7 @@ $title=$langs->trans("SpecialExpensesArea");
if ($mode == 'sconly') $title=$langs->trans("SocialContributionsPayments");
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($mode == 'sconly') $param='&mode=sconly';
if ($sortfield) $param.='&sortfield='.$sortfield;

View File

@ -1438,6 +1438,7 @@ else
$num = $db->num_rows($resql);
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;

View File

@ -792,6 +792,7 @@ if ($resql)
}
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;

View File

@ -121,6 +121,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -203,6 +203,7 @@ if ($resql)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.=(GETPOST("orphelins")?"&orphelins=1":"");
$param.=($search_ref?"&search_ref=".urlencode($search_ref):"");

View File

@ -127,7 +127,8 @@ if ($result)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($typeid) $param.='&amp;typeid='.$typeid;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;

View File

@ -138,7 +138,8 @@ if ($resql)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($year) $param.='&amp;year='.$year;
if ($typeid) $param.='&amp;typeid='.$typeid;

View File

@ -322,7 +322,7 @@ if (is_array($coll_list)) {
//print load_fiche_titre($vatsup);
//print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print "<tr class=\"liste_titre liste_titre_topborder\">";
print '<td align="left">'.$langs->trans("Num")."</td>";
print '<td align="left">'.$langs->trans("Supplier")."</td>";
print "<td>".$langs->trans("VATIntra")."</td>";

View File

@ -479,7 +479,7 @@ else
//print table headers for this quadri - expenses now
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
print '<tr class="liste_titre">';
print '<tr class="liste_titre liste_titre_topborder">';
print '<td align="left">'.$elementsup.'</td>';
print '<td align="left">'.$productsup.'</td>';
if ($modetax == 0)

View File

@ -134,7 +134,8 @@ if ($result)
$var=true;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($typeid) $param.='&amp;typeid='.$typeid;

View File

@ -369,6 +369,7 @@ if ($result)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param.='&type='.urlencode($type).'&view='.urlencode($view);

View File

@ -170,6 +170,7 @@ if ($resql)
$i = 0;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
$param.='&search_contract='.$search_contract;
$param.='&search_name='.$search_name;

View File

@ -256,7 +256,8 @@ if ($resql)
$expedition = new Expedition($db);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp;
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_company) $param.= "&amp;search_company=".$search_company;

View File

@ -141,7 +141,8 @@ if ($result)
$num = $db->num_rows($result);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($socid) $param.="&socid=".$socid;
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_company) $param.="&search_company=".urlencode($search_company);

View File

@ -397,6 +397,7 @@ if ($resql)
$param='';
if ($socid > 0) $param.='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($orderday) $param.='&orderday='.$orderday;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;

View File

@ -104,6 +104,7 @@ if ($resql)
$var=true;
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_ref) $param.="&amp;search_ref=".$search_ref;
if ($search_label) $param.="&amp;search_label=".$search_user;

View File

@ -73,7 +73,8 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="p.ref";
if (! $sortorder) $sortorder="ASC";
$contextpage='productservicelist';
// Initialize context for list
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'productservicelist';
if ($type === '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; }
if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; }
@ -334,7 +335,8 @@ else
}
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_categ > 0) $param.="&amp;search_categ=".$search_categ;
if ($sref) $param="&amp;sref=".$sref;
if ($search_ref_supplier) $param="&amp;search_ref_supplier=".$search_ref_supplier;

View File

@ -108,7 +108,8 @@ if ($result)
llxHeader("",$langs->trans("ListOfWarehouses"),$help_url);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -305,16 +305,14 @@ if ($resql)
$num = $db->num_rows($resql);
$params='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_entity != '') $params.= '&amp;search_entity='.urlencode($search_entity);
if ($search_fk_product != '') $params.= '&amp;search_fk_product='.urlencode($search_fk_product);
if ($search_batch != '') $params.= '&amp;search_batch='.urlencode($search_batch);
if ($search_fk_user_creat != '') $params.= '&amp;search_fk_user_creat='.urlencode($search_fk_user_creat);
if ($search_fk_user_modif != '') $params.= '&amp;search_fk_user_modif='.urlencode($search_fk_user_modif);
if ($search_import_key != '') $params.= '&amp;search_import_key='.urlencode($search_import_key);
if ($search_entity != '') $params.= '&amp;search_entity='.urlencode($search_entity);
if ($search_fk_product != '') $params.= '&amp;search_fk_product='.urlencode($search_fk_product);
if ($search_batch != '') $params.= '&amp;search_batch='.urlencode($search_batch);
if ($search_fk_user_creat != '') $params.= '&amp;search_fk_user_creat='.urlencode($search_fk_user_creat);
if ($search_fk_user_modif != '') $params.= '&amp;search_fk_user_modif='.urlencode($search_fk_user_modif);
if ($search_import_key != '') $params.= '&amp;search_import_key='.urlencode($search_import_key);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)

View File

@ -90,8 +90,8 @@ $year = GETPOST('year','int');
if ($search_status == '') $search_status=-1; // -1 or 1
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$contextpage='projectlist';
// Initialize context for list
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'projectlist';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage));
@ -308,7 +308,8 @@ if ($resql)
$num = $db->num_rows($resql);
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sday) $param.='&sday='.$day;
if ($smonth) $param.='&smonth='.$smonth;
if ($syear) $param.='&syear=' .$syear;
@ -346,7 +347,8 @@ if ($resql)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_project', 0, '', '', $limit);
// Show description of content

View File

@ -58,8 +58,8 @@ $day = GETPOST('day','int');
$month = GETPOST('month','int');
$year = GETPOST('year','int');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$contextpage='tasklist';
// Initialize context for list
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'tasklist';
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage));
@ -314,6 +314,7 @@ if ($resql)
$num = $db->num_rows($resql);
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sday) $param.='&sday='.$day;
if ($smonth) $param.='&smonth='.$smonth;

View File

@ -333,7 +333,8 @@ if ($sql_select)
$num = $db->num_rows($resql);
$param="&socid=".$socid."&type_element=".$type_element;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr);
if ($sref) $param.= "&sref=".urlencode($sref);
if ($month) $param.= "&month=".$month;

View File

@ -438,7 +438,8 @@ if ($resql)
$i = 0;
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sall != '') $param .= "&amp;sall=".urlencode($sall);
if ($search_categ > 0) $param.='&amp;search_categ='.urlencode($search_categ);
if ($search_sale > 0) $param.='&amp;search_sale='.urlencode($search_sale);

View File

@ -277,7 +277,8 @@ if ($result)
}
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref;

View File

@ -2226,13 +2226,6 @@ table.liste, table.noborder, table.formdoc, div.noborder {
-webkit-border-radius: 0.2em;
border-radius: 0.2em;*/
}
/*
#tablelines tr.liste_titre:first-child td, form.formnoborder div, tr.liste_titre.trnoborder td {
border-top-width: 1px;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-top-style: solid;
}
*/
.liste_titre_add td, .liste_titre_add .tagtd
{
border-top-width: 1px;
@ -2617,6 +2610,11 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
}
tr.liste_titre_topborder td {
border-top-width: <?php echo $borderwith; ?>px;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-top-style: solid;
}
.liste_titre td a {
text-shadow: none !important;
color: rgb(<?php echo $colortexttitle; ?>);

View File

@ -2483,6 +2483,11 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
}
tr.liste_titre_topborder td {
border-top-width: <?php echo $borderwith; ?>px;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-top-style: solid;
}
.liste_titre td a {
text-shadow: none !important;
color: rgb(<?php echo $colortexttitle; ?>);