--- /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 ''; - print '
'; - print ''; - $i = 0; - foreach ($listofsearchfields as $key => $value) - { - if ($i == 0) print ''; - print ''; - print ''; - if ($i == 0) print ''; - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print '
'; - print '
'; - } + // Search project + if (!empty($conf->projet->enabled) && $user->rights->projet->lire) + { + $listofsearchfields['search_task'] = array('text'=>'Task'); + } + + if (count($listofsearchfields)) + { + print '
'; + print ''; + print '
'; + print ''; + $i = 0; + foreach ($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
'.$langs->trans("Search").'
'; + print '
'; + 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 '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; - $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; - $sql .= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; - $sql .= " WHERE t.fk_projet = p.rowid"; - $sql .= " AND p.entity = ".$conf->entity; - $sql .= " AND tt.fk_task = t.rowid"; - $sql .= " AND tt.fk_user = ".$user->id; + print '
'; + print '
'.$langs->trans("ActivityOnProjectThisMonth").': '.dol_print_date($now, "%B %Y").''.$langs->trans("Time").'
'; + print ''; + print ''; + print ''; + print "\n"; + + $sql = "SELECT p.rowid, p.ref, p.title, p.public, SUM(tt.task_duration) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; + $sql .= ", ".MAIN_DB_PREFIX."projet_task_time as tt"; + $sql .= " WHERE t.fk_projet = p.rowid"; + $sql .= " AND p.entity = ".$conf->entity; + $sql .= " AND tt.fk_task = t.rowid"; + $sql .= " AND tt.fk_user = ".$user->id; $sql .= " AND task_date BETWEEN '".$db->idate(dol_get_first_day($year, $month))."' AND '".$db->idate(dol_get_last_day($year, $month))."'"; - $sql .= " AND p.rowid in (".$db->sanitize($projectsListId).")"; - $sql .= " GROUP BY p.rowid, p.ref, p.title, p.public"; - - $resql = $db->query($sql); - if ($resql) - { - while ($row = $db->fetch_object($resql)) - { - print ''; - print ''; - print ''; - print "\n"; - } - $db->free($resql); - } else { - dol_print_error($db); - } - print ''; - print ''; - print ''; - print "\n"; - print "
'.$langs->trans("ActivityOnProjectThisMonth").': '.dol_print_date($now, "%B %Y").''.$langs->trans("Time").'
'; - $projectstatic->id = $row->rowid; - $projectstatic->ref = $row->ref; - $projectstatic->title = $row->title; - print $projectstatic->getNomUrl(1, '', 1); - print ''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total, 'allhourmin').'
"; - print '
'; + $sql .= " AND p.rowid in (".$projectsListId.")"; + $sql .= " GROUP BY p.rowid, p.ref, p.title, p.public"; + + $resql = $db->query($sql); + if ($resql) + { + while ($row = $db->fetch_object($resql)) + { + print ''; + print ''; + $projectstatic->id = $row->rowid; + $projectstatic->ref = $row->ref; + $projectstatic->title = $row->title; + print $projectstatic->getNomUrl(1, '', 1); + print ''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; + print "\n"; + } + $db->free($resql); + } + else + { + dol_print_error($db); + } + print ''; + print ''.$langs->trans('Total').''; + print ''.convertSecondToTime($total, 'allhourmin').''; + print "\n"; + print ""; + print ''; } /* Affichage de la liste des projets de l'annee */ if (!empty($conf->global->PROJECT_TASK_TIME_YEAR)) { - print '
'; + print '
'; print '
'; print ''; print ''; @@ -364,7 +371,7 @@ $sql .= " AND tt.fk_task = t.rowid"; $sql .= " AND tt.fk_user = ".$user->id; $sql .= " AND YEAR(task_date) = '".strftime("%Y", $now)."'"; - $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); @@ -384,7 +391,9 @@ print "\n"; } $db->free($resql); - } else { + } + else + { dol_print_error($db); } print ''; @@ -392,44 +401,46 @@ print ''; print "\n"; print "
'.$langs->trans("ActivityOnProjectThisYear").': '.strftime("%Y", $now).'
'.convertSecondToTime($total, 'allhourmin').'
"; - print '
'; + 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 ''; @@ -515,7 +526,7 @@ { print ''; } print ''; print ''; print '
'.$langs->trans('TaskRessourceLinks').''; $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 ''; @@ -525,7 +536,8 @@ $tasktmp->ref = $obj->ref; $tasktmp->label = $obj->label; print $tasktmp->getNomUrl(1, 'withproject', 'task', 1, '
'); - } else print $langs->trans("NoTasks"); + } + else print $langs->trans("NoTasks"); print '
'.dol_print_date($db->jdate($obj->dateo), 'day').''.dol_print_date($db->jdate($obj->datee), 'day'); @@ -564,11 +576,13 @@ } print "
"; - print '
'; + print '
'; $db->free($resql); - } else { + } + else + { dol_print_error($db); } } --- /tmp/dsg/dolibarr/htdocs/projet/activity/github_perday.php +++ /tmp/dsg/dolibarr/htdocs/projet/activity/client_perday.php @@ -48,7 +48,8 @@ $mine = 0; if ($mode == 'mine') $mine = 1; -$projectid = isset($_GET["id"]) ? GETPOST("id", "int", 1) : GETPOST("projectid", "int"); +$projectid = ''; +$projectid = isset($_GET["id"]) ? $_GET["id"] : $_POST["projectid"]; $hookmanager->initHooks(array('timesheetperdaycard')); @@ -92,12 +93,15 @@ { $usertoprocess = $user; $search_usertoprocessid = $usertoprocess->id; -} elseif ($search_usertoprocessid > 0) +} +elseif ($search_usertoprocessid > 0) { $usertoprocess = new User($db); $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; -} else { +} +else +{ $usertoprocess = new User($db); } @@ -127,10 +131,10 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) - { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) - $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); - } + { + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) + $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + } } $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -158,8 +162,8 @@ $search_thirdparty = ''; $search_declared_progress = ''; - $search_array_options_project = array(); - $search_array_options_task = array(); + $search_array_options_project = array(); + $search_array_options_task = array(); // We redefine $usertoprocess $usertoprocess = $user; @@ -189,7 +193,9 @@ { $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; - } else { + } + else + { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -225,7 +231,9 @@ $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); } } - } else { + } + else + { dol_print_error($db); } } @@ -238,7 +246,9 @@ { $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); - } else { + } + else + { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -262,7 +272,6 @@ { if (intval($time) > 0) { - $matches = array(); // Hours or minutes of duration if (preg_match("/([0-9]+)duration(hour|min)/", $key, $matches)) { @@ -285,7 +294,6 @@ foreach ($timespent_duration as $key => $val) { $object->fetch($key); - $taskid = $object->id; if (GETPOSTISSET($taskid.'progress')) $object->progress = GETPOST($taskid.'progress', 'int'); else unset($object->progress); @@ -293,11 +301,13 @@ $object->timespent_duration = $val; $object->timespent_fk_user = $usertoprocess->id; $object->timespent_note = GETPOST($key.'note'); - if (GETPOST($key."hour", 'int') != '' && GETPOST($key."hour", 'int') >= 0) // If hour was entered + if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered { - $object->timespent_datehour = dol_mktime(GETPOST($key."hour", 'int'), GETPOST($key."min", 'int'), 0, $monthofday, $dayofday, $yearofday); + $object->timespent_datehour = dol_mktime(GETPOST($key."hour"), GETPOST($key."min"), 0, $monthofday, $dayofday, $yearofday); $object->timespent_withhour = 1; - } else { + } + else + { $object->timespent_datehour = dol_mktime(12, 0, 0, $monthofday, $dayofday, $yearofday); } $object->timespent_date = $object->timespent_datehour; @@ -305,7 +315,9 @@ if ($object->timespent_date > 0) { $result = $object->addTimeSpent($user); - } else { + } + else + { setEventMessages("ErrorBadDate", null, 'errors'); $error++; break; @@ -327,7 +339,9 @@ header('Location: '.$_SERVER["PHP_SELF"].'?'.($projectid ? 'id='.$projectid : '').($search_usertoprocessid ? '&search_usertoprocessid='.$search_usertoprocessid : '').($mode ? '&mode='.$mode : '').'&year='.$yearofday.'&month='.$monthofday.'&day='.$dayofday); exit; } - } else { + } + else + { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } } @@ -433,7 +447,7 @@ //$nav .= ' '; $nav .= ' '; -$picto = 'clock'; +$picto = 'calendarweek'; print '
id > 0 ? '?id='.$project->id : '').'">'; print ''; @@ -447,12 +461,13 @@ print ''; $head = project_timesheet_prepare_head($mode, $usertoprocess); -print dol_get_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, $picto); +dol_fiche_head($head, 'inputperday', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else { +else +{ if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -462,12 +477,14 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; -} else { +} +else +{ print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; -print dol_get_fiche_end(); +dol_fiche_end(); print '
'.$nav.'
'; // We move this before the assign to components so, the default submit button is not the assign to. @@ -476,7 +493,6 @@ $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; -print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; @@ -501,22 +517,22 @@ // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'; +$moreforfilter .= '
'.$langs->trans('User').'
'; $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); -$moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); +$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; + $moreforfilter .= '
'.$langs->trans('Project').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; } @@ -539,7 +555,7 @@ if (!empty($arrayfields['t.progress']['checked'])) $addcolspan++; foreach ($arrayfields as $key => $val) { - if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; + if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; } print '
'; @@ -557,11 +573,11 @@ print ''; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['t.progress']['checked'])) { - print ''; + print ''; } print ''; print ''; @@ -584,11 +600,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''.$langs->trans("PlannedWorkload").''; + print ''.$langs->trans("PlannedWorkload").''; } if (!empty($arrayfields['t.progress']['checked'])) { - print ''.$langs->trans("ProgressDeclared").''; + print ''.$langs->trans("ProgressDeclared").''; } /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; @@ -612,24 +628,20 @@ } } -$statusofholidaytocheck = Holiday::STATUS_APPROVED; +$statusofholidaytocheck = '3'; $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, $statusofholidaytocheck); // $daytoparse is a date with hours = 0 $isavailable[$daytoparse] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day -$test = num_public_holiday($daytoparse, $daytoparse + 86400, $mysoc->country_code); -if ($test) $isavailable[$daytoparse] = array('morning'=>false, 'afternoon'=>false, 'morning_reason'=>'public_holiday', 'afternoon_reason'=>'public_holiday'); - $tmparray = dol_getdate($daytoparse, true); // detail of current day -// For monday, must be 0 for monday if MAIN_START_WEEK = 1, must be 1 for monday if MAIN_START_WEEK = 0 -$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1)); -// numstartworkingday and numendworkingday are default start and end date of working days (1 means sunday if MAIN_START_WEEK is 0, 1 means monday if MAIN_START_WEEK is 1) +$idw = $tmparray['wday']; + $cssweekend = ''; -if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. +if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. { $cssweekend = 'weekend'; } -$tmpday = dol_time_plus_duree($daytoparse, $idw, 'd'); +$tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd'); $cssonholiday = ''; if (!$isavailable[$daytoparse]['morning'] && !$isavailable[$daytoparse]['afternoon']) $cssonholiday .= 'onholidayallday '; @@ -655,11 +667,25 @@ //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; + $tmparray = dol_getdate($daytoparse, true); // detail of current day + $idw = $tmparray['wday']; + + $cssweekend = ''; + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. + { + $cssweekend = 'weekend'; + } + + $cssonholiday = ''; + if (!$isavailable[$daytoparse]['morning'] && !$isavailable[$daytoparse]['afternoon']) $cssonholiday .= 'onholidayallday '; + elseif (!$isavailable[$daytoparse]['morning']) $cssonholiday .= 'onholidaymorning '; + elseif (!$isavailable[$daytoparse]['afternoon']) $cssonholiday .= 'onholidayafternoon '; + print '
 
'; print ''; - print ''; - print ''; + print ''; + print ''; } @@ -742,13 +768,29 @@ //print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; + $tmparray = dol_getdate($daytoparse, true); // detail of current day + $idw = $tmparray['wday']; + + $cssweekend = ''; + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. + { + $cssweekend = 'weekend'; + } + + $cssonholiday = ''; + if (!$isavailable[$daytoparse]['morning'] && !$isavailable[$daytoparse]['afternoon']) $cssonholiday .= 'onholidayallday '; + elseif (!$isavailable[$daytoparse]['morning']) $cssonholiday .= 'onholidaymorning '; + elseif (!$isavailable[$daytoparse]['afternoon']) $cssonholiday .= 'onholidayafternoon '; + print '
 
'; print ' '; } -} else { +} +else +{ print ''.$langs->trans("NoAssignedTasks").''; } print ""; @@ -757,7 +799,7 @@ print ''."\n"; print '
'; -print ''; +print ''; print '
'; print ''; --- /tmp/dsg/dolibarr/htdocs/projet/activity/github_permonth.php +++ /tmp/dsg/dolibarr/htdocs/projet/activity/client_permonth.php @@ -46,7 +46,8 @@ $mine = 0; if ($mode == 'mine') $mine = 1; -$projectid = isset($_GET["id"]) ? GETPOST("id", "int", 1) : GETPOST("projectid", "int"); +$projectid = ''; +$projectid = isset($_GET["id"]) ? $_GET["id"] : $_POST["projectid"]; // Security check $socid = 0; @@ -95,12 +96,15 @@ { $usertoprocess = $user; $search_usertoprocessid = $usertoprocess->id; -} elseif ($search_usertoprocessid > 0) +} +elseif ($search_usertoprocessid > 0) { $usertoprocess = new User($db); $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; -} else { +} +else +{ $usertoprocess = new User($db); } @@ -145,7 +149,9 @@ { $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; - } else { + } + else + { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -182,7 +188,9 @@ $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); } } - } else { + } + else + { dol_print_error($db); } } @@ -195,7 +203,9 @@ { $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); - } else { + } + else + { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -215,7 +225,9 @@ if (empty($timetoadd)) { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); - } else { + } + else + { foreach ($timetoadd as $taskid => $value) // Loop on each task { $updateoftaskdone = 0; @@ -361,10 +373,10 @@ //$nav.=' '; $nav .= ' '; -$picto = 'clock'; +$picto = 'calendarweek'; print '
'; -print ''; +print ''; print ''; print ''; print ''; @@ -372,12 +384,13 @@ print ''; $head = project_timesheet_prepare_head($mode, $usertoprocess); -print dol_get_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, $picto); +dol_fiche_head($head, 'inputpermonth', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else { +else +{ if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -387,12 +400,14 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; -} else { +} +else +{ print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; -print dol_get_fiche_end(); +dol_fiche_end(); print '
'.$nav.'
'; // We move this before the assign to components so, the default submit button is not the assign to. @@ -400,7 +415,6 @@ $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; -print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1); print '
'; print ' '; @@ -426,22 +440,22 @@ // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'; +$moreforfilter .= '
'.$langs->trans('User').'
'; $includeonly = 'hierachyme'; if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); -$moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; + $moreforfilter .= '
'.$langs->trans('Project').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; } @@ -502,10 +516,7 @@ // By default, we can edit only tasks we are assigned to $restrictviewformytask = (empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED) ? 1 : 0); -// Get if user is available or not for each day $isavailable = array(); -// TODO See code into perweek.php to initialize isavailable array - if (count($tasksarray) > 0) { @@ -598,7 +609,9 @@ print '
 
'; } -} else { +} +else +{ print ''.$langs->trans("NoAssignedTasks").''; } print ""; @@ -608,7 +621,7 @@ print ''."\n"; print '
'; -print ''; +print ''; print '
'; print '
'."\n\n"; --- /tmp/dsg/dolibarr/htdocs/projet/activity/github_perweek.php +++ /tmp/dsg/dolibarr/htdocs/projet/activity/client_perweek.php @@ -48,7 +48,8 @@ $mine = 0; if ($mode == 'mine') $mine = 1; -$projectid = isset($_GET["id"]) ? GETPOST("id", "int", 1) : GETPOST("projectid", "int"); +$projectid = ''; +$projectid = isset($_GET["id"]) ? $_GET["id"] : $_POST["projectid"]; $hookmanager->initHooks(array('timesheetperweekcard')); @@ -103,12 +104,15 @@ { $usertoprocess = $user; $search_usertoprocessid = $usertoprocess->id; -} elseif ($search_usertoprocessid > 0) +} +elseif ($search_usertoprocessid > 0) { $usertoprocess = new User($db); $usertoprocess->fetch($search_usertoprocessid); $search_usertoprocessid = $usertoprocess->id; -} else { +} +else +{ $usertoprocess = new User($db); } @@ -118,7 +122,8 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); +//$extrafields->fetch_name_optionals_label('projet'); +$extrafields->fetch_name_optionals_label('projet_task'); $arrayfields = array(); /*$arrayfields=array( @@ -143,7 +148,7 @@ foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) { if (!empty($extrafields->attributes['projet_task']['list'][$key])) - $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes['projet_task']['label'][$key], 'checked'=>(($extrafields->attributes['projet_task']['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes['projet_task']['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); + $arrayfields["efpt.".$key] = array('label'=>$extrafields->attributes['projet_task']['label'][$key], 'checked'=>(($extrafields->attributes['projet_task']['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes['projet_task']['pos'][$key], 'enabled'=>(abs($extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); } } $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -157,7 +162,6 @@ /* * Actions */ - $parameters = array('id' => $id, 'taskid' => $taskid, 'projectid' => $projectid); $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'); @@ -173,8 +177,8 @@ $search_thirdparty = ''; $search_declared_progress = ''; - $search_array_options_project = array(); - $search_array_options_task = array(); + $search_array_options_project = array(); + $search_array_options_task = array(); // We redefine $usertoprocess $usertoprocess = $user; @@ -201,7 +205,9 @@ { $result = $object->fetch($taskid, $ref); if ($result < 0) $error++; - } else { + } + else + { setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("Task")), '', 'errors'); $error++; } @@ -238,7 +244,9 @@ $result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal'); } } - } else { + } + else + { dol_print_error($db); } } @@ -251,7 +259,9 @@ { $langs->load("errors"); setEventMessages($langs->trans("ErrorTaskAlreadyAssigned"), null, 'warnings'); - } else { + } + else + { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -271,7 +281,9 @@ if (empty($timetoadd)) { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); - } else { + } + else + { foreach ($timetoadd as $taskid => $value) // Loop on each task { $updateoftaskdone = 0; @@ -346,21 +358,22 @@ $param .= ($search_task_ref ? '&search_task_ref='.urlencode($search_task_ref) : ''); $param .= ($search_task_label ? '&search_task_label='.urlencode($search_task_label) : ''); - /*$search_array_options=$search_array_options_project; + /*$search_array_options=$search_array_options_project; $search_options_pattern='search_options_'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; */ - $search_array_options = $search_array_options_task; - $search_options_pattern = 'search_task_options_'; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - - // Redirect to avoid submit twice on back - header('Location: '.$_SERVER["PHP_SELF"].'?'.$param); - exit; + $search_array_options = $search_array_options_task; + $search_options_pattern = 'search_task_options_'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + + // Redirect to avoid submit twice on back + header('Location: '.$_SERVER["PHP_SELF"].'?'.$param); + exit; } } } + /* @@ -451,7 +464,7 @@ //$nav .= ' '; $nav .= ' '; -$picto = 'clock'; +$picto = 'calendarweek'; print '
'; print ''; @@ -464,12 +477,13 @@ print ''; $head = project_timesheet_prepare_head($mode, $usertoprocess); -print dol_get_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, $picto); +dol_fiche_head($head, 'inputperweek', $langs->trans('TimeSpent'), -1, 'task'); // Show description of content print '
'; if ($mine || ($usertoprocess->id == $user->id)) print $langs->trans("MyTasksDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; -else { +else +{ if (empty($usertoprocess->id) || $usertoprocess->id < 0) { if ($user->rights->projet->all->lire && !$socid) print $langs->trans("ProjectsDesc").'.'.($onlyopenedproject ? ' '.$langs->trans("OnlyOpenedProject") : '').'
'; @@ -479,12 +493,14 @@ if ($mine || ($usertoprocess->id == $user->id)) { print $langs->trans("OnlyYourTaskAreVisible").'
'; -} else { +} +else +{ print $langs->trans("AllTaskVisibleButEditIfYouAreAssigned").'
'; } print '
'; -print dol_get_fiche_end(); +dol_fiche_end(); print '
'.$nav.'
'; // We move this before the assign to components so, the default submit button is not the assign to. @@ -492,7 +508,6 @@ $titleassigntask = $langs->transnoentities("AssignTaskToMe"); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); print '
'; -print img_picto('', 'projecttask'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
'; print ' '; @@ -529,16 +544,11 @@ //print dol_print_date($dayinloopwithouthours, 'dayhour').' '; //print dol_print_date($dayinloopfromfirstdaytoshow, 'dayhour').'
'; - $statusofholidaytocheck = Holiday::STATUS_APPROVED; + $statusofholidaytocheck = '3'; $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, $statusofholidaytocheck); $isavailable[$dayinloopfromfirstdaytoshow] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day - - $test = num_public_holiday($dayinloopfromfirstdaytoshow, $dayinloopfromfirstdaytoshow + 86400, $mysoc->country_code); - if ($test) $isavailable[$dayinloopfromfirstdaytoshow] = array('morning'=>false, 'afternoon'=>false, 'morning_reason'=>'public_holiday', 'afternoon_reason'=>'public_holiday'); -} -//var_dump($isavailable); - +} $moreforfilter = ''; @@ -556,22 +566,22 @@ // If the user can view user other than himself $moreforfilter .= '
'; -$moreforfilter .= '
'; +$moreforfilter .= '
'.$langs->trans('User').'
'; $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) $includeonly = array($user->id); -$moreforfilter .= img_picto($langs->trans('User'), 'user').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= $form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
'; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Project'), 'project').''; + $moreforfilter .= '
'.$langs->trans('Project').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('ThirdParty'), 'company').''; + $moreforfilter .= '
'.$langs->trans('ThirdParty').'
'; + $moreforfilter .= ''; $moreforfilter .= '
'; } @@ -596,7 +606,7 @@ if (!empty($arrayfields['t.progress']['checked'])) $addcolspan++; foreach ($arrayfields as $key => $val) { - if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; + if ($val['checked'] && substr($key, 0, 5) == 'efpt.') $addcolspan++; } print '
'; @@ -614,11 +624,11 @@ print ''; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['t.progress']['checked'])) { - print ''; + print ''; } print ''; for ($idw = 0; $idw < 7; $idw++) @@ -642,11 +652,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; if (!empty($arrayfields['t.planned_workload']['checked'])) { - print ''.$langs->trans("PlannedWorkload").''; + print ''.$langs->trans("PlannedWorkload").''; } if (!empty($arrayfields['t.progress']['checked'])) { - print ''.$langs->trans("ProgressDeclared").''; + print ''.$langs->trans("ProgressDeclared").''; } /*print ''.$langs->trans("TimeSpent").''; if ($usertoprocess->id == $user->id) print ''.$langs->trans("TimeSpentByYou").''; @@ -660,7 +670,7 @@ $dayinloop = dol_time_plus_duree($startday, $idw, 'd'); $cssweekend = ''; - if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. { $cssweekend = 'weekend'; } @@ -685,7 +695,7 @@ if ($conf->use_javascript_ajax) { print ''; - print ''; + print ''; print $langs->trans("Total"); print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; @@ -693,7 +703,7 @@ for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; - if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. { $cssweekend = 'weekend'; } @@ -704,6 +714,7 @@ if (!$isavailable[$tmpday]['morning'] && !$isavailable[$tmpday]['afternoon']) $cssonholiday .= 'onholidayallday '; elseif (!$isavailable[$tmpday]['morning']) $cssonholiday .= 'onholidaymorning '; elseif (!$isavailable[$tmpday]['afternoon']) $cssonholiday .= 'onholidayafternoon '; + print '
 
'; } print '
 
'; @@ -772,13 +783,13 @@ if ($isdiff) { print ''; - print ''; + print ''; print $langs->trans("OtherFilteredTasks"); print ''; for ($idw = 0; $idw < 7; $idw++) { $cssweekend = ''; - if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. { $cssweekend = 'weekend'; } @@ -794,8 +805,8 @@ } print ''; } - print ' '; - print ''; + print ' '; + print ''; } if ($conf->use_javascript_ajax) @@ -806,9 +817,10 @@ print ' - '.$langs->trans("ExpectedWorkedHours").': '.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).''; print ''; - for ($idw = 0; $idw < 7; $idw++) { + for ($idw = 0; $idw < 7; $idw++) + { $cssweekend = ''; - if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css. + if (($idw + 1) < $numstartworkingday || ($idw + 1) > $numendworkingday) // This is a day is not inside the setup of working days, so we use a week-end css. { $cssweekend = 'weekend'; } @@ -822,10 +834,12 @@ print '
 
'; } - print '
 
+ print '
 
'; } -} else { +} +else +{ print ''.$langs->trans("NoAssignedTasks").''; } print ""; @@ -834,7 +848,7 @@ print ''."\n"; print '
'; -print ''; +print ''; print '
'; print ''."\n\n";