dolibarr 21.0.0-alpha
|
Class to manage forms for the module resource. More...
Public Member Functions | |
__construct ($db) | |
Constructor. | |
select_resource_list ($selected=0, $htmlname='fk_resource', array $filter=[], $showempty=0, $showtype=0, $forcecombo=0, $event=[], $filterkey=[], $outputmode=0, $limit=20, $morecss='minwidth100', $multiple=false) | |
Output html form to select a resource. | |
select_types_resource ($selected='', $htmlname='type_resource', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $usejscombo=0, $morecss='minwidth100') | |
Return html list of tickets type. | |
select_ziptown ($selected='', $htmlname='zipcode', $fields=array(), $fieldsize=0, $disableautocomplete=0, $moreattrib='', $morecss='') | |
Return a select list with zip codes and their town. | |
select_state ($selected=0, $country_codeid=0, $htmlname='state_id', $morecss='maxwidth200onsmartphone minwidth300') | |
Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. | |
Class to manage forms for the module resource.
Definition at line 38 of file html.formresource.class.php.
FormResource::__construct | ( | $db | ) |
Constructor.
Definition at line 60 of file html.formresource.class.php.
FormResource::select_resource_list | ( | $selected = 0, | |
$htmlname = 'fk_resource', | |||
array | $filter = [], | ||
$showempty = 0, | |||
$showtype = 0, | |||
$forcecombo = 0, | |||
$event = [], | |||
$filterkey = [], | |||
$outputmode = 0, | |||
$limit = 20, | |||
$morecss = 'minwidth100', | |||
$multiple = false ) |
Output html form to select a resource.
int | $selected | Preselected resource id |
string | $htmlname | Name of field in form |
array | $filter | Optional filters criteria (example: 's.rowid <> x') |
int | $showempty | Add an empty field |
int | $showtype | Show third party type in combo list (customer, prospect or supplier) |
int | $forcecombo | Force to use combo box |
array | $event | Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) |
array | $filterkey | Filter on key value |
int | $outputmode | 0=HTML select string, 1=Array, 2=without form tag |
int | $limit | Limit number of answers, 0 for no limit |
string | $morecss | More css |
bool | $multiple | add [] in the name of element and add 'multiple' attribute |
Definition at line 84 of file html.formresource.class.php.
References ajax_combobox(), dol_print_error(), and getDolGlobalString().
FormResource::select_state | ( | $selected = 0, | |
$country_codeid = 0, | |||
$htmlname = 'state_id', | |||
$morecss = 'maxwidth200onsmartphone minwidth300' ) |
Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
In the case of an all-country list, the display breaks on the country. The key of the list is the code (there can be several entries for a given code but in this case, the country field differs). Thus the links with the departments are done on a department independently of its name.
int | $selected | Code state preselected (mus be state id) |
integer | $country_codeid | Country code or id: 0=list for all countries, otherwise country code or country rowid to show |
string | $htmlname | Id of department. If '', we want only the string with <option> |
string | $morecss | Add more css |
Definition at line 299 of file html.formresource.class.php.
References ajax_combobox(), dol_print_error(), dol_syslog(), getDolGlobalInt(), getDolGlobalString(), and info_admin().
FormResource::select_types_resource | ( | $selected = '', | |
$htmlname = 'type_resource', | |||
$filtertype = '', | |||
$format = 0, | |||
$empty = 0, | |||
$noadmininfo = 0, | |||
$maxlength = 0, | |||
$usejscombo = 0, | |||
$morecss = 'minwidth100' ) |
Return html list of tickets type.
string | $selected | Id du type pre-selectionne |
string | $htmlname | Nom de la zone select |
string | $filtertype | To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) |
int | $format | 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code |
int | $empty | 1=peut etre vide, 0 sinon |
int | $noadmininfo | 0=Add admin info, 1=Disable admin info |
int | $maxlength | Max length of label |
int | $usejscombo | 1=Use jscombo, 0=No js combo |
string | $morecss | Add more css |
Definition at line 182 of file html.formresource.class.php.
References $id, ajax_combobox(), dol_syslog(), dol_trunc(), and info_admin().
FormResource::select_ziptown | ( | $selected = '', | |
$htmlname = 'zipcode', | |||
$fields = array(), | |||
$fieldsize = 0, | |||
$disableautocomplete = 0, | |||
$moreattrib = '', | |||
$morecss = '' ) |
Return a select list with zip codes and their town.
string | $selected | Preselected value |
string | $htmlname | HTML select name |
string[] | $fields | Array with key of fields to refresh after selection |
int | $fieldsize | Field size |
int | $disableautocomplete | 1 To disable ajax autocomplete features (browser autocomplete may still occurs) |
string | $moreattrib | Add more attribute on HTML input field |
string | $morecss | More css |
Definition at line 264 of file html.formresource.class.php.
References ajax_multiautocompleter().