From 2eea3a1afaab13bcc88b8ff0134cfeddeb3770c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Dec 2017 10:36:35 +0100 Subject: [PATCH 1/2] Fix backlink of module setup pages --- htdocs/admin/modules.php | 31 ++++++++++++------- htdocs/admin/website.php | 6 ++-- htdocs/blockedlog/admin/blockedlog.php | 3 +- htdocs/core/lib/functions.lib.php | 4 +-- htdocs/modulebuilder/template/admin/about.php | 2 +- htdocs/modulebuilder/template/admin/setup.php | 2 +- 6 files changed, 29 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 82f1df1b7d537..495266961576d 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -428,14 +428,14 @@ { if(!empty($modules[$value])) { $objMod = $modules[$value]; - + if(!empty($objMod->langfiles)) $langs->loadLangs($objMod->langfiles); - + $form = new Form($db); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?value='.$value.'&mode='.$mode.$param, $langs->trans('ConfirmUnactivation'), $langs->trans(GETPOST('confirm_message_code')), 'reset', '', 'no', 1); - + } - + } print $formconfirm; @@ -700,22 +700,29 @@ print 'warnings_unactivation[$mysoc->country_code].'&value=' . $modName . '&mode=' . $mode . $param . '">'; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - + } else { - + print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - + } - + } print ''."\n"; // Link config if (! empty($objMod->config_page_url) && !$disableSetup) { + $backtourlparam=''; + if ($search_keyword != '') $backtourlparam.=($backtourlparam?'&':'?').'search_keyword='.$search_keyword; // No urlencode here, done later + if ($search_nature > -1) $backtourlparam.=($backtourlparam?'&':'?').'search_nature='.$search_nature; + if ($search_version > -1) $backtourlparam.=($backtourlparam?'&':'?').'search_version='.$search_version; + if ($search_status > -1) $backtourlparam.=($backtourlparam?'&':'?').'search_status='.$search_status; + $backtourl=$_SERVER["PHP_SELF"].$backtourlparam; + if (is_array($objMod->config_page_url)) { print ''; @@ -732,11 +739,11 @@ { if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } } @@ -744,11 +751,11 @@ } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } else diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 2dc8a9f1423d7..a6dd48f194753 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -37,6 +37,8 @@ $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + $rowid=GETPOST('rowid','alpha'); $id=1; @@ -394,10 +396,10 @@ $form = new Form($db); $formadmin=new FormAdmin($db); -llxHeader(); +llxHeader('', $langs->trans("WebsiteSetup")); $titre=$langs->trans("WebsiteSetup"); -$linkback=''; +$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($titre,$linkback,'title_setup'); print $langs->trans("WebsiteSetupDesc").'
'; diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 8d4fe48a20fbf..5aa202e2806d6 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -33,6 +33,7 @@ if (! $user->admin) accessforbidden(); $action = GETPOST('action','alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); /* @@ -81,7 +82,7 @@ llxHeader('',$langs->trans("BlockedLogSetup")); -$linkback=''.$langs->trans("BackToModuleList").''; +$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog'),$linkback); $head=blockedlogadmin_prepare_head(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 1ee42f0e88e3e..61f85b88a12be 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3762,8 +3762,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so // Right print ''; - if ($sortfield) $options .= "&sortfield=".$sortfield; - if ($sortorder) $options .= "&sortorder=".$sortorder; + if ($sortfield) $options .= "&sortfield=".urlencode($sortfield); + if ($sortorder) $options .= "&sortorder=".urlencode($sortorder); // Show navigation bar $pagelist = ''; if ($savlimit != 0 && ($page > 0 || $num > $limit)) diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index c2adc8040d130..89e31539d5e33 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -72,7 +72,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader -$linkback = '' . $langs->trans("BackToModuleList") . ''; +$linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule'); diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index c031e67a34641..fb7785041f93c 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -70,7 +70,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader -$linkback = '' . $langs->trans("BackToModuleList") . ''; +$linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'object_mymodule@mymodule'); From fb0169cbb80b6618580c1e378b937693b2a29815 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Dec 2017 10:46:11 +0100 Subject: [PATCH 2/2] Back link to module page --- htdocs/admin/user.php | 11 ++++++----- htdocs/modulebuilder/template/admin/about.php | 1 + htdocs/modulebuilder/template/admin/setup.php | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 31efcb224741c..ee5faefeaee1c 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -40,9 +40,12 @@ $extrafields = new ExtraFields($db); $action = GETPOST('action','alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + $value = GETPOST('value','alpha'); $type='user'; + /* * Action */ @@ -130,10 +133,12 @@ * View */ +$form = new Form($db); + $help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('',$langs->trans("UsersSetup"),$help_url); -$linkback=''.$langs->trans("BackToModuleList").''; +$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("UsersSetup"),$linkback,'title_setup'); @@ -148,8 +153,6 @@ print ''.$langs->trans("Value").''."\n"; print ''; -$var=true; -$form = new Form($db); // Mail required for members @@ -218,7 +221,6 @@ clearstatcache(); -$var=true; foreach ($dirmodels as $reldir) { foreach (array('','/doc') as $valdir) @@ -255,7 +257,6 @@ if ($modulequalified) { - $var = !$var; print ''; print (empty($module->name)?$name:$module->name); print "\n"; diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php index 89e31539d5e33..b6584f8d909d5 100644 --- a/htdocs/modulebuilder/template/admin/about.php +++ b/htdocs/modulebuilder/template/admin/about.php @@ -53,6 +53,7 @@ // Parameters $action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); /* diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index fb7785041f93c..19908d335467d 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -51,6 +51,7 @@ // Parameters $action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); $arrayofparameters=array('MYMODULE_MYPARAM1'=>array('css'=>'minwidth200'), 'MYMODULE_MYPARAM2'=>array('css'=>'minwidth500'));