From 06302b940724c6cb67e94aa60a1dad8ab5fdc09d Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Tue, 11 Apr 2023 13:34:58 +0200 Subject: [PATCH] #218 [Mod] add: remove unused view files --- view/timesheet/timesheet_agenda.php | 265 ------------------------ view/timesheet/timesheet_card.php | 302 +++++++++++----------------- view/timesheet/timesheet_note.php | 175 ---------------- 3 files changed, 121 insertions(+), 621 deletions(-) delete mode 100644 view/timesheet/timesheet_agenda.php delete mode 100644 view/timesheet/timesheet_note.php diff --git a/view/timesheet/timesheet_agenda.php b/view/timesheet/timesheet_agenda.php deleted file mode 100644 index fb66b19..0000000 --- a/view/timesheet/timesheet_agenda.php +++ /dev/null @@ -1,265 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file timesheet_agenda.php - * \ingroup dolisirh - * \brief Tab of events on TimeSheet - */ - -// Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res && file_exists("../../../../main.inc.php")) { - $res = @include "../../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - -// Libraries -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - -require_once __DIR__ . '/../../class/timesheet.class.php'; -require_once __DIR__ . '/../../lib/dolisirh_timesheet.lib.php'; - -// Global variables definitions -global $conf, $db, $hookmanager, $langs, $user; - -// Load translation files required by the page -$langs->loadLangs(array("dolisirh@dolisirh", "other")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - -if (GETPOST('actioncode', 'array')) { - $actioncode = GETPOST('actioncode', 'array', 3); - if (!count($actioncode)) { - $actioncode = '0'; - } -} else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); -} -$search_agenda_label = GETPOST('search_agenda_label'); - -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { - $page = 0; -} // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (!$sortfield) { - $sortfield = 'a.datep,a.id'; -} -if (!$sortorder) { - $sortorder = 'DESC,DESC'; -} - -// Initialize technical objects -$object = new TimeSheet($db); -$extrafields = new ExtraFields($db); -$project = new Project($db); - -$hookmanager->initHooks(array('timesheetagenda', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals - -// There is several ways to check permission. -$permissiontoread = $user->rights->dolisirh->timesheet->read; -$permissiontoadd = $user->rights->dolisirh->timesheet->write; - -// Security check (enable the most restrictive one) -if (empty($conf->dolisirh->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); - -/* - * Actions - */ - -$parameters = array('id'=>$id); -$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'); -} - -if (empty($reshook)) { - // Cancel - if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { - header("Location: ".$backtopage); - exit; - } - - // Purge search criteria - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $actioncode = ''; - $search_agenda_label = ''; - } -} - - - -/* - * View - */ - -// Initialize view objects -$form = new Form($db); - -if ($object->id > 0) { - $title = $langs->trans('TimeSheet') . ' - ' .$langs->trans("Agenda"); - $help_url = 'FR:Module_DoliSIRH'; - $morejs = array("/dolisirh/js/dolisirh.js"); - $morecss = array("/dolisirh/css/dolisirh.css"); - - llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss); - - if (!empty($conf->notification->enabled)) { - $langs->load("mails"); - } - $head = timesheetPrepareHead($object); - - print dol_get_fiche_head($head, 'agenda', $langs->trans("TimeSheet"), -1, $object->picto); - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - // Thirdparty - if (! empty($conf->societe->enabled)) { - $object->fetch_thirdparty(); - $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - } - // Project - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
' . $langs->trans('Project') . ' '; - if (! empty($object->fk_project)) { - $project->fetch($object->fk_project); - $morehtmlref .= ': ' . $project->getNomUrl(1, '', 1); - } else { - $morehtmlref .= ''; - } - } - $morehtmlref .= '
'; - - $object->picto = 'timesheet_small@dolisirh'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - print '
'; - print '
'; - - $object->info($object->id); - dol_print_object_info($object, 1); - - print '
'; - - print dol_get_fiche_end(); - - // Actions buttons - $objthirdparty = $object; - $objcon = new stdClass(); - - $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); - $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; - $out .= '&backtopage='.urlencode($urlbacktopage); - $permok = $user->rights->agenda->myactions->create; - if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { - //$out.='trans("AddAnAction"),'filenew'); - //$out.=""; - } - - print '
'; - - if (!empty($conf->agenda->enabled)) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; - } else { - print ''.$langs->trans("AddAction").''; - } - } - - print '
'; - - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { - $param = '&id='.$object->id; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); - } - - print load_fiche_titre($langs->trans("ActionsOnTimeSheet"), '', ''); - - // List of all actions - $filters = array(); - $filters['search_agenda_label'] = $search_agenda_label; - - // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); - } -} - -// End of page -llxFooter(); -$db->close(); diff --git a/view/timesheet/timesheet_card.php b/view/timesheet/timesheet_card.php index c5bf09e..068533d 100644 --- a/view/timesheet/timesheet_card.php +++ b/view/timesheet/timesheet_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2021-2023 EVARISK * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,45 +21,20 @@ * \brief Page to create/edit/view timesheet */ -// Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res && file_exists("../../../../main.inc.php")) { - $res = @include "../../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); +// Load DoliSIRH environment +if (file_exists('../../dolisirh.main.inc.php')) { + require_once __DIR__ . '/../../dolisirh.main.inc.php'; +} elseif (file_exists('../../../dolisirh.main.inc.php')) { + require_once __DIR__ . '/../../../dolisirh.main.inc.php'; +} else { + die('Include of dolisirh main fails'); } // Libraries -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; +require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; require_once __DIR__ . '/../../class/timesheet.class.php'; require_once __DIR__ . '/../../class/dolisirhdocuments/timesheetdocument.class.php'; @@ -67,11 +42,13 @@ require_once __DIR__ . '/../../lib/dolisirh_timesheet.lib.php'; require_once __DIR__ . '/../../lib/dolisirh_function.lib.php'; +require_once __DIR__ . '/../../../saturne/class/saturnesignature.class.php'; + // Global variables definitions global $conf, $db, $hookmanager, $langs, $mysoc, $user; // Load translation files required by the page -$langs->loadLangs(array("dolisirh@dolisirh", "other")); +saturne_load_langs(); // Get parameters $id = GETPOST('id', 'int'); @@ -83,14 +60,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $lineid = GETPOST('lineid', 'int'); -$year = (GETPOST("year", 'int') ? GETPOST("year", "int") : date("Y")); -$month = (GETPOST("month", 'int') ? GETPOST("month", "int") : date("m")); -$day = (GETPOST("day", 'int') ? GETPOST("day", "int") : date("d")); +$year = (GETPOST('year', 'int') ? GETPOST('year', 'int') : date('Y')); +$month = (GETPOST('month', 'int') ? GETPOST('month', 'int') : date('m')); +$day = (GETPOST('day', 'int') ? GETPOST('day', 'int') : date('d')); // Initialize technical objects $object = new TimeSheet($db); $objectline = new TimeSheetLine($db); -$signatory = new TimeSheetSignature($db); +$signatory = new SaturneSignature($db); $timesheetdocument = new TimeSheetDocument($db); $extrafields = new ExtraFields($db); $project = new Project($db); @@ -100,7 +77,10 @@ $task = new Task($db); $usertmp = new User($db); -$hookmanager->initHooks(array('timesheetcard', 'globalcard')); // Note that conf->hooks_modules contains array +// Initialize view objects +$form = new Form($db); + +$hookmanager->initHooks(['timesheetcard', 'globalcard']); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -108,8 +88,8 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); +$search_all = GETPOST('search_all', 'alpha'); +$search = []; foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha')) { $search[$key] = GETPOST('search_'.$key, 'alpha'); @@ -121,25 +101,21 @@ } // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be included, not include_once. + +$upload_dir = $conf->dolisirh->multidir_output[$object->entity ?? 1]; -// There is several ways to check permission. +// Security check - Protection if external user $permissiontoread = $user->rights->dolisirh->timesheet->read; -$permissiontoadd = $user->rights->dolisirh->timesheet->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoadd = $user->rights->dolisirh->timesheet->write; $permissiontodelete = $user->rights->dolisirh->timesheet->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$permissionnote = $user->rights->dolisirh->timesheet->write; // Used by the include of actions_setnotes.inc.php - -$upload_dir = $conf->dolisirh->multidir_output[isset($object->entity) ? $object->entity : 1]; - -// Security check (enable the most restrictive one) -if (empty($conf->dolisirh->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +saturne_check_access($permissiontoread); /* * Actions */ -$parameters = array(); +$parameters = []; $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'); @@ -216,7 +192,7 @@ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if ( ! empty($newlang)) { - $outputlangs = new Translate("", $conf); + $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang($newlang); } @@ -237,7 +213,7 @@ $action = ''; } else { if (empty($donotredirect)) { - setEventMessages($langs->trans("FileGenerated") . ' - ' . $timesheetdocument->last_main_doc, null); + setEventMessages($langs->trans('FileGenerated') . ' - ' . $timesheetdocument->last_main_doc, null); $urltoredirect = $_SERVER['REQUEST_URI']; $urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect); $urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop @@ -252,12 +228,12 @@ if ( ! empty($upload_dir)) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $langs->load("other"); + $langs->load('other'); $filetodelete = GETPOST('file', 'alpha'); $file = $upload_dir . '/' . $filetodelete; $ret = dol_delete_file($file, 0, 0, 0, $object); - if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs'); - else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filetodelete), null, 'errors'); + if ($ret) setEventMessages($langs->trans('FileWasRemoved', $filetodelete), null, 'mesgs'); + else setEventMessages($langs->trans('ErrorFailToDeleteFile', $filetodelete), null, 'errors'); // Make a redirect to avoid to keep the remove_file into the url that create side effects $urltoredirect = $_SERVER['REQUEST_URI']; @@ -329,7 +305,7 @@ // Creation timesheet line OK $urltogo = str_replace('__ID__', $result, $backtopage); $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + header('Location: ' . $urltogo); exit; } else { // Creation timesheet line KO @@ -357,7 +333,7 @@ // Update timesheet line OK $urltogo = str_replace('__ID__', $result, $backtopage); $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $parent_id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + header('Location: ' . $urltogo); exit; } else { // Update timesheet line KO @@ -390,7 +366,7 @@ // Set locked OK $urltogo = str_replace('__ID__', $result, $backtopage); $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + header('Location: ' . $urltogo); exit; } } else { @@ -413,7 +389,7 @@ // Set Archived OK $urltogo = str_replace('__ID__', $result, $backtopage); $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + header('Location: ' . $urltogo); exit; } else { // Set Archived KO @@ -424,50 +400,44 @@ } // Actions to send emails - $triggersendname = 'DOLISIRH_TIMESHEET_SENTBYMAIL'; - $autocopy = 'MAIN_MAIL_AUTOCOPY_TIMESHEET_TO'; - $trackid = 'timesheet'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; + $triggersendname = strtoupper($object->element) . '_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_' . strtoupper($object->element) . '_TO'; + include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; } /* * View */ -// Initialize view objects -$form = new Form($db); - -$title = $langs->trans("TimeSheet"); +$title = $langs->trans(ucfirst($object->element)); $help_url = 'FR:Module_DoliSIRH'; -$morejs = array("/dolisirh/js/dolisirh.js"); -$morecss = array("/dolisirh/css/dolisirh.css"); -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss); +saturne_header(0, '', $title, $help_url); // Part to create if ($action == 'create') { if (empty($permissiontoadd)) { - accessforbidden($langs->trans('NotEnoughPermissions'), 0, 1); + accessforbidden($langs->trans('NotEnoughPermissions'), 0); exit; } - print load_fiche_titre($langs->trans("NewTimeSheet"), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans('New' . ucfirst($object->element)), '', 'object_' . $object->picto); - print '
'; - print ''; + print ''; + print ''; print ''; if ($backtopage) { - print ''; + print ''; } if ($backtopageforcancel) { print ''; } - print dol_get_fiche_head(array(), ''); + print dol_get_fiche_head(); print ''; - $object->fields['label']['default'] = $langs->trans('TimeSheet') . ' ' . dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "%B %Y") . ' ' . $user->getFullName($langs, 0, 0); + $object->fields['label']['default'] = $langs->trans('TimeSheet') . ' ' . dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), '%B %Y') . ' ' . $user->getFullName($langs, 0, 0); $object->fields['fk_project']['default'] = $conf->global->DOLISIRH_HR_PROJECT; $object->fields['fk_user_assign']['default'] = $user->id; @@ -497,11 +467,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; // Categories - if (!empty($conf->categorie->enabled)) { - print '"; + print img_picto('', 'category') . $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx'); + print ''; } // Other attributes @@ -511,31 +481,29 @@ print dol_get_fiche_end(); - print $form->buttonsSaveCancel("Create"); + print $form->buttonsSaveCancel('Create'); print ''; - - //dol_set_focus('input[name="ref"]'); } // Part to edit record if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("ModifyTimeSheet"), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans('Modify' . ucfirst($object->element)), '', 'object_' . $object->picto); - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; if ($backtopage) { - print ''; + print ''; } if ($backtopageforcancel) { - print ''; + print ''; } print dol_get_fiche_head(); - print '
'.$langs->trans("Categories").''; + if (isModEnabled('categorie')) { + print '
'.$langs->trans('Categories').''; $cate_arbo = $form->select_all_categories('timesheet', '', 'parent', 64, 0, 1); - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); - print "
'."\n"; + print '
'; $date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); @@ -550,19 +518,19 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; // Tags-Categories - if ($conf->categorie->enabled) { - print '"; + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx'); + print ''; } // Other attributes @@ -581,40 +549,38 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_optionals(); - $head = timesheetPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("TimeSheet"), -1, $object->picto); + saturne_get_fiche_head($object, 'card', $title); + saturne_banner_tab($object); $formconfirm = ''; + // setDraft confirmation - if (($action == 'setDraft' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js - || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { // Always output when not jmobile nor js - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpenTimeSheet'), $langs->trans('ConfirmReOpenTimeSheet', $object->ref), 'confirm_setdraft', '', 'yes', 'actionButtonInProgress', 350, 600); + if (($action == 'setDraft' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { + $formconfirm .= $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('ReOpenTimeSheet'), $langs->trans('ConfirmReOpenTimeSheet', $object->ref), 'confirm_setdraft', '', 'yes', 'actionButtonInProgress', 350, 600); } // setPendingSignature confirmation - if (($action == 'setPendingSignature' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js - || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { // Always output when not jmobile nor js - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateTimeSheet'), $langs->trans('ConfirmValidateTimeSheet', $object->ref), 'confirm_validate', '', 'yes', 'actionButtonPendingSignature', 350, 600); + if (($action == 'setPendingSignature' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { + $formconfirm .= $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('ValidateTimeSheet'), $langs->trans('ConfirmValidateTimeSheet', $object->ref), 'confirm_validate', '', 'yes', 'actionButtonPendingSignature', 350, 600); } // setLocked confirmation - if (($action == 'setLocked' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js - || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { // Always output when not jmobile nor js - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('LockTimeSheet'), $langs->trans('ConfirmLockTimeSheet', $object->ref), 'confirm_setLocked', '', 'yes', 'actionButtonLock', 350, 600); + if (($action == 'setLocked' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) || (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { + $formconfirm .= $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('LockTimeSheet'), $langs->trans('ConfirmLockTimeSheet', $object->ref), 'confirm_setLocked', '', 'yes', 'actionButtonLock', 350, 600); } // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteTimeSheet'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 'yes', 1); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id, $langs->trans('DeleteTimeSheet'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 'yes', 1); } // Confirmation to delete line if ($action == 'ask_deleteline') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } // Confirmation remove file if ($action == 'removefile') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&file=' . GETPOST('file') . '&entity=' . $conf->entity, $langs->trans('RemoveFileTimeSheet'), $langs->trans('ConfirmRemoveFileTimeSheet'), 'remove_file', '', 'yes', 1, 350, 600); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . '&file=' . GETPOST('file') . '&entity=' . $conf->entity, $langs->trans('RemoveFileTimeSheet'), $langs->trans('ConfirmRemoveFileTimeSheet'), 'remove_file', '', 'yes', 1, 350, 600); } // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $parameters = ['formConfirm' => $formconfirm, 'lineid' => $lineid]; $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $formconfirm .= $hookmanager->resPrint; @@ -625,48 +591,22 @@ // Print form confirm print $formconfirm; - // Object card - // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; - - $morehtmlref = '
'; - // Thirdparty - if (!empty($conf->societe->enabled)) { - $object->fetch_thirdparty(); - $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - } - // Project - if (!empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
' . $langs->trans('Project') . ' '; - if (!empty($object->fk_project)) { - $project->fetch($object->fk_project); - $morehtmlref .= ': ' . $project->getNomUrl(1, '', 1); - } else { - $morehtmlref .= ''; - } - } - $morehtmlref .= '
'; - - $object->picto = 'timesheet_small@dolisirh'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; - print '
'; - print '
'.$langs->trans("Categories").''; + if (isModEnabled('categorie')) { + print '
' . $langs->trans('Categories') . ''; $cate_arbo = $form->select_all_categories('timesheet', '', 'parent', 64, 0, 1); $c = new Categorie($db); $cats = $c->containing($object->id, 'timesheet'); - $arrayselected = array(); + $arrayselected = []; if (is_array($cats)) { foreach ($cats as $cat) { $arrayselected[] = $cat->id; } } - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); - print "
' . "\n"; + print '
'; // Common attributes - unset($object->fields['fk_project']); // Hide field already shown in banner - unset($object->fields['fk_soc']); // Hide field already shown in banner + unset($object->fields['label']); // Hide field already shown in banner + unset($object->fields['fk_project']); // Hide field already shown in banner + unset($object->fields['fk_soc']); // Hide field already shown in banner include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; // Categories - if ($conf->categorie->enabled) { - print '"; + print ''; } $now = dol_now(); @@ -676,8 +616,8 @@ $firstdaytoshow = $object->date_start - 12 * 3600; $lastdaytoshow = $object->date_end - 12 * 3600; - $start_date = dol_print_date($firstdaytoshow, "dayreduceformat"); - $end_date = dol_print_date($lastdaytoshow, "dayreduceformat"); + $start_date = dol_print_date($firstdaytoshow, 'dayreduceformat'); + $end_date = dol_print_date($lastdaytoshow, 'dayreduceformat'); $daysInRange = dolisirh_num_between_day($firstdaytoshow, $lastdaytoshow, 1); @@ -701,12 +641,12 @@ $planned_working_time = $timeSpendingInfos['planned']; print ''; @@ -714,9 +654,9 @@ $passed_working_time = $timeSpendingInfos['passed']; print ''; @@ -726,11 +666,11 @@ if ($difftotaltime < 0) { $morecssHours = colorStringToArray($conf->global->DOLISIRH_EXCEEDED_TIME_SPENT_COLOR); $morecssnotice = 'error'; - $noticetitle = $langs->trans('TimeSpentDiff', dol_print_date($firstdaytoshow, "dayreduceformat"), dol_print_date($lastdaytoshow, "dayreduceformat"), dol_print_date(dol_mktime(0, 0, 0, $datestart['mon'], $datestart['mday'], $datestart['year']), "%B %Y")); + $noticetitle = $langs->trans('TimeSpentDiff', dol_print_date($firstdaytoshow, 'dayreduceformat'), dol_print_date($lastdaytoshow, 'dayreduceformat'), dol_print_date(dol_mktime(0, 0, 0, $datestart['mon'], $datestart['mday'], $datestart['year']), '%B %Y')); } elseif ($difftotaltime > 0) { $morecssHours = colorStringToArray($conf->global->DOLISIRH_NOT_EXCEEDED_TIME_SPENT_COLOR); $morecssnotice = 'warning'; - $noticetitle = $langs->trans('TimeSpentMustBeCompleted', dol_print_date($firstdaytoshow, "dayreduceformat"), dol_print_date($lastdaytoshow, "dayreduceformat"), dol_print_date(dol_mktime(0, 0, 0, $datestart['mon'], $datestart['mday'], $datestart['year']), "%B %Y")); + $noticetitle = $langs->trans('TimeSpentMustBeCompleted', dol_print_date($firstdaytoshow, 'dayreduceformat'), dol_print_date($lastdaytoshow, 'dayreduceformat'), dol_print_date(dol_mktime(0, 0, 0, $datestart['mon'], $datestart['mday'], $datestart['year']), '%B %Y')); } elseif ($difftotaltime == 0) { $morecssHours = colorStringToArray($conf->global->DOLISIRH_PERFECT_TIME_SPENT_COLOR); $morecssnotice = 'success'; @@ -749,27 +689,27 @@ } print ''; //Difference between working hours & planned working hours print ''; // Other attributes. Fields from hook formObjectOptions and Extrafields. - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
' . $langs->trans("Categories") . ''; + if (isModEnabled('categorie')) { + print '
' . $langs->trans('Categories') . ''; print $form->showCategories($object->id, 'timesheet', 1); - print "
'; - print $langs->trans("Total"); + print $langs->trans('Total'); print ' - '; - print $langs->trans("ExpectedWorkingHoursMonthTimeSheet", $start_date, $end_date); + print $langs->trans('ExpectedWorkingHoursMonthTimeSheet', $start_date, $end_date); print ' : '; print (($planned_working_time['minutes'] != 0) ? convertSecondToTime($planned_working_time['minutes'] * 60, 'allhourmin') : '00:00') . ''; - print '' . ' - ' . $langs->trans("ExpectedWorkingDayMonth") . ' ' . $planned_working_time['days'] . ''; + print '' . ' - ' . $langs->trans('ExpectedWorkingDayMonth') . ' ' . $planned_working_time['days'] . ''; print ''; print '
'; - print $langs->trans("Total"); + print $langs->trans('Total'); print ' - '; - print $langs->trans("SpentWorkingHoursMonth", $start_date, $end_date); + print $langs->trans('SpentWorkingHoursMonth', $start_date, $end_date); print ' : ' . (($passed_working_time['minutes'] != 0) ? convertSecondToTime($passed_working_time['minutes'] * 60, 'allhourmin') : '00:00') . ''; print '
'; - print $langs->trans("Total"); + print $langs->trans('Total'); print ' - '; - print $langs->trans("ConsumedWorkingHoursMonth", $start_date, $end_date); + print $langs->trans('ConsumedWorkingHoursMonth', $start_date, $end_date); print ' : '.convertSecondToTime($working_time['total'], 'allhourmin').''; - print '' . ' - ' . $langs->trans("ConsumedWorkingDayMonth") . ' '; + print '' . ' - ' . $langs->trans('ConsumedWorkingDayMonth') . ' '; print $working_time['days'] . ''; print ''; print '
'; - print $langs->trans("Total"); + print $langs->trans('Total'); print ' - '; - print $langs->trans("DiffSpentAndConsumedWorkingHoursMonth", $start_date, $end_date); + print $langs->trans('DiffSpentAndConsumedWorkingHoursMonth', $start_date, $end_date); print ' : '; print (($difftotaltime != 0) ? convertSecondToTime(abs($difftotaltime * 60), 'allhourmin') : '00:00').''; print ''; print '
'; print ''; @@ -784,14 +724,14 @@
trans('ErrorConfigWorkingHours') ?>
- trans("GoToWorkingHours", $usertmp->getFullName($langs)) ?> + trans('GoToWorkingHours', $usertmp->getFullName($langs)) ?> @@ -805,7 +745,7 @@ // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -885,37 +825,37 @@ if (empty($reshook) && $permissiontoadd) { // Modify if ($object->status == $object::STATUS_DRAFT) { - print '' . $langs->trans("Modify") . ''; + print '' . $langs->trans('Modify') . ''; } else { - print '' . $langs->trans("Modify") . ''; + print '' . $langs->trans('Modify') . ''; } // Validate if ($object->status == $object::STATUS_DRAFT && $planned_working_time['minutes'] != 0) { - print '' . $langs->trans("Validate") . ''; + print '' . $langs->trans('Validate') . ''; } else { - print '' . $langs->trans("Validate") . ''; + print '' . $langs->trans('Validate') . ''; } // ReOpen if ($object->status == $object::STATUS_VALIDATED) { - print '' . $langs->trans("ReOpenDoli") . ''; + print '' . $langs->trans('ReOpenDoli') . ''; } else { - print '' . $langs->trans("ReOpenDoli") . ''; + print '' . $langs->trans('ReOpenDoli') . ''; } // Sign if ($object->status == $object::STATUS_VALIDATED && !$signatory->checkSignatoriesSignatures($object->id, 'timesheet')) { - print '' . $langs->trans("Sign") . ''; + print '' . $langs->trans('Sign') . ''; } else { - print '' . $langs->trans("Sign") . ''; + print '' . $langs->trans('Sign') . ''; } // Lock if ($object->status == $object::STATUS_VALIDATED && $signatory->checkSignatoriesSignatures($object->id, 'timesheet') && $difftotaltime == 0 && $diffworkinghoursMonth == 0) { - print '' . $langs->trans("Lock") . ''; + print '' . $langs->trans('Lock') . ''; } else { - print '' . $langs->trans("Lock") . ''; + print '' . $langs->trans('Lock') . ''; } // Send @@ -924,9 +864,9 @@ // Archive if ($object->status == $object::STATUS_LOCKED && !empty(dol_dir_list($upload_dir . '/timesheetdocument/' . dol_sanitizeFileName($object->ref)))) { - print '' . $langs->trans("Archive") . ''; + print '' . $langs->trans('Archive') . ''; } else { - print '' . $langs->trans("Archive") . ''; + print '' . $langs->trans('Archive') . ''; } // Delete (need delete permission, or if draft, just need create/modify permission) @@ -951,7 +891,7 @@ $objref = dol_sanitizeFileName($object->ref); $dir_files = $object->element . 'document/' . $objref; $filedir = $upload_dir . '/' . $dir_files; - $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $urlsource = $_SERVER['PHP_SELF']. '?id=' .$object->id; $genallowed = $permissiontoadd; // If you can read, you can build the PDF to read content $delallowed = $permissiontodelete; // If you can create/edit, you can remove a file on card diff --git a/view/timesheet/timesheet_note.php b/view/timesheet/timesheet_note.php deleted file mode 100644 index 380e24a..0000000 --- a/view/timesheet/timesheet_note.php +++ /dev/null @@ -1,175 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file timesheet_note.php - * \ingroup dolisirh - * \brief Tab for notes on TimeSheet - */ - -// Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res && file_exists("../../../../main.inc.php")) { - $res = @include "../../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - -require_once __DIR__ . '/../../class/timesheet.class.php'; -require_once __DIR__ . '/../../lib/dolisirh_timesheet.lib.php'; - -// Global variables definitions -global $conf, $db, $hookmanager, $langs, $user; - -// Load translation files required by the page -$langs->loadLangs(array("dolisirh@dolisirh", "companies")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - -// Initialize technical objects -$object = new TimeSheet($db); -$extrafields = new ExtraFields($db); -$project = new Project($db); - -$hookmanager->initHooks(array('timesheetnote', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be included, not include_once // Must be included, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals - -// There is several ways to check permission. -$permissiontoread = $user->rights->dolisirh->timesheet->read; -$permissiontoadd = $user->rights->dolisirh->timesheet->write; -$permissionnote = $user->rights->dolisirh->timesheet->write; // Used by the included of actions_setnotes.inc.php - -// Security check (enable the most restrictive one) -if (empty($conf->dolisirh->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); - -/* - * Actions - */ - -$parameters = array(); -$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'); -} -if (empty($reshook)) { - include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once -} - -/* - * View - */ - -// Initialize view objects -$form = new Form($db); - -$title = $langs->trans('TimeSheet') . ' - ' . $langs->trans('Notes'); -$help_url = 'FR:Module_DoliSIRH'; -$morejs = array("/dolisirh/js/dolisirh.js"); -$morecss = array("/dolisirh/css/dolisirh.css"); - -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss); - -if ($id > 0 || !empty($ref)) { - $object->fetch_thirdparty(); - - $head = timesheetPrepareHead($object); - - print dol_get_fiche_head($head, 'note', $langs->trans("TimeSheet"), -1, $object->picto); - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - // Thirdparty - if (! empty($conf->societe->enabled)) { - $object->fetch_thirdparty(); - $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - } - // Project - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
' . $langs->trans('Project') . ' '; - if (! empty($object->fk_project)) { - $project->fetch($object->fk_project); - $morehtmlref .= ': ' . $project->getNomUrl(1, '', 1); - } else { - $morehtmlref .= ''; - } - } - $morehtmlref .= '
'; - - $object->picto = 'timesheet_small@dolisirh'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - print '
'; - print '
'; - - $cssclass = "titlefield"; - - if ($object->status >= $object::STATUS_VALIDATED) { - $permissionnote = 0; - } - include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - - print '
'; - - print dol_get_fiche_end(); -} - -// End of page -llxFooter(); -$db->close();