NEW Can select dynamicaly number of lines to show on page on product,

shipment, contact, orders, thirdparties
Fix can make a shipment for product not predefined in multiwarehouse
mode
This commit is contained in:
Laurent Destailleur 2016-02-10 23:37:34 +01:00
parent 9b41e11a1e
commit 6662c1b5e1
7 changed files with 164 additions and 90 deletions

View File

@ -64,10 +64,10 @@ $id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int'));
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'commande', $id,'');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if ($page == -1) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
@ -90,6 +90,19 @@ $fieldstosearchall = array(
);
if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate";
$arrayfields=array(
);
// Extra fields
/*
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
*/
/*
* Actions
@ -257,6 +270,7 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($socid > 0) $param.='&socid='.$socid;
if ($viewstatut != '') $param.='&viewstatut='.$viewstatut;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
@ -272,7 +286,6 @@ if ($resql)
if ($optioncss != '') $param.='&optioncss='.$optioncss;
$num = $db->num_rows($resql);
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_commercial.png');
// Lignes des champs de filtre
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -283,7 +296,9 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
if ($sall)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);

View File

@ -67,6 +67,7 @@ $optioncss = GETPOST('optioncss','alpha');
$type=GETPOST("type");
$view=GETPOST("view");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
@ -76,7 +77,6 @@ $begin=GETPOST('begin');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.lastname";
if ($page < 0) { $page = 0; }
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page;
$langs->load("companies");
@ -345,12 +345,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
if($view == "recent")
{
$sql.= $db->order("p.datec","DESC");
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$sql.= $db->plimit($limit+1, $offset);
}
else
{
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$sql.= $db->plimit($limit+1, $offset);
}
//print $sql;
@ -361,11 +361,14 @@ if ($result)
$num = $db->num_rows($result);
$i = 0;
$param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
$param='';
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);
if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ);
if ($search_lastname != '') $param.='&amp;search_lastname='.urlencode($search_lastname);
if ($search_firstname != '') $param.='&amp;search_firstname='.urlencode($search_firstname);
if ($search_societe != '') $param.='&amp;search_societe='.urlencode($search_societe);
if ($search_zip != '') $param.='&amp;search_zip='.urlencode($search_zip);
if ($search_town != '') $param.='&amp;search_town='.urlencode($search_town);
if ($search_job != '') $param.='&amp;search_job='.urlencode($search_job);
@ -385,8 +388,6 @@ if ($result)
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_companies.png');
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -395,6 +396,8 @@ if ($result)
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies.png', 0, '', '', $limit);
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
@ -739,10 +742,10 @@ if ($result)
print "</table>";
if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies.png', 0, '', '', $limit, 1);
print '</form>';
if ($num > $limit) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
$db->free($result);
}
else

View File

@ -2955,28 +2955,29 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
/**
* Print a title with navigation controls for pagination
*
* @param string $titre Title to show (required)
* @param string $page Numero of page to show in navigation links (required)
* @param string $file Url of page (required)
* @param string $options parametres complementaires lien ('' par defaut)
* @param string $sortfield champ de tri ('' par defaut)
* @param string $sortorder ordre de tri ('' par defaut)
* @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known)
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
* @param string $morecss More css to the table
* @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit)
* @param string $titre Title to show (required)
* @param string $page Numero of page to show in navigation links (required)
* @param string $file Url of page (required)
* @param string $options parametres complementaires lien ('' par defaut)
* @param string $sortfield champ de tri ('' par defaut)
* @param string $sortorder ordre de tri ('' par defaut)
* @param string $center chaine du centre ('' par defaut). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known)
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
* @param string $morecss More css to the table
* @param int|string $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1)
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
{
global $conf,$langs;
$savlimit = $limit;
if ($picto == 'setup') $picto='title_setup.png';
if (($conf->browser->name == 'ie') && $picto=='title_generic.png') $picto='title.gif';
if ($limit < 0) $limit = $conf->liste_limit;
@ -3057,7 +3058,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
$pagelist.= '<li'.(empty($conf->dol_use_jmobile)?' class="pagination"':'').'><span '.(empty($conf->dol_use_jmobile)?'class="active"':'data-role="button"').'>'.($page+1)."</li>";
}
}
print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines); // output the div and ul for previous/last completed with page numbers into $pagelist
print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtml, $savlimit, $totalnboflines, $hideselectlimit); // output the div and ul for previous/last completed with page numbers into $pagelist
print '</td>';
print '</tr></table>'."\n";
@ -3075,14 +3076,15 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
* @param string $afterarrows HTML content to show after arrows. Must NOT contains '<li> </li>' tags.
* @param int $limit Max nb of record to show (-1 = no combo with limit, 0 = no limit, > 0 = limit)
* @param int $totalnboflines Total number of records/lines for all pages (if known)
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betweenarrows='', $afterarrows='', $limit=-1, $totalnboflines=0)
function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betweenarrows='', $afterarrows='', $limit=-1, $totalnboflines=0, $hideselectlimit=0)
{
global $conf, $langs;
print '<div class="pagination"><ul>';
if ((int) $limit >= 0)
if ((int) $limit >= 0 && empty($hideselectlimit))
{
$pagesizechoices='10:10,20:20,30:30,40:40,50:50,100:100,250:250,500:500,1000:1000,5000:5000';
//$pagesizechoices.=',0:'.$langs->trans("All"); // Not yet supported

View File

@ -199,7 +199,7 @@ if (empty($reshook))
$batch="batchl".$i."_0";
$stockLocation="ent1".$i."_0";
$qty = "qtyl".$i;
if (isset($_POST[$batch]))
{
//shipment line with batch-enable product
@ -242,7 +242,8 @@ if (empty($reshook))
}
else
{
//shipment line for product with no batch management
var_dump($_POST); var_dump($batch);
//shipment line for product with no batch management and no multiple stock location
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
}
@ -549,7 +550,7 @@ if ($action == 'create2')
$action=''; $id=''; $ref='';
}
// Mode creation. TODO This part seems to not be used at all. Receipt record is created by the action "create_delivery" not from a form.
// Mode creation.
if ($action == 'create')
{
$expe = new Expedition($db);
@ -577,9 +578,6 @@ if ($action == 'create')
if (! empty($conf->stock->enabled)) $entrepot = new Entrepot($db);
/*
* Document source
*/
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
@ -711,9 +709,7 @@ if ($action == 'create')
dol_fiche_end();
/*
* Expedition Lines
*/
// Shipment lines
$numAsked = count($object->lines);
@ -745,9 +741,9 @@ if ($action == 'create')
print '<table class="noborder" width="100%">';
/* Lecture des expeditions deja effectuees */
// Lecture des expeditions deja effectuees
$object->loadExpeditions();
if ($numAsked)
{
print '<tr class="liste_titre">';
@ -792,9 +788,9 @@ if ($action == 'create')
if (! empty($line->date_end)) $type=1;
print "<tr ".$bc[$var].">\n";
// Product label
if ($line->fk_product > 0)
if ($line->fk_product > 0) // Predefined product ?
{
$product->fetch($line->fk_product);
$product->load_stock();
@ -819,12 +815,12 @@ if ($action == 'create')
{
print ($line->desc && $line->desc!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->desc):'';
}
print '</td>';
}
else
{
print "<td>";
print "<td>";
if ($type==1) $text = img_object($langs->trans('Service'),'service');
else $text = img_object($langs->trans('Product'),'product');
@ -846,7 +842,7 @@ if ($action == 'create')
print '</td>';
$qtyProdCom=$line->qty;
// Qty already sent
// Qty already shipped
print '<td align="center">';
$quantityDelivered = $object->expeditions[$line->id];
print $quantityDelivered;
@ -863,9 +859,9 @@ if ($action == 'create')
$quantityToBeDelivered = $quantityAsked - $quantityDelivered;
}
$warehouse_id = GETPOST('entrepot_id','int');
$warehouseObject = null;
if ($warehouse_id > 0)
if ($warehouse_id > 0 || ! ($line->fk_product > 0)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection
{
//ship from preselected location
$stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number
@ -942,7 +938,7 @@ if ($action == 'create')
print '<td></td><td></td></tr>'; // end line and start a new one for lot/serial
$staticwarehouse=new Entrepot($db);
$staticwarehouse->fetch($warehouse_id);
if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id);
$subj=0;
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
@ -970,16 +966,18 @@ if ($action == 'create')
$quantityToBeDelivered = 0;
}
$subj++;
print '</td></tr>';
}
}
else
{
print '<tr><td colspan="3" ></td><td align="center">';
print '<tr><td colspan="3"></td><td align="center">';
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
print '</td>';
print '<td align="left">';
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle);
print '</td></tr>';
}
}
}
@ -988,13 +986,16 @@ if ($action == 'create')
// ship from multiple locations
if (empty($conf->productbatch->enabled) || ! $product->hasbatch())
{
print '<td></td><td></td></tr>'; // end line and start a new one for each warehouse
print '<td></td><td></td></tr>'; // end line and start a new one for each warehouse
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
$subj=0;
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) {
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
{
$warehouseObject=new Entrepot($db);
$warehouseObject->fetch($warehouse_id);
if ($stock_warehouse->real > 0) {
if ($stock_warehouse->real > 0)
{
$stock = + $stock_warehouse->real; // Convert it to number
$deliverableQty = min($quantityToBeDelivered,$stock);
// Quantity to send
@ -1039,7 +1040,7 @@ if ($action == 'create')
{
$product->get_sousproduits_arbo();
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
if(count($prods_arbo) > 0)
if (count($prods_arbo) > 0)
{
foreach($prods_arbo as $key => $value)
{
@ -1049,10 +1050,12 @@ if ($action == 'create')
{
$img=img_warning($langs->trans("StockTooLow"));
}
print "<tr ".$bc[$var]."><td>&nbsp; &nbsp; &nbsp; ->
print "<tr ".$bc[$var]."><td>";
print "&nbsp; &nbsp; &nbsp; ->
<a href=\"".DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
</a> (".$value['nb'].")</td><td align=\"center\"> ".$value['nb_total']."</td><td>&nbsp</td><td>&nbsp</td>
<td align=\"center\">".$value['stock']." ".$img."</td></tr>";
<td align=\"center\">".$value['stock']." ".$img."</td>";
print "</tr>";
}
}
}
@ -1060,11 +1063,12 @@ if ($action == 'create')
else
{
print '<td></td><td></td></tr>'; // end line and start a new one for lot/serial
$subj=0;
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) {
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse)
{
$warehouseObject=new Entrepot($db);
$warehouseObject->fetch($warehouse_id);
if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
@ -1073,7 +1077,7 @@ if ($action == 'create')
//var_dump($dbatch);
$batchStock = + $dbatch->qty; // To get a numeric
$deliverableQty = min($quantityToBeDelivered,$batchStock);
print '<tr><td colspan="3" ></td><td align="center">';
print '<tr><td colspan="3"></td><td align="center">';
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="'.$deliverableQty.'">';
print '</td>';
@ -1091,25 +1095,44 @@ if ($action == 'create')
}
//dol_syslog('deliverableQty = '.$deliverableQty.' batchStock = '.$batchStock);
$subj++;
print '</td></tr>';
}
}
}
}
if ($subj == 0)
if ($subj == 0) // Line not shown yet
{
print '<tr><td colspan="3" ></td><td align="center">';
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0" disabled="disabled"> ';
print '</td>';
print '<td align="left">';
if ($warehouseObject)
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle);
//$disabled='disabled="disabled"';
print '<input name="qtyl'.$indiceAsked.'_'.$subj.'" id="qtyl'.$indiceAsked.'_'.$subj.'" type="text" size="4" value="0"'.($disabled?' '.$disabled:'').'> ';
}
else
{
print img_warning().' '.$langs->trans("StockTooLow");
print $langs->trans("NA");
}
print '</td>';
print '<td align="left">';
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
if ($warehouseObject)
{
print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle);
}
else
{
if ($line->fk_product) print img_warning().' '.$langs->trans("StockTooLow");
else print '';
}
}
else
{
print $langs->trans("Service");
}
print '</td>';
print '</tr>';
}
}
@ -1576,6 +1599,7 @@ else if ($id || $ref)
{
print (! empty($lines[$i]->description) && $lines[$i]->description!=$lines[$i]->product)?'<br>'.dol_htmlentitiesbr($lines[$i]->description):'';
}
print "</td>\n";
}
else
{

View File

@ -42,17 +42,16 @@ $search_company = GETPOST("search_company");
$sall = GETPOST('sall');
$optioncss = GETPOST('optioncss','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="DESC";
if ($page == -1) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="DESC";
$viewstatut=GETPOST('viewstatut');
@ -71,6 +70,19 @@ $fieldstosearchall = array(
's.nom'=>"ThirdParty"
);
$arrayfields=array(
);
// Extra fields
/*
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
*/
/*
* View
@ -129,18 +141,22 @@ if ($resql)
$expedition = new Expedition($db);
$param="";
$param='';
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;
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords);
$i = 0;
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit);
if ($sall)
{
@ -149,6 +165,18 @@ if ($resql)
}
$moreforfilter='';
if (! empty($moreforfilter))
{
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
$parameters=array('type'=>$type);
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '</div>';
}
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';

View File

@ -314,6 +314,8 @@ else
setEventMessages($langs->trans("ProductDeleted", GETPOST('delprod')), null, 'mesgs');
}
$param='';
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;
@ -337,7 +339,16 @@ else
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
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_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_products.png', 0, '', '', $limit);
if (! empty($catid))
{
@ -368,15 +379,6 @@ else
}
else
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
@ -781,8 +783,8 @@ else
$db->free($resql);
print "</table>";
print '</form>';
}
print '</form>';
}
else
{

View File

@ -83,7 +83,7 @@ $page=GETPOST("page",'int');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
if ($page == -1) { $page = 0 ; }
$offset = $limit * $page ;
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;