Minor fixes on intervention sql
No style on view for one day.
This commit is contained in:
parent
78d289110d
commit
f1e4f35471
@ -1028,7 +1028,7 @@ else // View by day
|
|||||||
$today=0;
|
$today=0;
|
||||||
$todayarray=dol_getdate($now,'fast');
|
$todayarray=dol_getdate($now,'fast');
|
||||||
if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
|
if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
|
||||||
if ($today) $style='cal_today';
|
//if ($today) $style='cal_today';
|
||||||
|
|
||||||
$timestamp=dol_mktime(12,0,0,$month,$day,$year);
|
$timestamp=dol_mktime(12,0,0,$month,$day,$year);
|
||||||
$arraytimestamp=dol_getdate($timestamp);
|
$arraytimestamp=dol_getdate($timestamp);
|
||||||
|
|||||||
@ -49,7 +49,11 @@ $offset = $conf->liste_limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortfield) $sortfield="fd.date";
|
if (! $sortfield)
|
||||||
|
{
|
||||||
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sortfield="fd.date";
|
||||||
|
else $sortfield="f.ref";
|
||||||
|
}
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
|
|
||||||
$search_ref=GETPOST('search_ref','alpha');
|
$search_ref=GETPOST('search_ref','alpha');
|
||||||
@ -70,13 +74,12 @@ llxHeader('', $langs->trans("Intervention"));
|
|||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,";
|
$sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,";
|
||||||
$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
|
||||||
$sql.= " s.nom as name, s.rowid as socid, s.client";
|
$sql.= " s.nom as name, s.rowid as socid, s.client";
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && empty($socid))
|
if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f)";
|
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid ";
|
$sql.= " WHERE f.fk_soc = s.rowid ";
|
||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$sql.= " AND f.entity = ".$conf->entity;
|
||||||
if ($search_ref) {
|
if ($search_ref) {
|
||||||
@ -86,7 +89,8 @@ if ($search_company) {
|
|||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_desc) {
|
if ($search_desc) {
|
||||||
$sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
|
||||||
|
else $sql .= natural_search(array('f.description'), $search_desc);
|
||||||
}
|
}
|
||||||
if ($search_status != '' && $search_status >= 0) {
|
if ($search_status != '' && $search_status >= 0) {
|
||||||
$sql .= ' AND f.fk_statut = '.$search_status;
|
$sql .= ' AND f.fk_statut = '.$search_status;
|
||||||
@ -97,6 +101,7 @@ if ($socid)
|
|||||||
$sql.= " AND s.rowid = " . $socid;
|
$sql.= " AND s.rowid = " . $socid;
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($limit+1, $offset);
|
$sql.= $db->plimit($limit+1, $offset);
|
||||||
|
//print $sql;
|
||||||
|
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user