diff --git a/view/timesheet/timesheet_card.php b/view/timesheet/timesheet_card.php index eaba6e4..84feb6f 100644 --- a/view/timesheet/timesheet_card.php +++ b/view/timesheet/timesheet_card.php @@ -16,9 +16,9 @@ */ /** - * \file view/timesheet/timesheet_card.php - * \ingroup dolisirh - * \brief Page to create/edit/view timesheet + * \file view/timesheet/timesheet_card.php + * \ingroup dolisirh + * \brief Page to create/edit/view timesheet */ // Load DoliSIRH environment @@ -31,11 +31,15 @@ } // 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'; +// Load Saturne libraries. +require_once __DIR__ . '/../../../saturne/class/saturnesignature.class.php'; + +// load DoliSIRH libraries. require_once __DIR__ . '/../../class/timesheet.class.php'; require_once __DIR__ . '/../../class/dolisirhdocuments/timesheetdocument.class.php'; require_once __DIR__ . '/../../class/workinghours.class.php'; @@ -50,7 +54,7 @@ // Load translation files required by the page saturne_load_langs(); -// Get parameters +// Get parameters. $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -64,7 +68,7 @@ $month = (GETPOST('month', 'int') ? GETPOST('month', 'int') : date('m')); $day = (GETPOST('day', 'int') ? GETPOST('day', 'int') : date('d')); -// Initialize technical objects +// Initialize technical objects. $object = new TimeSheet($db); $objectline = new TimeSheetLine($db); $signatory = new SaturneSignature($db, 'dolisirh'); @@ -91,13 +95,13 @@ $search_all = GETPOST('search_all', 'alpha'); $search = []; foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } + if (GETPOST('search_'.$key, 'alpha')) { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } } if (empty($action) && empty($id) && empty($ref)) { - $action = 'view'; + $action = 'view'; } // Load object @@ -118,7 +122,7 @@ $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'); + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if (empty($reshook)) { @@ -430,7 +434,7 @@ print ''; } if ($backtopageforcancel) { - print ''; + print ''; } print dol_get_fiche_head(); @@ -909,23 +913,15 @@ $action = 'presend'; } - if ($action != 'presend') { - print '