FIX sortfield on lettering function

This commit is contained in:
Alexandre SPANGARO 2019-05-05 21:46:56 +02:00
parent 6797c95164
commit 99b068b625
3 changed files with 23 additions and 12 deletions

View File

@ -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 '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
//$letteringbutton = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=lettering" value="lettering" name="lettering" id="lettering"><span class="valignmiddle">' . $langs->trans("Lettering") . '</span></a>';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
print "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
print '<tr class="liste_titre">';

View File

@ -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 '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
@ -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 "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
print '<tr class="liste_titre">';

View File

@ -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";