Fixing style errors.

This commit is contained in:
stickler-ci 2021-09-29 06:34:00 +00:00
parent eccff256b1
commit e8a5a2cc62
5 changed files with 111 additions and 115 deletions

View File

@ -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 "<!-- begin printObjectLines() --><tbody>\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 "</tbody><!-- end printObjectLines() -->\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 "<!-- begin printObjectLines() --><tbody>\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 "</tbody><!-- end printObjectLines() -->\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');
// }
}

View File

@ -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 = '<select class="flat select_skill_type ' . $more_class . '" name="' . $htmlname . '" id="' . $htmlname . '" ' . $moreattr . '>';
// if ($emptyvalue)
// $out .= '<option value=""></options>';
//
//
// $sql = 'SELECT code, label FROM ' . MAIN_DB_PREFIX . 'c_skill_type WHERE active = 1 AND entity IN (0,' . $conf->entity.')';
// $resql = $this->db->query($sql);
// if ($resql) {
// while ( $obj = $this->db->fetch_object($resql) ) {
// $out .= '<option value="' . $obj->code . '" ' . ($selected == $obj->code ? 'selected' : '') . '>' . $obj->label . '</options>';
// }
// } else {
// dol_print_error($this->db);
// }
//
// $out .= '</select>';
//
// return $out;
// }
// public function select_skill_type($selected = '', $htmlname = 'code_c_skill_type', $emptyvalue = true, $moreattr = '', $more_class = '')
// {
// global $conf;
//
// $out = '<select class="flat select_skill_type ' . $more_class . '" name="' . $htmlname . '" id="' . $htmlname . '" ' . $moreattr . '>';
// if ($emptyvalue)
// $out .= '<option value=""></options>';
//
//
// $sql = 'SELECT code, label FROM ' . MAIN_DB_PREFIX . 'c_skill_type WHERE active = 1 AND entity IN (0,' . $conf->entity.')';
// $resql = $this->db->query($sql);
// if ($resql) {
// while ( $obj = $this->db->fetch_object($resql) ) {
// $out .= '<option value="' . $obj->code . '" ' . ($selected == $obj->code ? 'selected' : '') . '>' . $obj->label . '</options>';
// }
// } else {
// dol_print_error($this->db);
// }
//
// $out .= '</select>';
//
// return $out;
// }
/**
* @param int $code number of code label

View File

@ -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);
// }
}

View File

@ -71,13 +71,11 @@ $coldisplay = 0;
<?php } ?>
<td class="linecollabel"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
<?php
if ($line->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);
}
?>
</td>

View File

@ -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 '<div class="tagtable border table-border tableforfield centpercent">'."\n
print '</div>'."\n";
print '</div>'."\n";
if (empty($user->socid)) {
// Private notes (always hidden to external users)
print '<div class="tagtr table-border-row">'."\n";
// Private notes (always hidden to external users)
print '<div class="tagtr table-border-row">'."\n";
$editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private);
print '<div class="tagtd tagtdnote tdtop'.($editmode ? '' : ' sensiblehtmlcontent').' table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\n";
print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\n";
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1);
print '</div>'."\n";
print '</div>'."\n";
print '</div>'."\n";
}
print '</div>'."\n";
?>