dolibarr  20.0.0-beta
Public Member Functions | List of all members
FormResource Class Reference

Class to manage forms for the module resource. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 select_resource_list ($selected=0, $htmlname='fk_resource', array $filter=[], $showempty=0, $showtype=0, $forcecombo=0, $event=[], $filterkey=[], $outputmode=0, $limit=20, $morecss='', $multiple=false)
 Output html form to select a resource. More...
 
 select_types_resource ($selected='', $htmlname='type_resource', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0)
 Return html list of tickets type. More...
 
 select_ziptown ($selected='', $htmlname='zipcode', $fields=array(), $fieldsize=0, $disableautocomplete=0, $moreattrib='', $morecss='')
 Return a select list with zip codes and their town. More...
 
 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. More...
 

Detailed Description

Class to manage forms for the module resource.

Remarks
Utilisation: $formresource = new FormResource($db)
$formplace->proprietes=1 ou chaine ou tableau de valeurs

Definition at line 37 of file html.formresource.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormResource::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 59 of file html.formresource.class.php.

Member Function Documentation

◆ select_resource_list()

FormResource::select_resource_list (   $selected = 0,
  $htmlname = 'fk_resource',
array  $filter = [],
  $showempty = 0,
  $showtype = 0,
  $forcecombo = 0,
  $event = [],
  $filterkey = [],
  $outputmode = 0,
  $limit = 20,
  $morecss = '',
  $multiple = false 
)

Output html form to select a resource.

Parameters
int$selectedPreselected resource id
string$htmlnameName of field in form
array$filterOptional filters criteria (example: 's.rowid <> x')
int$showemptyAdd an empty field
int$showtypeShow third party type in combo list (customer, prospect or supplier)
int$forcecomboForce to use combo box
array$eventEvent options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
array$filterkeyFilter on key value
int$outputmode0=HTML select string, 1=Array, 2=without form tag
int$limitLimit number of answers, 0 for no limit
string$morecssMore css
bool$multipleadd [] in the name of element and add 'multiple' attribute
Returns
string|array HTML string with

Definition at line 83 of file html.formresource.class.php.

◆ select_state()

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.

Parameters
int$selectedCode state preselected (mus be state id)
integer$country_codeidCountry code or id: 0=list for all countries, otherwise country code or country rowid to show
string$htmlnameId of department. If '', we want only the string with <option>
string$morecssAdd more css
Returns
string String with HTML select
See also
select_country()

Definition at line 292 of file html.formresource.class.php.

◆ select_types_resource()

FormResource::select_types_resource (   $selected = '',
  $htmlname = 'type_resource',
  $filtertype = '',
  $format = 0,
  $empty = 0,
  $noadmininfo = 0,
  $maxlength = 0 
)

Return html list of tickets type.

Parameters
string$selectedId du type pre-selectionne
string$htmlnameNom de la zone select
string$filtertypeTo filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz))
int$format0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
int$empty1=peut etre vide, 0 sinon
int$noadmininfo0=Add admin info, 1=Disable admin info
int$maxlengthMax length of label
Returns
void

Definition at line 179 of file html.formresource.class.php.

◆ select_ziptown()

FormResource::select_ziptown (   $selected = '',
  $htmlname = 'zipcode',
  $fields = array(),
  $fieldsize = 0,
  $disableautocomplete = 0,
  $moreattrib = '',
  $morecss = '' 
)

Return a select list with zip codes and their town.

Parameters
string$selectedPreselected value
string$htmlnameHTML select name
array$fieldsArray with key of fields to refresh after selection
int$fieldsizeField size
int$disableautocomplete1 To disable ajax autocomplete features (browser autocomplete may still occurs)
string$moreattribAdd more attribute on HTML input field
string$morecssMore css
Returns
string

Definition at line 257 of file html.formresource.class.php.


The documentation for this class was generated from the following file: