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 $db, $conf, $langs, $user, $canvas;
global $form, $formfile; 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 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>'; if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= '&nbsp;<font color="red">*</font>';
} else { } else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; 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]); if (!empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]);
else $out .= $labeltoshow; else $out .= $labeltoshow;
} }

View File

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

View File

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