From e8a5a2cc627b8fbb726fea28b1a4d5536e4a0602 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 29 Sep 2021 06:34:00 +0000 Subject: [PATCH] Fixing style errors. --- htdocs/hrm/class/evaluation.class.php | 138 ++++++++++---------- htdocs/hrm/class/skill.class.php | 46 +++---- htdocs/hrm/class/skillrank.class.php | 12 +- htdocs/hrm/core/tpl/objectline_view.tpl.php | 12 +- htdocs/hrm/core/tpl/skilldet.fiche.tpl.php | 18 ++- 5 files changed, 111 insertions(+), 115 deletions(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 354b909d256..237b4740641 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -1109,74 +1109,74 @@ class Evaluation extends CommonObject * @param string $action * @param int $selected */ -// public function printObjectLines($action, $selected = 0) -// { -// global $conf, $hookmanager, $langs, $user, $extrafields, $object; -// // TODO We should not use global var for this -// global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; -// -// // Define usemargins -//// $usemargins = 0; -//// if (!empty($conf->margin->enabled) && !empty($this->element) && in_array($this->element, array('facture', 'facturerec', 'propal', 'commande'))) { -//// $usemargins = 1; -//// } -// -// $num = count($this->lines); -// -// // Line extrafield -// if (!is_object($extrafields)) { -// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -// $extrafields = new ExtraFields($this->db); -// } -// $extrafields->fetch_name_optionals_label($this->table_element_line); -// -// $parameters = array('num'=>$num, 'selected'=>$selected, 'table_element_line'=>$this->table_element_line); -// $reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks -// if (empty($reshook)) { -// // Output template part (modules that overwrite templates must declare this into descriptor) -// // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. -// include dol_buildpath('hrm/core/tpl/objectline_title.tpl.php'); -// } -// -// $i = 0; -// -// print "\n"; -// foreach ($this->lines as $line) { -// //Line extrafield -// $line->fetch_optionals(); -// -// //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) -// if (is_object($hookmanager)) { // Old code is commented on preceding line. -// if (empty($line->fk_parent_line)) { -// $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'selected'=>$selected, 'table_element_line'=>$line->table_element); -// $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks -// } else { -// $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'selected'=>$selected, 'table_element_line'=>$line->table_element, 'fk_parent_line'=>$line->fk_parent_line); -// $reshook = $hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks -// } -// } -// if (empty($reshook)) { -// $this->printObjectLine($action, $line); -// } -// -// $i++; -// } -// print "\n"; -// } + // public function printObjectLines($action, $selected = 0) + // { + // global $conf, $hookmanager, $langs, $user, $extrafields, $object; + // // TODO We should not use global var for this + // global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; + // + // // Define usemargins + //// $usemargins = 0; + //// if (!empty($conf->margin->enabled) && !empty($this->element) && in_array($this->element, array('facture', 'facturerec', 'propal', 'commande'))) { + //// $usemargins = 1; + //// } + // + // $num = count($this->lines); + // + // // Line extrafield + // if (!is_object($extrafields)) { + // require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + // $extrafields = new ExtraFields($this->db); + // } + // $extrafields->fetch_name_optionals_label($this->table_element_line); + // + // $parameters = array('num'=>$num, 'selected'=>$selected, 'table_element_line'=>$this->table_element_line); + // $reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + // if (empty($reshook)) { + // // Output template part (modules that overwrite templates must declare this into descriptor) + // // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. + // include dol_buildpath('hrm/core/tpl/objectline_title.tpl.php'); + // } + // + // $i = 0; + // + // print "\n"; + // foreach ($this->lines as $line) { + // //Line extrafield + // $line->fetch_optionals(); + // + // //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + // if (is_object($hookmanager)) { // Old code is commented on preceding line. + // if (empty($line->fk_parent_line)) { + // $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'selected'=>$selected, 'table_element_line'=>$line->table_element); + // $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + // } else { + // $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'selected'=>$selected, 'table_element_line'=>$line->table_element, 'fk_parent_line'=>$line->fk_parent_line); + // $reshook = $hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + // } + // } + // if (empty($reshook)) { + // $this->printObjectLine($action, $line); + // } + // + // $i++; + // } + // print "\n"; + // } -// public function printObjectLine($action, $line) -// { -// global $conf, $langs, $user, $object, $hookmanager; -// global $form; -// global $object_rights, $disableedit, $disablemove, $disableremove; // TODO We should not use global var for this ! -// -// $object_rights = $this->getRights(); -// -// $element = $this->element; -// -// $text = ''; -// $description = ''; -// -// include dol_buildpath('hrm/tpl/objectline_view.tpl.php'); -// } + // public function printObjectLine($action, $line) + // { + // global $conf, $langs, $user, $object, $hookmanager; + // global $form; + // global $object_rights, $disableedit, $disablemove, $disableremove; // TODO We should not use global var for this ! + // + // $object_rights = $this->getRights(); + // + // $element = $this->element; + // + // $text = ''; + // $description = ''; + // + // include dol_buildpath('hrm/tpl/objectline_view.tpl.php'); + // } } diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 7cf2d60e88a..b2fe7719564 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -1101,29 +1101,29 @@ class Skill extends CommonObject * @param string $more_class used if we want to add new css class to input * @return string */ -// public function select_skill_type($selected = '', $htmlname = 'code_c_skill_type', $emptyvalue = true, $moreattr = '', $more_class = '') -// { -// global $conf; -// -// $out = ''; -// -// return $out; -// } + // public function select_skill_type($selected = '', $htmlname = 'code_c_skill_type', $emptyvalue = true, $moreattr = '', $more_class = '') + // { + // global $conf; + // + // $out = ''; + // + // return $out; + // } /** * @param int $code number of code label diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 094eea1736e..2f0e2b5d0dd 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -1077,10 +1077,10 @@ class SkillRank extends CommonObject * @param string $morecss * @return string */ -// public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') -// { -// if ($key == "rank") { -// return displayRankInfos($this); -// } else return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss); -// } + // public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') + // { + // if ($key == "rank") { + // return displayRankInfos($this); + // } else return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss); + // } } diff --git a/htdocs/hrm/core/tpl/objectline_view.tpl.php b/htdocs/hrm/core/tpl/objectline_view.tpl.php index e8416c35711..04f4cc48bdd 100644 --- a/htdocs/hrm/core/tpl/objectline_view.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_view.tpl.php @@ -71,13 +71,11 @@ $coldisplay = 0;
fk_skill > 0) { - - $skill = new Skill($this->db); - $resSkill = $skill->fetch($line->fk_skill); - if ($resSkill > 0) print $skill->getNomUrl(1); - - } +if ($line->fk_skill > 0) { + $skill = new Skill($this->db); + $resSkill = $skill->fetch($line->fk_skill); + if ($resSkill > 0) print $skill->getNomUrl(1); +} ?> diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index d7bfcf9e626..60bb56ff173 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -2,8 +2,8 @@ // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { -print "Error, template page can't be called as URL"; -exit; + print "Error, template page can't be called as URL"; + exit; } /* // $permissionnote must be defined by caller. For example $permissionnote=$user->rights->module->create @@ -78,10 +78,8 @@ $permission = $user->rights->ecm->setup; //else dol_print_error('','Bad value '.$module.' for param module'); if (!empty($object->table_element_line)) { -// Show object lines -$result = $object->getLinesArray(); - - + // Show object lines + $result = $object->getLinesArray(); } @@ -99,16 +97,16 @@ print '
'."\n print '
'."\n"; print ''."\n"; if (empty($user->socid)) { -// Private notes (always hidden to external users) -print '
'."\n"; + // Private notes (always hidden to external users) + print '
'."\n"; $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private); print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; -print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); print '
'."\n"; -print '
'."\n"; + print '
'."\n"; } print '
'."\n"; ?>