--- /tmp/dsg/dolibarr/htdocs/projet/activity/github_index.php
+++ /tmp/dsg/dolibarr/htdocs/projet/activity/client_index.php
@@ -86,7 +86,8 @@
$morehtml .= '';
if ($mine) $tooltiphelp = $langs->trans("MyTasksDesc");
-else {
+else
+{
if ($user->rights->projet->all->lire && !$socid) $tooltiphelp = $langs->trans("TasksDesc");
else $tooltiphelp = $langs->trans("TasksPublicDesc");
}
@@ -98,33 +99,33 @@
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
{
- // Search project
- if (!empty($conf->projet->enabled) && $user->rights->projet->lire)
- {
- $listofsearchfields['search_task'] = array('text'=>'Task');
- }
-
- if (count($listofsearchfields))
- {
- print '
';
- print ' ';
- }
+ // Search project
+ if (!empty($conf->projet->enabled) && $user->rights->projet->lire)
+ {
+ $listofsearchfields['search_task'] = array('text'=>'Task');
+ }
+
+ if (count($listofsearchfields))
+ {
+ print '';
+ print ' ';
+ }
}
@@ -145,7 +146,7 @@
$sql .= " AND tt.fk_task = t.rowid";
$sql .= " AND tt.fk_user = ".$user->id;
$sql .= " AND task_date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
-$sql .= " AND p.rowid in (".$db->sanitize($projectsListId).")";
+$sql .= " AND p.rowid in (".$projectsListId.")";
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public";
$resql = $db->query($sql);
@@ -169,7 +170,9 @@
}
$db->free($resql);
-} else {
+}
+else
+{
dol_print_error($db);
}
print '
';
@@ -200,7 +203,7 @@
$sql .= " AND tt.fk_task = t.rowid";
$sql .= " AND tt.fk_user = ".$user->id;
$sql .= " AND task_date BETWEEN '".$db->idate(dol_time_plus_duree(dol_mktime(0, 0, 0, $month, $day, $year), -1, 'd'))."' AND '".$db->idate(dol_time_plus_duree(dol_mktime(23, 59, 59, $month, $day, $year), -1, 'd'))."'";
-$sql .= " AND p.rowid in (".$db->sanitize($projectsListId).")";
+$sql .= " AND p.rowid in (".$projectsListId.")";
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public";
$resql = $db->query($sql);
@@ -224,7 +227,9 @@
}
$db->free($resql);
-} else {
+}
+else
+{
dol_print_error($db);
}
print '
';
@@ -258,7 +263,7 @@
$sql.= " AND tt.fk_task = t.rowid";
$sql.= " AND tt.fk_user = ".$user->id;
$sql.= " AND task_date >= '".$db->idate(dol_get_first_day($year, $month)).'" AND ...";
- $sql.= " AND p.rowid in (".$db->sanitize($projectsListId).")";
+ $sql.= " AND p.rowid in (".$projectsListId.")";
$sql.= " GROUP BY p.rowid, p.ref, p.title";
$resql = $db->query($sql);
@@ -299,56 +304,58 @@
/* Affichage de la liste des projets du mois */
if (!empty($conf->global->PROJECT_TASK_TIME_MONTH))
{
- print '
';
}
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA))
{
- // Get id of types of contacts for projects (This list never contains a lot of elements)
- $listofprojectcontacttype = array();
- $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
- $sql .= " WHERE ctc.element = '".$db->escape($projectstatic->element)."'";
- $sql .= " AND ctc.source = 'internal'";
- $resql = $db->query($sql);
- if ($resql)
- {
- while ($obj = $db->fetch_object($resql))
- {
- $listofprojectcontacttype[$obj->rowid] = $obj->code;
- }
- } else dol_print_error($db);
- if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; // To avoid sql syntax error if not found
- // Get id of types of contacts for tasks (This list never contains a lot of elements)
- $listoftaskcontacttype = array();
- $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
- $sql .= " WHERE ctc.element = '".$db->escape($taskstatic->element)."'";
- $sql .= " AND ctc.source = 'internal'";
- $resql = $db->query($sql);
- if ($resql)
- {
- while ($obj = $db->fetch_object($resql))
- {
- $listoftaskcontacttype[$obj->rowid] = $obj->code;
- }
- } else dol_print_error($db);
- if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0] = '0'; // To avoid sql syntax error if not found
+ // Get id of types of contacts for projects (This list never contains a lot of elements)
+ $listofprojectcontacttype = array();
+ $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
+ $sql .= " WHERE ctc.element = '".$projectstatic->element."'";
+ $sql .= " AND ctc.source = 'internal'";
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ while ($obj = $db->fetch_object($resql))
+ {
+ $listofprojectcontacttype[$obj->rowid] = $obj->code;
+ }
+ }
+ else dol_print_error($db);
+ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0] = '0'; // To avoid sql syntax error if not found
+ // Get id of types of contacts for tasks (This list never contains a lot of elements)
+ $listoftaskcontacttype = array();
+ $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc";
+ $sql .= " WHERE ctc.element = '".$taskstatic->element."'";
+ $sql .= " AND ctc.source = 'internal'";
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ while ($obj = $db->fetch_object($resql))
+ {
+ $listoftaskcontacttype[$obj->rowid] = $obj->code;
+ }
+ }
+ else dol_print_error($db);
+ if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0] = '0'; // To avoid sql syntax error if not found
// Tasks for all resources of all opened projects and time spent for each task/resource
// This list can be very long, so we don't show it by default on task area. We prefer to use the list page.
- // Add constant PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA to show this list
+ // Add constant PROJECT_SHOW_TASK_LIST_ON_PROJECT_AREA to show this list
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA) ? 1000 : $conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
@@ -442,13 +453,13 @@
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
if ($mine)
{
- $sql .= ", ".MAIN_DB_PREFIX."element_contact as ect";
+ $sql .= ", ".MAIN_DB_PREFIX."element_contact as ect";
}
$sql .= " WHERE p.entity IN (".getEntity('project').")";
- if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // project i have permission on
+ if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$projectsListId.")"; // project i have permission on
if ($mine) // this may duplicate record if we are contact twice
{
- $sql .= " AND ect.fk_c_type_contact IN (".join(',', array_keys($listoftaskcontacttype)).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id;
+ $sql .= " AND ect.fk_c_type_contact IN (".join(',', array_keys($listoftaskcontacttype)).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id;
}
if ($socid) $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
$sql .= " AND p.fk_statut=1";
@@ -465,7 +476,7 @@
//print load_fiche_titre($langs->trans("TasksOnOpenedProject"),'','').' ';
- print '
';
+ print '
';
print '
';
print '
';
//print '
'.$langs->trans('TaskRessourceLinks').'
';
@@ -515,7 +526,7 @@
{
print '
';
$code = dol_getIdFromCode($db, $obj->opp_status, 'c_lead_status', 'rowid', 'code');
- if ($code) print $langs->trans("OppStatus".$code);
+ if ($code) print $langs->trans("OppStatus".$code);
print '