From 99b068b625a9118a80bb7fcd6b026c8cfe3441cb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 5 May 2019 21:46:56 +0200 Subject: [PATCH] FIX sortfield on lettering function --- .../thirdparty_lettering_customer.php | 15 ++++++++++----- .../thirdparty_lettering_supplier.php | 18 ++++++++++++------ htdocs/societe/consumption.php | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 87377a189a6..7d10acfa4cd 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -37,11 +37,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("compta","accountancy")); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -186,21 +187,25 @@ if (! $resql) { exit(); } +$param=''; +$param.="&socid=".urlencode($socid); + $num = $db->num_rows($resql); dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG); if ($resql) { $i = 0; + $param="&socid=".$socid; print '
'; print ''; $letteringbutton = ''; - //$letteringbutton = '' . $langs->trans("Lettering") . ''; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); - print ""; + print '
'; + print '
'."\n"; /* print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index fab30066982..b7902efa3e6 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -37,11 +37,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // Load translation files required by the page $langs->loadLangs(array("compta","accountancy")); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); -$confirm = GETPOST('confirm', 'alpha'); -$toselect = GETPOST('toselect', 'array'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -178,7 +179,7 @@ while ($obj = $db->fetch_object($resql)) { $sql.= $db->plimit($limit+1, $offset); -dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); +dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG ); $resql = $db->query($sql); if (! $resql) { @@ -186,14 +187,18 @@ if (! $resql) exit; } +$param=''; +$param.="&socid=".urlencode($socid); + $num = $db->num_rows($resql); -dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG ); +dol_syslog ( "/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG ); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; + $param="&socid=".$socid; print ''; print ''; @@ -201,7 +206,8 @@ if ($resql) { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit); - print "
"; + print '
'; + print '
'."\n"; /* print ''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 3a3fb8507c9..dc8dbcbdba2 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -22,7 +22,7 @@ /** * \file htdocs/societe/consumption.php * \ingroup societe - * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + * \brief Add a tab on thirddarty view to list all products/services bought or sells by thirdparty */ require "../main.inc.php";