FIX cols parameter not propagated to tpl

This commit is contained in:
Laurent Destailleur 2020-03-10 21:54:50 +01:00
parent 078112c649
commit 1f5c8f682c
5 changed files with 18 additions and 21 deletions

View File

@ -176,6 +176,7 @@ class Canvas
global $db, $conf, $langs, $user, $canvas;
global $form, $formfile;
//var_dump($this->card.'-'.$action);
include $this->template_dir.(!empty($this->card)?$this->card.'_':'').$this->_cleanaction($action).'.tpl.php'; // Include native PHP template
}

View File

@ -6753,7 +6753,8 @@ abstract class CommonObject
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= '&nbsp;<font color="red">*</font>';
} else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired';
$out .= '">';
$out .= '"';
$out .= '>';
if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
else $out .= $labeltoshow;
}

View File

@ -37,11 +37,14 @@ if (empty($conf) || !is_object($conf))
<?php
// Other attributes
$parameters = array();
if (! isset($parameters)) $parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
$params = isset($tpl_context) ? array('tpl_context' => $tpl_context) : array(); // BUG #11554 : Add tpl_context in params
$params = array();
if (isset($tpl_context)) $params['tpl_context'] = $tpl_context;
$params['cols']=$parameters['colspanvalue'];
print $object->showOptionals($extrafields, 'edit', $params); // BUG #11554 : Add context in params
}

View File

@ -37,11 +37,13 @@ if (empty($conf) || ! is_object($conf))
<?php
// Other attributes
$parameters = array();
if (! isset($parameters)) $parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit');
$params=array();
$params['cols']=$parameters['colspanvalue'];
print $object->showOptionals($extrafields, 'edit', $params);
}
?>

View File

@ -1557,14 +1557,9 @@ else
print '</td></tr>';
}
// Other attributes
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit', $parameters);
}
// Other attributes
$parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_create.tpl.php';
// Assign a sale representative
print '<tr>';
@ -2218,14 +2213,9 @@ else
print '</td></tr>';
}
// Other attributes
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit', $parameters);
}
// Other attributes
$parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
// Webservices url/key
if (!empty($conf->syncsupplierwebservices->enabled)) {