diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index e27896a21ec..9fad5db2a68 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -196,6 +196,7 @@ else print "\n"; print "\n"; +print ''; print '
'; @@ -224,6 +225,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -239,11 +245,12 @@ if ($resql) if($socid) $param .= '&socid='.urlencode($socid); if($option) $param .= "&option=".urlencode($option); - if(! empty($page) && $num <= $nbtotalofrecords) $page = 0; - print '
'; print ''; print ''; + if (! empty($limit)) { + print ''; + } print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index aa0538341e6..80dbe3e02da 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -43,6 +43,9 @@ $contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjec $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$search_facture = GETPOST('search_facture', 'alpha'); +$search_societe = trim(GETPOST('search_societe', 'alpha')); + // Load variable for pagination $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -68,6 +71,16 @@ $parameters = array('socid' => $socid, 'limit' => $limit, 'page' => $page, 'offs $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +// Purge search criteria +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers +{ + $search_facture = ''; + $search_societe = ''; + $search_array_options = array(); +} + + + /* * View */ @@ -108,10 +121,8 @@ if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) $sql.= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; } $sql.= " AND pfd.fk_facture = f.rowid"; -if (dol_strlen(trim(GETPOST('search_societe', 'alpha')))) -{ - $sql.= natural_search("s.nom", 'search_societe'); -} +if ($search_facture) $sql.= natural_search("f.ref", $search_facture); +if ($search_societe) $sql.= natural_search("s.nom", $search_societe); $sql.=$db->order($sortfield, $sortorder); @@ -150,8 +161,6 @@ else $newcardbutton = ''.$langs->trans("Back").''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); - print ''; if ($optioncss != '') print ''; print ''; @@ -162,6 +171,7 @@ print ''; print ''; print ''; +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); print ''; @@ -174,13 +184,13 @@ print_liste_field_titre(''); print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; print ''; // Action column -print ''; print ''; diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index d3a5b60d7ba..6c1816589f4 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -49,7 +49,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Security check if ($user->socid) $socid=$user->socid; -$result = restrictedArea($user, 'tax', $id, 'vat', 'charges'); +$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); // Get parameters diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index fdc1b4a13a1..29501ddee88 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -248,9 +248,17 @@ if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract). if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '='; + $filter_date1=dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); +if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '='; + $filter_date2=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); +if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '='; + $filter_datecloture=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); +if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '='; + if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; @@ -259,6 +267,8 @@ if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= $db->order($sortfield, $sortorder); +//print $sql; + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 78dbba9934e..e9d10138d1e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -8,7 +8,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) } // Add extra fields -$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; +$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.') ORDER BY pos ASC'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index da9f79cf4f5..b6bef4473f3 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -965,6 +965,7 @@ else if (!empty($conf->fournisseur->enabled) && (GETPOST("type") == 'f' || (GETPOST("type") == '' && !empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur = 1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha');
'; -$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); +print ''; +$searchpicto = $form->showFilterButtons(); print $searchpicto; print '