mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Debug v21
This commit is contained in:
parent
8c4b624541
commit
10ea271a4e
|
|
@ -317,38 +317,76 @@ class Adherent extends CommonObject
|
|||
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* 'type' field format:
|
||||
* 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',
|
||||
* 'select' (list of values are in 'options'. for integer list of values are in 'arrayofkeyval'),
|
||||
* 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:CategoryIdType[:CategoryIdList[:SortField]]]]]]',
|
||||
* 'chkbxlst:...',
|
||||
* 'varchar(x)',
|
||||
* 'text', 'text:none', 'html',
|
||||
* 'double(24,8)', 'real', 'price', 'stock',
|
||||
* 'date', 'datetime', 'timestamp', 'duration',
|
||||
* 'boolean', 'checkbox', 'radio', 'array',
|
||||
* 'mail', 'phone', 'url', 'password', 'ip'
|
||||
* Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)"
|
||||
* 'length' the length of field. Example: 255, '24,8'
|
||||
* 'label' the translation key.
|
||||
* 'alias' the alias used into some old hard coded SQL requests
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* '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 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* '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: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'placeholder' to set the placeholder of a varchar field.
|
||||
* 'help' and 'helplist' 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 like the constructor of the class.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if you need to validate the field with $this->validateField(). Need MAIN_ACTIVATE_VALIDATION_RESULT.
|
||||
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value)
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
'ref' => array('type' => 'varchar(30)', 'label' => 'Ref', 'default' => '1', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 12, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'showoncombobox' => 1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => 1, 'position' => 35, 'showoncombobox' => 1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => 1, 'position' => 40),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => 3, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => 3, 'position' => 50),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
|
||||
'state_id' => array('type' => 'integer', 'label' => 'State id', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'state_id' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => -1, 'position' => 90),
|
||||
'country' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => 1, 'position' => 95),
|
||||
'phone' => array('type' => 'varchar(30)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 115),
|
||||
'phone_perso' => array('type' => 'varchar(30)', 'label' => 'Phone perso', 'enabled' => 1, 'visible' => -1, 'position' => 120),
|
||||
'phone_mobile' => array('type' => 'varchar(30)', 'label' => 'Phone mobile', 'enabled' => 1, 'visible' => -1, 'position' => 125),
|
||||
'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => 1, 'visible' => 1, 'position' => 126),
|
||||
'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 127),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 128),
|
||||
'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => 3, 'position' => 128),
|
||||
'birth' => array('type' => 'date', 'label' => 'DateOfBirth', 'enabled' => 1, 'visible' => -1, 'position' => 130),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 132),
|
||||
'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135),
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
|
||||
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 145),
|
||||
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => 1, 'position' => 150),
|
||||
'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 153),
|
||||
'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
|
||||
|
|
@ -356,13 +394,13 @@ class Adherent extends CommonObject
|
|||
'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165),
|
||||
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175),
|
||||
'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 180),
|
||||
'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user mod', 'enabled' => 1, 'visible' => -1, 'position' => 185),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 500, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')),
|
||||
'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'visible' => 3, 'position' => 180),
|
||||
'fk_user_mod' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModification', 'enabled' => 1, 'visible' => 3, 'position' => 185),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => 3, 'position' => 190),
|
||||
'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => 0, 'position' => 195),
|
||||
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805)
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805),
|
||||
'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 1000, 'arrayofkeyval' => array(-1 => 'Draft', 1 => 'Validated', 0 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort'))
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ $arrayfields = array(
|
|||
'd.company' => array('label' => "Company", 'checked' => 1, 'position' => 70),
|
||||
'd.login' => array('label' => "Login", 'checked' => 1),
|
||||
'd.morphy' => array('label' => "MemberNature", 'checked' => 1),
|
||||
't.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 55),
|
||||
't.libelle' => array('label' => "MemberType", 'checked' => 1, 'position' => 55),
|
||||
'd.address' => array('label' => "Address", 'checked' => 0),
|
||||
'd.zip' => array('label' => "Zip", 'checked' => 0),
|
||||
'd.town' => array('label' => "Town", 'checked' => 0),
|
||||
|
|
@ -199,6 +199,10 @@ $tableprefix = 'd';
|
|||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
// Special case already added
|
||||
if (in_array($key, array('fk_adherent_type', 'state_id', 'country'))) { // Already managed by another field key in arrayfields
|
||||
continue;
|
||||
}
|
||||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
|
|
@ -222,7 +226,6 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
|||
// Security check
|
||||
$result = restrictedArea($user, 'adherent');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ if ($mode == 'other') {
|
|||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Language");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td><td>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Default language
|
||||
|
|
@ -435,7 +435,7 @@ if ($mode == 'other') {
|
|||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $langs->trans("Miscellaneous");
|
||||
print '</td>';
|
||||
print '<td class="titlefieldmiddle"></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
|
|
|
|||
|
|
@ -9482,7 +9482,8 @@ class Form
|
|||
}
|
||||
|
||||
// Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
|
||||
$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>';
|
||||
$listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/>';
|
||||
$listoffieldsforselection .= '<label for="checkbox' . $key . '">'.dol_string_nohtmltag($langs->trans($val['label'])) . '</label></li>';
|
||||
$listcheckedstring .= (empty($val['checked']) ? '' : $key . ',');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
print '<th colspan="2"> </th>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("DefaultSkin").'</td>';
|
||||
print '<td>' . getDolGlobalString('MAIN_THEME').'</td>';
|
||||
print '<td class="nowrap left"><input id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit ? '' : ' disabled').' type="checkbox" '.($selected_theme ? " checked" : "").'> <label for="check_MAIN_THEME">'.$langs->trans("UsePersonalValue").'</label></td>';
|
||||
|
|
@ -410,19 +410,19 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
$dirthemestring .= '"'.$dirtheme.'" ';
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre"><th class="titlefieldmiddle">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
|
||||
print '</th>';
|
||||
print '<th class="right">';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
$url = 'https://www.dolistore.com/9-skins';
|
||||
print '<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">';
|
||||
print $langs->trans('DownloadMoreSkins');
|
||||
print img_picto('', 'globe', 'class="paddingleft"');
|
||||
print '</a>';
|
||||
print '</th></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td colspan="'.$colspan.'" class="center">';
|
||||
print '<tr class="oddeven"><td colspan="'.$colspan.'" class="center">';
|
||||
|
||||
if (getDolGlobalString('MAIN_FORCETHEME')) {
|
||||
$langs->load("errors");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user