Refactored code
This commit is contained in:
parent
9171051268
commit
5a5e8926c4
1 changed files with 13 additions and 11 deletions
|
|
@ -68,12 +68,12 @@ $search_projet_ref = GETPOST('search_projet_ref', 'alpha');
|
|||
$search_contrat_ref = GETPOST('search_contrat_ref', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'alpha');
|
||||
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_startday = GETPOSTINT('search_date_startday');
|
||||
$search_date_startmonth = GETPOSTINT('search_date_startmonth');
|
||||
$search_date_startyear = GETPOSTINT('search_date_startyear');
|
||||
$search_date_endday = GETPOSTINT('search_date_endday');
|
||||
$search_date_endmonth = GETPOSTINT('search_date_endmonth');
|
||||
$search_date_endyear = GETPOSTINT('search_date_endyear');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
@ -323,11 +323,13 @@ if ($search_desc) {
|
|||
if ($search_status != '' && $search_status >= 0) {
|
||||
$sql .= ' AND f.fk_statut = '.urlencode($search_status);
|
||||
}
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND fd.date >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND fd.date <= '".$db->idate($search_date_end)."'";
|
||||
if (!getDolGlobalString('FICHINTER_DISABLE_DETAILS') && $atleastonefieldinlines) {
|
||||
if ($search_date_start) {
|
||||
$sql .= " AND fd.date >= '".$db->idate($search_date_start)."'";
|
||||
}
|
||||
if ($search_date_end) {
|
||||
$sql .= " AND fd.date <= '".$db->idate($search_date_end)."'";
|
||||
}
|
||||
}
|
||||
if (!$user->hasRight('societe', 'client', 'voir')) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
|
|
|
|||
Loading…
Reference in a new issue