Fix: Solve filter problem in list of services
This commit is contained in:
parent
8d5ca5c1bd
commit
ea31fc3e05
@ -21,7 +21,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/contrat/services.php
|
* \file htdocs/contrat/services.php
|
||||||
* \ingroup contrat
|
* \ingroup contrat
|
||||||
* \brief Page liste des contrats en service
|
* \brief Page to list services in contracts
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc
|
|||||||
if ($mode == "0") $sql.= " AND cd.statut = 0";
|
if ($mode == "0") $sql.= " AND cd.statut = 0";
|
||||||
if ($mode == "4") $sql.= " AND cd.statut = 4";
|
if ($mode == "4") $sql.= " AND cd.statut = 4";
|
||||||
if ($mode == "5") $sql.= " AND cd.statut = 5";
|
if ($mode == "5") $sql.= " AND cd.statut = 5";
|
||||||
if ($filter == "expired") $sql.= " AND date_fin_validite < ".$now;
|
if ($filter == "expired") $sql.= " AND date_fin_validite < ".$db->idate($now);
|
||||||
if ($search_nom) $sql.= " AND s.nom like '%".addslashes($search_nom)."%'";
|
if ($search_nom) $sql.= " AND s.nom like '%".addslashes($search_nom)."%'";
|
||||||
if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'";
|
if ($search_contract) $sql.= " AND c.rowid = '".addslashes($search_contract)."'";
|
||||||
if ($search_service) $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')";
|
if ($search_service) $sql.= " AND (p.ref like '%".addslashes($search_service)."%' OR p.description like '%".addslashes($search_service)."%')";
|
||||||
@ -122,7 +122,12 @@ if ($resql)
|
|||||||
if ($filter_date1 != '') $param.='&op1day='.$_REQUEST['op1day'].'&op1month='.$_REQUEST['op1month'].'&op1year='.$_REQUEST['op1year'];
|
if ($filter_date1 != '') $param.='&op1day='.$_REQUEST['op1day'].'&op1month='.$_REQUEST['op1month'].'&op1year='.$_REQUEST['op1year'];
|
||||||
if ($filter_date2 != '') $param.='&op2day='.$_REQUEST['op2day'].'&op2month='.$_REQUEST['op2month'].'&op2year='.$_REQUEST['op2year'];
|
if ($filter_date2 != '') $param.='&op2day='.$_REQUEST['op2day'].'&op2month='.$_REQUEST['op2month'].'&op2year='.$_REQUEST['op2year'];
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ListOfServices"), $page, "services.php", $param, $sortfield, $sortorder,'',$num);
|
$title=$langs->trans("ListOfServices");
|
||||||
|
if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0"
|
||||||
|
if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices");
|
||||||
|
if ($mode == "4" && $filter == "expired") $title=$langs->trans("ListOfExpiredServices");
|
||||||
|
if ($mode == "5") $title=$langs->trans("ListOfClosedServices");
|
||||||
|
print_barre_liste($title, $page, "services.php", $param, $sortfield, $sortorder,'',$num);
|
||||||
|
|
||||||
print '<table class="liste" width="100%">';
|
print '<table class="liste" width="100%">';
|
||||||
|
|
||||||
@ -223,7 +228,7 @@ if ($resql)
|
|||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap="nowrap">';
|
print '<td align="right" nowrap="nowrap">';
|
||||||
if ($obj->cstatut == 0)
|
if ($obj->cstatut == 0) // If contract is draft, we say line is also draft
|
||||||
{
|
{
|
||||||
print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $obj->date_fin_validite < $now));
|
print $contractstatic->LibStatut(0,5,($obj->date_fin_validite && $obj->date_fin_validite < $now));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,9 @@ DateServiceStart=Date for beginning of service
|
|||||||
DateServiceEnd=Date for end of service
|
DateServiceEnd=Date for end of service
|
||||||
ShowContract=Show contract
|
ShowContract=Show contract
|
||||||
ListOfServices=List of services
|
ListOfServices=List of services
|
||||||
|
ListOfInactiveServices=List of not active services
|
||||||
|
ListOfExpiredServices=List of expired active services
|
||||||
|
ListOfClosedServices=List of closed services
|
||||||
ListOfRunningContractsLines=List of running contract lines
|
ListOfRunningContractsLines=List of running contract lines
|
||||||
ListOfRunningServices=List of running services
|
ListOfRunningServices=List of running services
|
||||||
NotActivatedServices=Not activated services (among validated contracts)
|
NotActivatedServices=Not activated services (among validated contracts)
|
||||||
|
|||||||
@ -47,6 +47,9 @@ DateServiceStart=Date début du service
|
|||||||
DateServiceEnd=Date fin du service
|
DateServiceEnd=Date fin du service
|
||||||
ShowContract=Afficher contrat
|
ShowContract=Afficher contrat
|
||||||
ListOfServices=Liste des services
|
ListOfServices=Liste des services
|
||||||
|
ListOfInactiveServices=Liste des services inactifs
|
||||||
|
ListOfExpiredServices=Liste des services actifs expirés
|
||||||
|
ListOfClosedServices=Liste des services fermés
|
||||||
ListOfRunningContractsLines=Liste des lignes de contrats en service
|
ListOfRunningContractsLines=Liste des lignes de contrats en service
|
||||||
ListOfRunningServices=Liste des services actifs
|
ListOfRunningServices=Liste des services actifs
|
||||||
NotActivatedServices=Services non activés (parmi les contrats validés)
|
NotActivatedServices=Services non activés (parmi les contrats validés)
|
||||||
|
|||||||
@ -20,19 +20,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/lib/databases/mssql.lib.php
|
* \file htdocs/lib/databases/mssql.lib.php
|
||||||
\brief Fichier de la classe permettant de g<EFBFBD>rer une base mssql
|
* \brief Fichier de la classe permettant de g<EFBFBD>rer une base mssql
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Pour compatibilite lors de l'upgrade
|
// Pour compatibilite lors de l'upgrade
|
||||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..');
|
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..');
|
||||||
if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
|
if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class DoliDb
|
* \class DoliDb
|
||||||
\brief Classe de gestion de la database de dolibarr
|
* \brief Classe de gestion de la database de dolibarr
|
||||||
\remarks Works with PHP5 Only
|
* \remarks Works with PHP5 Only
|
||||||
*/
|
*/
|
||||||
class DoliDb
|
class DoliDb
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
* \brief Class file to manage Dolibarr database access for a Mysql database
|
* \brief Class file to manage Dolibarr database access for a Mysql database
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// For compatibility during upgrade
|
// For compatibility during upgrade
|
||||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..');
|
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '../..');
|
||||||
if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
|
if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/adodbtime/adodb-time.inc.php");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user