2
0
forked from Wavyzz/dolibarr

Debug v13

This commit is contained in:
Laurent Destailleur
2020-12-09 19:26:41 +01:00
parent a0d9d98402
commit 10a0c98f94
4 changed files with 24 additions and 15 deletions

View File

@@ -114,17 +114,17 @@ $fieldstosearchall = array(
if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
$arrayfields = array(
'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10),
'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1, 'position'=>12),
'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'position'=>14),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30),
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32),
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34),
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80),
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45),
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900, 'help'=>$langs->trans("LowerDateEndPlannedShort")),

View File

@@ -4282,7 +4282,11 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
$out .= '>';
}
if ($tooltip) $out .= $form->textwithpicto($langs->trans($name), $langs->trans($tooltip));
if ($tooltip) {
// You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
$tmptooltip = explode(':', $tooltip);
$out .= $form->textwithpicto($langs->trans($name), $langs->trans($tmptooltip[0]), 1, 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.str_replace('.', '_', $field).'_'.$tmptooltip[1]));
}
else $out .= $langs->trans($name);
if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field

View File

@@ -128,8 +128,13 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
print '<td class="';
if ((!empty($action) && ($action == 'create' || $action == 'edit')) && !empty($extrafields->attributes[$object->table_element]['required'][$tmpkeyextra])) print ' fieldrequired';
print '">';
if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra]));
else print $langs->trans($tmplabelextra);
if (!empty($extrafields->attributes[$object->table_element]['help'][$tmpkeyextra])) {
// You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
$tmptooltip = explode(':', $extrafields->attributes[$object->table_element]['help'][$tmpkeyextra]);
print $form->textwithpicto($langs->trans($tmplabelextra), $langs->trans($tmptooltip[0]), 1, 'help', '', 0, 3, (empty($tmptooltip[1]) ? '' : 'extra_'.$tmpkeyextra.'_'.$tmptooltip[1]));
} else {
print $langs->trans($tmplabelextra);
}
print '</td>';
//TODO Improve element and rights detection

View File

@@ -85,7 +85,7 @@ class MyObject extends CommonObject
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200'
* 'help' is a string visible as a tooltip on field
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")