@@ -214,16 +214,16 @@ |
||
| 214 | 214 | print '<table class="border tableforfield centpercent">'; |
| 215 | 215 | |
| 216 | 216 | print "<tr>"; |
| 217 | - print '<td class="titlefield">' . $langs->trans("DateStartPeriod") . '</td><td>'; |
|
| 217 | + print '<td class="titlefield">'.$langs->trans("DateStartPeriod").'</td><td>'; |
|
| 218 | 218 | print dol_print_date($object->datesp, 'day'); |
| 219 | 219 | print '</td></tr>'; |
| 220 | 220 | |
| 221 | 221 | print "<tr>"; |
| 222 | - print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>'; |
|
| 222 | + print '<td>'.$langs->trans("DateEndPeriod").'</td><td>'; |
|
| 223 | 223 | print dol_print_date($object->dateep, 'day'); |
| 224 | 224 | print '</td></tr>'; |
| 225 | 225 | |
| 226 | - print '<tr><td>' . $langs->trans("Amount") . '</td><td><span class="amount">' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</span></td></tr>'; |
|
| 226 | + print '<tr><td>'.$langs->trans("Amount").'</td><td><span class="amount">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span></td></tr>'; |
|
| 227 | 227 | |
| 228 | 228 | print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>'; |
| 229 | 229 | |
@@ -132,7 +132,9 @@ |
||
| 132 | 132 | */ |
| 133 | 133 | |
| 134 | 134 | $form = new Form($db); |
| 135 | -if (isModEnabled('project')) $formproject = new FormProjets($db); |
|
| 135 | +if (isModEnabled('project')) { |
|
| 136 | + $formproject = new FormProjets($db); |
|
| 137 | +} |
|
| 136 | 138 | |
| 137 | 139 | $title = $langs->trans('Salary')." - ".$langs->trans('Documents'); |
| 138 | 140 | $help_url = ""; |
@@ -240,7 +240,7 @@ |
||
| 240 | 240 | if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) { |
| 241 | 241 | //print 'xx'.LIBXML_NOCDATA; |
| 242 | 242 | libxml_use_internal_errors(false); |
| 243 | - $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA|LIBXML_NOCDATA); |
|
| 243 | + $rss = simplexml_load_string($str, "SimpleXMLElement", LIBXML_NOCDATA | LIBXML_NOCDATA); |
|
| 244 | 244 | } else { |
| 245 | 245 | if (!function_exists('xml_parser_create')) { |
| 246 | 246 | $this->error = 'Function xml_parser_create are not supported by your PHP'; |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); |
| 52 | 52 | //var_dump($result['content']); |
| 53 | 53 | if (function_exists('simplexml_load_string')) { |
| 54 | - $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 54 | + $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 55 | 55 | } else { |
| 56 | 56 | setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors'); |
| 57 | 57 | } |
@@ -165,13 +165,13 @@ |
||
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | if (GETPOST('target') == 'remote') { |
| 168 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
| 168 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
| 169 | 169 | |
| 170 | 170 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
| 171 | 171 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
| 172 | 172 | $xmlfile = $xmlarray['content']; |
| 173 | 173 | //print "xmlfilestart".$xmlfile."xmlfileend"; |
| 174 | - $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 174 | + $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 175 | 175 | } else { |
| 176 | 176 | $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; |
| 177 | 177 | setEventMessages($errormsg, null, 'errors'); |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | while ($i < $num) { |
| 153 | 153 | $objp = $db->fetch_object($resql); |
| 154 | 154 | $listofoppstatus[$objp->rowid] = $objp->percent; |
| 155 | - $listofopplabel[$objp->rowid] = $objp->label; // default label if translation from "OppStatus".code not found. |
|
| 155 | + $listofopplabel[$objp->rowid] = $objp->label; // default label if translation from "OppStatus".code not found. |
|
| 156 | 156 | $listofoppcode[$objp->rowid] = $objp->code; |
| 157 | 157 | switch ($objp->code) { |
| 158 | 158 | case 'PROSP': |
@@ -81,9 +81,9 @@ |
||
| 81 | 81 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
| 82 | 82 | require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
| 83 | 83 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
| 84 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
| 85 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
| 86 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 84 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
| 85 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
| 86 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 87 | 87 | |
| 88 | 88 | // Load translation files required by the page |
| 89 | 89 | $langs->loadLangs(array("hrm", "companies", "other", "mails")); |
@@ -136,8 +136,12 @@ |
||
| 136 | 136 | //if ($user->socid > 0) $socid = $user->socid; |
| 137 | 137 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 138 | 138 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 139 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 140 | -if (!$permissiontoread) accessforbidden(); |
|
| 139 | +if (empty($conf->hrm->enabled)) { |
|
| 140 | + accessforbidden(); |
|
| 141 | +} |
|
| 142 | +if (!$permissiontoread) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 141 | 145 | |
| 142 | 146 | |
| 143 | 147 | /* |
@@ -240,7 +240,9 @@ discard block |
||
| 240 | 240 | $line->fk_rank = 0; |
| 241 | 241 | |
| 242 | 242 | $res = $line->create($user, $notrigger); |
| 243 | - if ($res > 0) $this->lines[] = $line; |
|
| 243 | + if ($res > 0) { |
|
| 244 | + $this->lines[] = $line; |
|
| 245 | + } |
|
| 244 | 246 | } |
| 245 | 247 | } |
| 246 | 248 | } |
@@ -637,8 +639,9 @@ discard block |
||
| 637 | 639 | |
| 638 | 640 | $Tab = $this->db->fetch_object($res); |
| 639 | 641 | |
| 640 | - if (empty($Tab)) return null; |
|
| 641 | - else { |
|
| 642 | + if (empty($Tab)) { |
|
| 643 | + return null; |
|
| 644 | + } else { |
|
| 642 | 645 | $evaluation = new Evaluation($this->db); |
| 643 | 646 | $evaluation->fetch($Tab->rowid); |
| 644 | 647 | |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | // Put here all includes required by your class file |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluationdet.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluationdet.class.php'; |
|
| 31 | 31 | //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
| 32 | 32 | //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
| 33 | 33 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | /** |
| 105 | 105 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
| 106 | 106 | */ |
| 107 | - public $fields=array( |
|
| 107 | + public $fields = array( |
|
| 108 | 108 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
| 109 | 109 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), |
| 110 | 110 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'showoncombobox'=>'2',), |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | if (empty($user->rights->hrm->evaluation->readall)) { |
| 197 | - $this->fields['fk_user']['type'].= ':rowid IN('.$this->db->sanitize(implode(", ", $user->getAllChildIds(1))).')'; |
|
| 197 | + $this->fields['fk_user']['type'] .= ':rowid IN('.$this->db->sanitize(implode(", ", $user->getAllChildIds(1))).')'; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | $this->date_eval = dol_now(); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $resultcreate = $this->createCommon($user, $notrigger); |
| 231 | 231 | |
| 232 | 232 | if ($resultcreate > 0) { |
| 233 | - require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php'; |
|
| 233 | + require_once DOL_DOCUMENT_ROOT.'/hrm/class/skillrank.class.php'; |
|
| 234 | 234 | $skillRank = new SkillRank($this->db); |
| 235 | 235 | $TRequiredRanks = $skillRank->fetchAll('ASC', 't.rowid', 0, 0, array('customsql' => 'fk_object='.$this->fk_job." AND objecttype='job'")); |
| 236 | 236 | |
@@ -632,12 +632,12 @@ discard block |
||
| 632 | 632 | public function getLastEvaluationForUser($fk_user) |
| 633 | 633 | { |
| 634 | 634 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."hrm_evaluation "; |
| 635 | - $sql.= "WHERE fk_user=".((int) $fk_user)." "; |
|
| 636 | - $sql.= "ORDER BY date_eval DESC "; |
|
| 637 | - $sql.= "LIMIT 1 "; |
|
| 635 | + $sql .= "WHERE fk_user=".((int) $fk_user)." "; |
|
| 636 | + $sql .= "ORDER BY date_eval DESC "; |
|
| 637 | + $sql .= "LIMIT 1 "; |
|
| 638 | 638 | |
| 639 | 639 | $res = $this->db->query($sql); |
| 640 | - if (!$res) { dol_print_error($this->db);} |
|
| 640 | + if (!$res) { dol_print_error($this->db); } |
|
| 641 | 641 | |
| 642 | 642 | $Tab = $this->db->fetch_object($res); |
| 643 | 643 | |
@@ -139,8 +139,12 @@ discard block |
||
| 139 | 139 | //if ($user->socid > 0) $socid = $user->socid; |
| 140 | 140 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 141 | 141 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 142 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 143 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
| 142 | +if (empty($conf->hrm->enabled)) { |
|
| 143 | + accessforbidden(); |
|
| 144 | +} |
|
| 145 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
| 146 | + accessforbidden(); |
|
| 147 | +} |
|
| 144 | 148 | |
| 145 | 149 | |
| 146 | 150 | /* |
@@ -435,9 +439,12 @@ discard block |
||
| 435 | 439 | |
| 436 | 440 | $parameters = array(); |
| 437 | 441 | $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 438 | - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 439 | - if (empty($reshook)) |
|
| 440 | - $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 442 | + if ($reshook < 0) { |
|
| 443 | + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
|
| 444 | + } |
|
| 445 | + if (empty($reshook)) { |
|
| 446 | + $object->formAddObjectLine(1, $mysoc, $soc); |
|
| 447 | + } |
|
| 441 | 448 | } |
| 442 | 449 | } |
| 443 | 450 | |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
| 37 | 37 | |
| 38 | 38 | // Load translation files required by the page |
| 39 | -$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
| 39 | +$langs->loadLangs(array('hrm', 'other', 'products')); // why products? |
|
| 40 | 40 | |
| 41 | 41 | // Get parameters |
| 42 | 42 | $id = GETPOST('id', 'int'); |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'jobcard'; // To manage different context of search |
| 48 | 48 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 49 | 49 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 50 | -$lineid = GETPOST('lineid', 'int'); |
|
| 50 | +$lineid = GETPOST('lineid', 'int'); |
|
| 51 | 51 | |
| 52 | 52 | // Initialize technical objects |
| 53 | 53 | $object = new Job($db); |
| 54 | 54 | $extrafields = new ExtraFields($db); |
| 55 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
| 55 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
| 56 | 56 | $hookmanager->initHooks(array('jobcard', 'globalcard')); // Note that conf->hooks_modules contains array |
| 57 | 57 | |
| 58 | 58 | // Fetch optionals attributes and labels |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $search_all = GETPOST("search_all", 'alpha'); |
| 65 | 65 | $search = array(); |
| 66 | 66 | foreach ($object->fields as $key => $val) { |
| 67 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
| 68 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 67 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 68 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Load object |
| 77 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 77 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 78 | 78 | |
| 79 | 79 | // Permissions |
| 80 | 80 | $permissiontoread = $user->rights->hrm->all->read; |
| 81 | 81 | $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
| 82 | 82 | $permissiontodelete = $user->rights->hrm->all->delete; |
| 83 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job'; |
|
| 83 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/job'; |
|
| 84 | 84 | |
| 85 | 85 | // Security check (enable the most restrictive one) |
| 86 | 86 | //if ($user->socid > 0) accessforbidden(); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 112 | 112 | $backtopage = $backurlforlist; |
| 113 | 113 | } else { |
| 114 | - $backtopage = dol_buildpath('/hrm/job_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
| 114 | + $backtopage = dol_buildpath('/hrm/job_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -120,19 +120,19 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
| 123 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
| 123 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
| 124 | 124 | |
| 125 | 125 | // Actions when linking object each other |
| 126 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 126 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 127 | 127 | |
| 128 | 128 | // Actions when printing a doc from card |
| 129 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
| 129 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
| 130 | 130 | |
| 131 | 131 | // Action to move up and down lines of object |
| 132 | 132 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
| 133 | 133 | |
| 134 | 134 | // Action to build doc |
| 135 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 135 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 136 | 136 | |
| 137 | 137 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
| 138 | 138 | $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | // Actions to send emails |
| 145 | 145 | $triggersendname = 'hrm_JOB_SENTBYMAIL'; |
| 146 | 146 | $autocopy = 'MAIN_MAIL_AUTOCOPY_JOB_TO'; |
| 147 | - $trackid = 'job' . $object->id; |
|
| 148 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 147 | + $trackid = 'job'.$object->id; |
|
| 148 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
@@ -181,36 +181,36 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | // Part to create |
| 183 | 183 | if ($action == 'create') { |
| 184 | - print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_' . $object->picto); |
|
| 184 | + print load_fiche_titre($langs->trans("NewJobProfile", $langs->transnoentities('Job')), '', 'object_'.$object->picto); |
|
| 185 | 185 | |
| 186 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 187 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 186 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 187 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 188 | 188 | print '<input type="hidden" name="action" value="add">'; |
| 189 | 189 | if ($backtopage) { |
| 190 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 190 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 191 | 191 | } |
| 192 | 192 | if ($backtopageforcancel) { |
| 193 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 193 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | print dol_get_fiche_head(array(), ''); |
| 197 | 197 | |
| 198 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
| 198 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
| 199 | 199 | |
| 200 | 200 | // Common attributes |
| 201 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
| 201 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
| 202 | 202 | |
| 203 | 203 | // Other attributes |
| 204 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
| 204 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
| 205 | 205 | |
| 206 | - print '</table>' . "\n"; |
|
| 206 | + print '</table>'."\n"; |
|
| 207 | 207 | |
| 208 | 208 | print dol_get_fiche_end(); |
| 209 | 209 | |
| 210 | 210 | print '<div class="center">'; |
| 211 | - print '<input type="submit" class="button" name="add" value="' . dol_escape_htmltag($langs->trans("Create")) . '">'; |
|
| 211 | + print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Create")).'">'; |
|
| 212 | 212 | print ' '; |
| 213 | - print '<input type="' . ($backtopage ? "submit" : "button") . '" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans("Cancel")) . '"' . ($backtopage ? '' : ' onclick="history.go(-1)"') . '>'; // Cancel for create does not post form if we don't know the backtopage |
|
| 213 | + print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage |
|
| 214 | 214 | print '</div>'; |
| 215 | 215 | |
| 216 | 216 | print '</form>'; |
@@ -220,35 +220,35 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | // Part to edit record |
| 222 | 222 | if (($id || $ref) && $action == 'edit') { |
| 223 | - print load_fiche_titre($langs->trans("JobProfile"), '', 'object_' . $object->picto); |
|
| 223 | + print load_fiche_titre($langs->trans("JobProfile"), '', 'object_'.$object->picto); |
|
| 224 | 224 | |
| 225 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 226 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 225 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 226 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 227 | 227 | print '<input type="hidden" name="action" value="update">'; |
| 228 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 228 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 229 | 229 | if ($backtopage) { |
| 230 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 230 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 231 | 231 | } |
| 232 | 232 | if ($backtopageforcancel) { |
| 233 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 233 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | print dol_get_fiche_head(); |
| 237 | 237 | |
| 238 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 238 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 239 | 239 | |
| 240 | 240 | // Common attributes |
| 241 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 241 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 242 | 242 | |
| 243 | 243 | // Other attributes |
| 244 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
| 244 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
| 245 | 245 | |
| 246 | 246 | print '</table>'; |
| 247 | 247 | |
| 248 | 248 | print dol_get_fiche_end(); |
| 249 | 249 | |
| 250 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
| 251 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 250 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
| 251 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 252 | 252 | print '</div>'; |
| 253 | 253 | |
| 254 | 254 | print '</form>'; |
@@ -266,17 +266,17 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // Confirmation to delete |
| 268 | 268 | if ($action == 'delete') { |
| 269 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 269 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteJob'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 270 | 270 | } |
| 271 | 271 | // Confirmation to delete line |
| 272 | 272 | if ($action == 'deleteline') { |
| 273 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
| 273 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); |
|
| 274 | 274 | } |
| 275 | 275 | // Clone confirmation |
| 276 | 276 | if ($action == 'clone') { |
| 277 | 277 | // Create an array for form |
| 278 | 278 | $formquestion = array(); |
| 279 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 279 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | // Confirmation of action xxxx |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) |
| 293 | 293 | ); |
| 294 | 294 | */ |
| 295 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
| 295 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | // Call Hook formConfirm |
@@ -310,10 +310,10 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | // Object card |
| 312 | 312 | // ------------------------------------------------------------ |
| 313 | - $linkback = '<a href="' . dol_buildpath('/hrm/job_list.php', 1) . '?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 313 | + $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 314 | 314 | |
| 315 | 315 | $morehtmlref = '<div class="refid">'; |
| 316 | - $morehtmlref.= $object->label; |
|
| 316 | + $morehtmlref .= $object->label; |
|
| 317 | 317 | $morehtmlref .= '</div>'; |
| 318 | 318 | |
| 319 | 319 | |
@@ -329,11 +329,11 @@ discard block |
||
| 329 | 329 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
| 330 | 330 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 331 | 331 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 332 | - $object->fields['label']['visible']=0; // Already in banner |
|
| 333 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 332 | + $object->fields['label']['visible'] = 0; // Already in banner |
|
| 333 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 334 | 334 | |
| 335 | 335 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 336 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 336 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 337 | 337 | |
| 338 | 338 | print '</table>'; |
| 339 | 339 | print '</div>'; |
@@ -352,16 +352,16 @@ discard block |
||
| 352 | 352 | // Show object lines |
| 353 | 353 | $result = $object->getLinesArray(); |
| 354 | 354 | |
| 355 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST"> |
|
| 356 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
| 357 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
| 355 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST"> |
|
| 356 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
| 357 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
| 358 | 358 | <input type="hidden" name="mode" value=""> |
| 359 | 359 | <input type="hidden" name="page_y" value=""> |
| 360 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
| 360 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
| 361 | 361 | '; |
| 362 | 362 | |
| 363 | 363 | if (!empty($conf->use_javascript_ajax) && $object->status == 0) { |
| 364 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
| 364 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | print '<div class="div-table-responsive-no-min">'; |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | // Buttons for actions |
| 399 | 399 | |
| 400 | 400 | if ($action != 'presend' && $action != 'editline') { |
| 401 | - print '<div class="tabsAction">' . "\n"; |
|
| 401 | + print '<div class="tabsAction">'."\n"; |
|
| 402 | 402 | $parameters = array(); |
| 403 | 403 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 404 | 404 | if ($reshook < 0) { |
@@ -408,15 +408,15 @@ discard block |
||
| 408 | 408 | if (empty($reshook)) { |
| 409 | 409 | // Back to draft |
| 410 | 410 | if ($object->status == $object::STATUS_VALIDATED) { |
| 411 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 411 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 414 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 415 | 415 | |
| 416 | 416 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 417 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
| 417 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
| 418 | 418 | } |
| 419 | - print '</div>' . "\n"; |
|
| 419 | + print '</div>'."\n"; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
@@ -434,12 +434,12 @@ discard block |
||
| 434 | 434 | // Documents |
| 435 | 435 | if ($includedocgeneration) { |
| 436 | 436 | $objref = dol_sanitizeFileName($object->ref); |
| 437 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
| 438 | - $filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref; |
|
| 439 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
| 437 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
| 438 | + $filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref; |
|
| 439 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
| 440 | 440 | $genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content |
| 441 | 441 | $delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card |
| 442 | - print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
| 442 | + print $formfile->showdocuments('hrm:Job', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
|
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | // Show links to link elements |
@@ -454,9 +454,9 @@ discard block |
||
| 454 | 454 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/job_agenda.php?id='.$object->id); |
| 455 | 455 | |
| 456 | 456 | // List of actions on element |
| 457 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
| 457 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
| 458 | 458 | $formactions = new FormActions($db); |
| 459 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 459 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 460 | 460 | |
| 461 | 461 | print '</div></div>'; |
| 462 | 462 | } |
@@ -465,9 +465,9 @@ discard block |
||
| 465 | 465 | $modelmail = 'job'; |
| 466 | 466 | $defaulttopic = 'InformationMessage'; |
| 467 | 467 | $diroutput = $conf->hrm->dir_output; |
| 468 | - $trackid = 'job' . $object->id; |
|
| 468 | + $trackid = 'job'.$object->id; |
|
| 469 | 469 | |
| 470 | - include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php'; |
|
| 470 | + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | // End of page |
@@ -113,8 +113,12 @@ |
||
| 113 | 113 | //if ($user->socid > 0) $socid = $user->socid; |
| 114 | 114 | //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 115 | 115 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 116 | -if (empty($conf->hrm->enabled)) accessforbidden(); |
|
| 117 | -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); |
|
| 116 | +if (empty($conf->hrm->enabled)) { |
|
| 117 | + accessforbidden(); |
|
| 118 | +} |
|
| 119 | +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { |
|
| 120 | + accessforbidden(); |
|
| 121 | +} |
|
| 118 | 122 | |
| 119 | 123 | $langs->loadLangs(array("hrm", "other")); |
| 120 | 124 | |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | require '../main.inc.php'; |
| 31 | 31 | |
| 32 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 33 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 34 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; |
|
| 36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
| 37 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 33 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 34 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
| 37 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_position.lib.php'; |
|
| 38 | 38 | //dol_include_once('/hrm/position.php'); |
| 39 | 39 | |
| 40 | 40 | // Get Parameters |
| 41 | -$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
| 41 | +$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... |
|
| 42 | 42 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 43 | 43 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); |
| 44 | -$id = GETPOST('id', 'int'); |
|
| 44 | +$id = GETPOST('id', 'int'); |
|
| 45 | 45 | |
| 46 | 46 | // Initialize technical objects |
| 47 | 47 | $form = new Form($db); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
| 57 | 57 | $permissiontodelete = $user->rights->hrm->all->delete; |
| 58 | 58 | $permissiondellink = $user->rights->hrm->all->write; // Used by the include of actions_dellink.inc.php |
| 59 | -$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position'; |
|
| 59 | +$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/position'; |
|
| 60 | 60 | |
| 61 | 61 | // Security check (enable the most restrictive one) |
| 62 | 62 | //if ($user->socid > 0) accessforbidden(); |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | // Get parameters |
| 74 | -$id = GETPOST('id', 'int'); |
|
| 74 | +$id = GETPOST('id', 'int'); |
|
| 75 | 75 | $fk_job = GETPOST('fk_job', 'int'); |
| 76 | 76 | |
| 77 | -$ref = GETPOST('ref', 'alpha'); |
|
| 77 | +$ref = GETPOST('ref', 'alpha'); |
|
| 78 | 78 | $action = GETPOST('action', 'aZ09'); |
| 79 | 79 | $confirm = GETPOST('confirm', 'alpha'); |
| 80 | 80 | $cancel = GETPOST('cancel', 'aZ09'); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $extrafields = new ExtraFields($db); |
| 94 | 94 | |
| 95 | -$diroutputmassaction = $conf->hrm->dir_output . '/temp/massgeneration/' . $user->id; |
|
| 95 | +$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; |
|
| 96 | 96 | $hookmanager->initHooks(array('positioncard', 'globalcard')); // Note that conf->hooks_modules contains array |
| 97 | 97 | |
| 98 | 98 | // Fetch optionals attributes and labels |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | $search_all = GETPOST("search_all", 'alpha'); |
| 105 | 105 | $search = array(); |
| 106 | 106 | foreach ($object->fields as $key => $val) { |
| 107 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
| 108 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 107 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 108 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // Load object |
| 117 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 117 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | /* |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 138 | 138 | $backtopage = $backurlforlist; |
| 139 | 139 | } else { |
| 140 | - $backtopage = dol_buildpath('/hrm/position_card.php', 1) . '?id=' . ($id > 0 ? $id : '__ID__'); |
|
| 140 | + $backtopage = dol_buildpath('/hrm/position_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -145,19 +145,19 @@ discard block |
||
| 145 | 145 | $triggermodname = 'hrm_POSITION_MODIFY'; // Name of trigger action code to execute when we modify record |
| 146 | 146 | |
| 147 | 147 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
| 148 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
| 148 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
| 149 | 149 | |
| 150 | 150 | // Actions when linking object each other |
| 151 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 151 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 152 | 152 | |
| 153 | 153 | // Actions when printing a doc from card |
| 154 | - include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php'; |
|
| 154 | + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; |
|
| 155 | 155 | |
| 156 | 156 | // Action to move up and down lines of object |
| 157 | 157 | //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; |
| 158 | 158 | |
| 159 | 159 | // Action to build doc |
| 160 | - include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php'; |
|
| 160 | + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; |
|
| 161 | 161 | |
| 162 | 162 | if ($action == 'set_thirdparty' && $permissiontoadd) { |
| 163 | 163 | $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | // Actions to send emails |
| 170 | 170 | $triggersendname = 'hrm_POSITION_SENTBYMAIL'; |
| 171 | 171 | $autocopy = 'MAIN_MAIL_AUTOCOPY_POSITION_TO'; |
| 172 | - $trackid = 'position' . $object->id; |
|
| 173 | - include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; |
|
| 172 | + $trackid = 'position'.$object->id; |
|
| 173 | + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -214,36 +214,36 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | // Part to edit record |
| 216 | 216 | if (($id || $ref) && $action == 'edit') { |
| 217 | - print load_fiche_titre($langs->trans("Position"), '', 'object_' . $object->picto); |
|
| 217 | + print load_fiche_titre($langs->trans("Position"), '', 'object_'.$object->picto); |
|
| 218 | 218 | |
| 219 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '">'; |
|
| 220 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 219 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'; |
|
| 220 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 221 | 221 | print '<input type="hidden" name="action" value="update">'; |
| 222 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 222 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 223 | 223 | |
| 224 | 224 | if ($backtopage) { |
| 225 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 225 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 226 | 226 | } |
| 227 | 227 | if ($backtopageforcancel) { |
| 228 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 228 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | print dol_get_fiche_head(); |
| 232 | 232 | |
| 233 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 233 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 234 | 234 | |
| 235 | 235 | // Common attributes |
| 236 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 236 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 237 | 237 | |
| 238 | 238 | // Other attributes |
| 239 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
| 239 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
| 240 | 240 | |
| 241 | 241 | print '</table>'; |
| 242 | 242 | |
| 243 | 243 | print dol_get_fiche_end(); |
| 244 | 244 | |
| 245 | - print '<div class="center"><input type="submit" class="button button-save" name="save" value="' . $langs->trans("Save") . '">'; |
|
| 246 | - print ' <input type="submit" class="button button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 245 | + print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">'; |
|
| 246 | + print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 247 | 247 | print '</div>'; |
| 248 | 248 | |
| 249 | 249 | print '</form>'; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | // Confirmation to delete |
| 264 | 264 | if ($action == 'delete') { |
| 265 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 265 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeletePosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | // Call Hook formConfirm |
@@ -297,18 +297,18 @@ discard block |
||
| 297 | 297 | print '<div class="fichecenter">'; |
| 298 | 298 | print '<div class="fichehalfleft">'; |
| 299 | 299 | print '<div class="underbanner clearboth"></div>'; |
| 300 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
| 300 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
| 301 | 301 | |
| 302 | 302 | // Common attributes |
| 303 | 303 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
| 304 | 304 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 305 | 305 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 306 | - $object->fields['fk_user']['visible']=0; // Already in banner |
|
| 307 | - $object->fields['fk_job']['visible']=0; // Already in banner |
|
| 308 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; |
|
| 306 | + $object->fields['fk_user']['visible'] = 0; // Already in banner |
|
| 307 | + $object->fields['fk_job']['visible'] = 0; // Already in banner |
|
| 308 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
|
| 309 | 309 | |
| 310 | 310 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 311 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 311 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 312 | 312 | |
| 313 | 313 | print '</table>'; |
| 314 | 314 | print '</div>'; |
@@ -327,10 +327,10 @@ discard block |
||
| 327 | 327 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 328 | 328 | |
| 329 | 329 | |
| 330 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 330 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 331 | 331 | |
| 332 | 332 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 333 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete); |
|
| 333 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete); |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | |
@@ -368,10 +368,10 @@ discard block |
||
| 368 | 368 | //} |
| 369 | 369 | |
| 370 | 370 | |
| 371 | -print '</table>' . "\n"; |
|
| 372 | -print '</div>' . "\n"; |
|
| 371 | +print '</table>'."\n"; |
|
| 372 | +print '</div>'."\n"; |
|
| 373 | 373 | |
| 374 | -print '</form>' . "\n"; |
|
| 374 | +print '</form>'."\n"; |
|
| 375 | 375 | |
| 376 | 376 | |
| 377 | 377 | if ($action !== 'edit' && $action !== 'create') { |
@@ -389,9 +389,9 @@ discard block |
||
| 389 | 389 | $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/hrm/position_agenda.php?id='.$object->id); |
| 390 | 390 | |
| 391 | 391 | // List of actions on element |
| 392 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; |
|
| 392 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; |
|
| 393 | 393 | $formactions = new FormActions($db); |
| 394 | - $somethingshown = $formactions->showactions($object, $object->element . '@' . $object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 394 | + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); |
|
| 395 | 395 | |
| 396 | 396 | print '</div></div>'; |
| 397 | 397 | } |