Merge branch '3.9' of https://github.com/Dolibarr/dolibarr.git into 3.9
This commit is contained in:
commit
6aa10a84df
@ -604,9 +604,10 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
//REF
|
//REF
|
||||||
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
|
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//print '<td class="liste_titre">';
|
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
|
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
//DATE ORDER
|
//DATE ORDER
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
@ -619,15 +620,16 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
//SEARCH BUTTON
|
//SEARCH BUTTON
|
||||||
print '</td><td align="right" class="liste_titre">';
|
print '<td align="right" class="liste_titre">';
|
||||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
//ALL/NONE
|
//ALL/NONE
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td align="center" class="liste_titre">';
|
||||||
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
||||||
@ -697,7 +699,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
|||||||
/*
|
/*
|
||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
print '<br><div class="center"><input type="checkbox" checked name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
print '<br><div class="center"><input type="checkbox" '.(empty($conf->global->INVOICE_CLOSE_ORDERS_OFF_BY_DEFAULT_FORMASSINVOICE)?' checked="checked"':'').' name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
|
||||||
print '<div align="right">';
|
print '<div align="right">';
|
||||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||||
print '<input type="hidden" name="action" value="create">';
|
print '<input type="hidden" name="action" value="create">';
|
||||||
|
|||||||
@ -42,16 +42,16 @@ $object = new Societe($db);
|
|||||||
if ($socid > 0) $object->fetch($socid);
|
if ($socid > 0) $object->fetch($socid);
|
||||||
|
|
||||||
// Sort & Order fields
|
// Sort & Order fields
|
||||||
|
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if ($page == -1) {
|
if ($page == -1) { $page = 0; }
|
||||||
$page = 0;
|
$offset = $limit * $page;
|
||||||
}
|
$pageprev = $page - 1;
|
||||||
$offset = $conf->liste_limit * $page;
|
$pagenext = $page + 1;
|
||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
if (! $sortfield) $sortfield='dateprint';
|
if (! $sortfield) $sortfield='dateprint';
|
||||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|
||||||
|
|
||||||
// Search fields
|
// Search fields
|
||||||
$sref=GETPOST("sref");
|
$sref=GETPOST("sref");
|
||||||
@ -124,7 +124,7 @@ print '<div class="underbanner clearboth"></div>';
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Alias names (commercial, trademark or alias names)
|
// Alias names (commercial, trademark or alias names)
|
||||||
print '<tr id="name_alias"><td class="titlefield" width="25%"><label for="name_alias_input">'.$langs->trans('AliasNames').'</label></td>';
|
print '<tr id="name_alias"><td class="titlefield"><label for="name_alias_input">'.$langs->trans('AliasNames').'</label></td>';
|
||||||
print '<td colspan="3">'.$object->name_alias.'</td></tr>';
|
print '<td colspan="3">'.$object->name_alias.'</td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||||
@ -306,8 +306,18 @@ if ($month > 0) {
|
|||||||
$sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
|
$sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
|
||||||
}
|
}
|
||||||
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";
|
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";
|
||||||
if ($sprod_fulldescr) $sql.= " AND (d.description LIKE '%".$sprod_fulldescr."%' OR p.label LIKE '%".$sprod_fulldescr."%')";
|
if ($sprod_fulldescr)
|
||||||
|
{
|
||||||
|
$sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||||
|
if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||||
|
if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.label LIKE '%".$db->escape($sprod_fulldescr)."%'";
|
||||||
|
$sql.=")";
|
||||||
|
}
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
$totalnboflines = $db->num_rows($resql);
|
||||||
|
|
||||||
$sql.= $db->plimit($limit + 1, $offset);
|
$sql.= $db->plimit($limit + 1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
@ -316,13 +326,25 @@ $typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPO
|
|||||||
$button = '<input type="submit" class="button" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
$button = '<input type="submit" class="button" name="button_third" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid."&type_element=".$type_element;
|
$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid."&type_element=".$type_element;
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
|
|
||||||
|
|
||||||
if ($sql_select)
|
if ($sql_select)
|
||||||
{
|
{
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if (!$resql) dol_print_error($db);
|
if (!$resql) dol_print_error($db);
|
||||||
}
|
|
||||||
|
$var=true;
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
$param="&socid=".$socid."&type_element=".$type_element;
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
|
if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr);
|
||||||
|
if ($sref) $param.= "&sref=".urlencode($sref);
|
||||||
|
if ($month) $param.= "&month=".$month;
|
||||||
|
if ($year) $param.= "&year=".$year;
|
||||||
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, '', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<table class="liste" width="100%">'."\n";
|
print '<table class="liste" width="100%">'."\n";
|
||||||
// Titles with sort buttons
|
// Titles with sort buttons
|
||||||
@ -353,12 +375,8 @@ print '<input type="image" class="liste_titre" name="button_removefilter" src="'
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($sql_select)
|
|
||||||
{
|
|
||||||
$var=true;
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while (($objp = $db->fetch_object($resql)) && $i < $conf->liste_limit )
|
while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit))
|
||||||
{
|
{
|
||||||
$documentstatic->id=$objp->doc_id;
|
$documentstatic->id=$objp->doc_id;
|
||||||
$documentstatic->ref=$objp->doc_number;
|
$documentstatic->ref=$objp->doc_number;
|
||||||
@ -532,20 +550,42 @@ if ($sql_select)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if ($num > $conf->liste_limit) {
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
if ($num > $limit) {
|
||||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else if (empty($type_element) || $type_element == -1)
|
else if (empty($type_element) || $type_element == -1)
|
||||||
{
|
{
|
||||||
|
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
|
||||||
|
|
||||||
|
print '<table class="liste" width="100%">'."\n";
|
||||||
|
// Titles with sort buttons
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans('Status'),$_SERVER['PHP_SELF'],'fk_status','',$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("SelectElementAndClickRefresh").'</td></tr>';
|
print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("SelectElementAndClickRefresh").'</td></tr>';
|
||||||
}
|
|
||||||
else {
|
|
||||||
print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
|
||||||
|
|
||||||
|
print '<table class="liste" width="100%">'."\n";
|
||||||
|
|
||||||
|
print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
}
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user