From 976516a79627f6815f389e0ec2f7e52072739985 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Nov 2018 09:51:46 +0100 Subject: [PATCH] Fix look and feel v8 --- htdocs/compta/index.php | 2 +- htdocs/compta/sociales/card.php | 2 +- htdocs/compta/sociales/document.php | 2 +- htdocs/compta/sociales/info.php | 2 +- .../compta/sociales/{index.php => list.php} | 29 +++++++++++-------- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 4 +-- 7 files changed, 24 insertions(+), 19 deletions(-) rename htdocs/compta/sociales/{index.php => list.php} (92%) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 692849d2fa6..3d6cf735999 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -636,7 +636,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4ffa1a2829f..d7d762464ee 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -481,7 +481,7 @@ if ($id > 0) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index b2f73768e96..6e033bccc80 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -127,7 +127,7 @@ if ($object->id) } $morehtmlref.=''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index bd21db108c1..35c00766252 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -98,7 +98,7 @@ if (! empty($conf->projet->enabled)) } $morehtmlref.=''; -$linkback = '' . $langs->trans("BackToList") . ''; +$linkback = '' . $langs->trans("BackToList") . ''; $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/list.php similarity index 92% rename from htdocs/compta/sociales/index.php rename to htdocs/compta/sociales/list.php index 6a0250804f1..b25ab142058 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/list.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/compta/sociales/index.php + * \file htdocs/compta/list/index.php * \ingroup tax * \brief Page to list all social contributions */ @@ -55,19 +55,19 @@ if (! $sortorder) $sortorder="DESC"; $year=GETPOST("year",'int'); $filtre=GETPOST("filtre",'int'); -if (empty($_REQUEST['typeid'])) +if (! GETPOSTISSET('search_typeid')) { $newfiltre=str_replace('filtre=','',$filtre); $filterarray=explode('-',$newfiltre); foreach($filterarray as $val) { $part=explode(':',$val); - if ($part[0] == 'cs.fk_type') $typeid=$part[1]; + if ($part[0] == 'cs.fk_type') $search_typeid=$part[1]; } } else { - $typeid=$_REQUEST['typeid']; + $search_typeid=GETPOST('search_typeid','int'); } if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers @@ -76,11 +76,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_label=""; $search_amount=""; $search_status=''; - $typeid=""; + $search_typeid=""; $year=""; $month=""; } + /* * View */ @@ -118,8 +119,8 @@ if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; } -if ($typeid) { - $sql .= " AND cs.fk_type=".$db->escape($typeid); +if ($search_typeid) { + $sql .= " AND cs.fk_type=".$db->escape($search_typeid); } $sql.= " GROUP BY cs.rowid, cs.fk_type, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle"; $sql.= $db->order($sortfield,$sortorder); @@ -139,10 +140,14 @@ 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; - if ($year) $param.='&year='.$year; - if ($typeid) $param.='&typeid='.$typeid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_label) $param.='&search_label='.urlencode($search_label); + if ($search_amount) $param.='&search_amount='.urlencode($search_amount); + if ($search_typeid) $param.='&search_typeid='.urlencode($search_typeid); + if ($search_status != '' && $search_status != '-1') $param.='&search_status='.urlencode($search_status); + if ($year) $param.='&year='.urlencode($year); $newcardbutton=''; if($user->rights->tax->charges->creer) @@ -193,7 +198,7 @@ if ($resql) print ''; // Type print ''; // Period end date print ''; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 682746b3412..3a90fd407af 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -213,7 +213,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?leftmenu=tax_vat&mainmenu=billing', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index bb13a0c2265..0829cc48a00 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -906,9 +906,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Social contributions if (! empty($conf->tax->enabled)) { - $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); + $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); - if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); + if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/list.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=billing&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS))
'.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("DateDue").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").''; - $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone'); + $formsocialcontrib->select_type_socialcontrib($search_typeid,'search_typeid',1,0,0,'maxwidth100onsmartphone'); print '