dolibarr  7.0.0-beta
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Form Class Reference

Class to manage generation of HTML components Only common components must be here. More...

+ Inheritance diagram for Form:

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 editfieldkey ($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0)
 Output key field for an editable field. More...
 
 editfieldval ($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0, $formatfunc='')
 Output value of a field for an editable field. More...
 
 textwithtooltip ($text, $htmltext, $tooltipon=1, $direction=0, $img= '', $extracss= '', $notabs=2, $incbefore= '', $noencodehtmltext=0, $tooltiptrigger='', $forcenowrap=0)
 Show a text and picto with tooltip on text or picto. More...
 
 textwithpicto ($text, $htmltext, $direction=1, $type= 'help', $extracss= '', $noencodehtmltext=0, $notabs=2, $tooltiptrigger='', $forcenowrap=0)
 Show a text with a picto and a tooltip on picto. More...
 
 selectMassAction ($selected, $arrayofaction, $alwaysvisible=0)
 Generate select HTML to choose massaction. More...
 
 select_country ($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='')
 Return combo list of activated countries, into language of user. More...
 
 select_incoterms ($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array())
 Return select list of incoterms. More...
 
 select_type_of_lines ($selected='', $htmlname='type', $showempty=0, $hidetext=0, $forceall=0)
 Return list of types of lines (product or service) Example: 0=product, 1=service, 9=other (for external module) More...
 
 load_cache_types_fees ()
 Load into cache cache_types_fees, array of types of fees. More...
 
 select_type_fees ($selected='', $htmlname='type', $showempty=0)
 Return list of types of notes. More...
 
 select_thirdparty ($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
 Return HTML code to select a company. More...
 
 select_company ($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array())
 Output html form to select a third party. More...
 
 select_thirdparty_list ($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='')
 Output html form to select a third party. More...
 
 select_remises ($selected, $htmlname, $filter, $socid, $maxvalue=0)
 Return HTML combo list of absolute discounts. More...
 
 select_contacts ($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='')
 Return list of all contacts (for a third party or all) More...
 
 selectcontacts ($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='')
 Return HTML code of the SELECT of list of all contacts (for a third party or all). More...
 
 select_users ($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0)
 Return select list of users. More...
 
 select_dolusers ($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0)
 Return select list of users. More...
 
 select_dolusers_forevent ($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
 Return select list of users. More...
 
 select_produits ($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations=array())
 Return list of products for customer in Ajax if Ajax activated or go to select_produits_list. More...
 
 select_produits_list ($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $filterkey='', $status=1, $finished=2, $outputmode=0, $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='')
 Return list of products for a customer. More...
 
 select_produits_fournisseurs ($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0)
 Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) More...
 
 select_produits_fournisseurs_list ($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $filterkey='', $statut=-1, $outputmode=0, $limit=100, $alsoproductwithnosupplierprice=0)
 Return list of suppliers products. More...
 
 select_product_fourn_price ($productid, $htmlname='productfournpriceid', $selected_supplier='')
 Return list of suppliers prices for a product. More...
 
 select_address ($selected, $socid, $htmlname='address_id', $showempty=0)
 Return list of delivery address. More...
 
 load_cache_conditions_paiements ()
 Load into cache list of payment terms. More...
 
 load_cache_availability ()
 Charge dans cache la liste des délais de livraison possibles. More...
 
 selectAvailabilityDelay ($selected='', $htmlname='availid', $filtertype='', $addempty=0)
 Retourne la liste des types de delais de livraison possibles. More...
 
 loadCacheInputReason ()
 Load into cache cache_demand_reason, array of input reasons. More...
 
 selectInputReason ($selected='', $htmlname='demandreasonid', $exclude='', $addempty=0)
 Return list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) List found into table c_input_reason loaded by loadCacheInputReason. More...
 
 load_cache_types_paiements ()
 Charge dans cache la liste des types de paiements possibles. More...
 
 select_conditions_paiements ($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='')
 Return list of payment modes. More...
 
 select_types_paiements ($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
 Return list of payment methods. More...
 
 selectPriceBaseType ($selected='', $htmlname='price_base_type')
 Selection HT or TTC. More...
 
 selectShippingMethod ($selected='', $htmlname='shipping_method_id', $filtre='', $useempty=0, $moreattrib='')
 Return a HTML select list of shipping mode. More...
 
 formSelectShippingMethod ($page, $selected='', $htmlname='shipping_method_id', $addempty=0)
 Display form to select shipping mode. More...
 
 selectSituationInvoices ($selected= '', $socid=0)
 Creates HTML last in cycle situation invoices selector. More...
 
 selectUnits ($selected= '', $htmlname= 'units', $showempty=0)
 Creates HTML units selector (code => label) More...
 
 select_comptes ($selected='', $htmlname='accountid', $statut=0, $filtre='', $useempty=0, $moreattrib='', $showcurrency=0)
 Return a HTML select list of bank accounts. More...
 
 formSelectAccount ($page, $selected='', $htmlname='fk_account', $addempty=0)
 Display form to select bank account. More...
 
 select_all_categories ($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0)
 Return list of categories having choosed type. More...
 
 form_confirm ($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500)
 Show a confirmation HTML form or AJAX popup. More...
 
 formconfirm ($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=200, $width=500, $disableformtag=0)
 Show a confirmation HTML form or AJAX popup. More...
 
 form_project ($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0)
 Show a form to select a project. More...
 
 form_conditions_reglement ($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
 Show a form to select payment conditions. More...
 
 form_availability ($page, $selected='', $htmlname='availability', $addempty=0)
 Show a form to select a delivery delay. More...
 
 formInputReason ($page, $selected='', $htmlname='demandreason', $addempty=0)
 Output HTML form to select list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) List found into table c_input_reason loaded by loadCacheInputReason. More...
 
 form_date ($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
 Show a form + html select a date. More...
 
 form_users ($page, $selected='', $htmlname='userid', $exclude='', $include='')
 Show a select form to choose a user. More...
 
 form_modes_reglement ($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
 Show form with payment mode. More...
 
 form_multicurrency_code ($page, $selected='', $htmlname='multicurrency_code')
 Show form with multicurrency code. More...
 
 form_multicurrency_rate ($page, $rate='', $htmlname='multicurrency_tx', $currency='')
 Show form with multicurrency rate. More...
 
 form_remise_dispo ($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0)
 Show a select box with available absolute discounts. More...
 
 form_contacts ($page, $societe, $selected='', $htmlname='contactid')
 Show forms to select a contact. More...
 
 form_thirdparty ($page, $selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array())
 Output html select to select thirdparty. More...
 
 select_currency ($selected='', $htmlname='currency_id')
 Retourne la liste des devises, dans la langue de l'utilisateur. More...
 
 selectCurrency ($selected='', $htmlname='currency_id')
 Retourne la liste des devises, dans la langue de l'utilisateur. More...
 
 selectMultiCurrency ($selected='', $htmlname='multicurrency_code', $useempty=0)
 Return array of currencies in user language. More...
 
 load_cache_vatrates ($country_code)
 Load into the cache vat rates of a country. More...
 
 load_tva ($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0)
 Output an HTML select vat rate. More...
 
 select_date ($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
 Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes. More...
 
 select_duration ($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
 Function to show a form to select a duration on a page. More...
 
 selectForForms ($objectdesc, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0)
 Generic method to select a component from a combo list. More...
 
 selectForFormsList ($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0)
 Output html form to select an object. More...
 
 showCategories ($id, $type, $rendermode=0)
 Render list of categories linked to object with id $id and type $type. More...
 
 showLinkedObjectBlock ($object, $morehtmlright='')
 Show linked object block. More...
 
 showLinkToObjectBlock ($object, $restrictlinksto=array(), $excludelinksto=array())
 Show block with links to link to other objects. More...
 
 selectyesno ($htmlname, $value='', $option=0, $disabled=false, $useempty='')
 Return an html string with a select combo box to choose yes or no. More...
 
 select_export_model ($selected='', $htmlname='exportmodelid', $type='', $useempty=0)
 Return list of export templates. More...
 
 showrefnav ($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $morehtmlright='')
 Return a HTML area with the reference of object and a navigation bar for a business object Note: To complete search with a particular filter on select, you can set $object->next_prev_filter set to define SQL criterias. More...
 
 showbarcode (&$object, $width=100)
 Return HTML code to output a barcode. More...
 
 select_dolgroups ($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0)
 Return select list of groups. More...
 
 showFilterButtons ()
 Return HTML to show the search and clear seach button. More...
 
 showCheckAddButtons ($cssclass='checkforaction', $calljsfunction=0)
 Return HTML to show the search and clear seach button. More...
 
 showFilterAndCheckAddButtons ($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0)
 Return HTML to show the search and clear seach button. More...
 
 selectExpenseCategories ($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array())
 Return HTML to show the select categories of expense category. More...
 
 selectExpenseRanges ($selected='', $htmlname='fk_range', $useempty=0)
 Return HTML to show the select ranges of expense range. More...
 
 selectExpense ($selected='', $htmlname='fk_c_type_fees', $useempty=0, $allchoice=1, $useid=0)
 Return HTML to show a select of expense. More...
 

Static Public Member Functions

static selectarray ($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
 Return a HTML select string, built from an array of key+value. More...
 
static selectArrayAjax ($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
 Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL. More...
 
static multiselectarray ($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='')
 Show a multiselect form from an array. More...
 
static multiSelectArrayWithCheckbox ($htmlname, &$array, $varpage)
 Show a multiselect dropbox from an array. More...
 
static showphoto ($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0)
 Return HTML code to output a photo. More...
 

Private Member Functions

 editInPlace ($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null)
 Output edit in place form. More...
 
 constructProductListOption (&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel=0)
 constructProductListOption More...
 

Detailed Description

Class to manage generation of HTML components Only common components must be here.

TODO Merge all function load_cache_* and loadCache* (except load_cache_vatrates) into one generic function loadCacheTable

Definition at line 47 of file html.form.class.php.

Constructor & Destructor Documentation

Form::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 67 of file html.form.class.php.

Member Function Documentation

Form::constructProductListOption ( $objp,
$opt,
$optJson,
  $price_level,
  $selected,
  $hidepriceinlabel = 0 
)
private

constructProductListOption

Parameters
resultset$objpResultset of fetch
string$optOption (var used for returned value in string option format)
string$optJsonOption (var used for returned value in json format)
int$price_levelPrice level
string$selectedPreselected value
int$hidepriceinlabelHide price in label
Returns
void

Definition at line 2142 of file html.form.class.php.

References dol_print_error(), dol_strlen(), dol_syslog(), if, price(), Product\TYPE_SERVICE, and vatrate().

Referenced by select_produits_list().

Form::editfieldkey (   $text,
  $htmlname,
  $preselected,
  $object,
  $perm,
  $typeofdata = 'string',
  $moreparam = '',
  $fieldrequired = 0,
  $notabletag = 0 
)

Output key field for an editable field.

Parameters
string$textText of label or key to translate
string$htmlnameName of select field ('edit' prefix will be added)
string$preselectedValue to show/edit (not used in this function)
object$objectObject
boolean$permPermission to allow button to edit parameter. Set it to 0 to have a not edited field.
string$typeofdataType of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
string$moreparamMore param to add on a href URL.
int$fieldrequired1 if we want to show field as mandatory using the "fieldrequired" CSS.
int$notabletag1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
Returns
string HTML edit field

Definition at line 86 of file html.form.class.php.

References GETPOST(), if, and img_edit().

Form::editfieldval (   $text,
  $htmlname,
  $value,
  $object,
  $perm,
  $typeofdata = 'string',
  $editvalue = '',
  $extObject = null,
  $custommsg = null,
  $moreparam = '',
  $notabletag = 0,
  $formatfunc = '' 
)

Output value of a field for an editable field.

Parameters
string$textText of label (not used in this function)
string$htmlnameName of select field
string$valueValue to show/edit
object$objectObject
boolean$permPermission to allow button to edit parameter
string$typeofdataType of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
string$editvalueWhen in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
object$extObjectExternal object
mixed$custommsgString or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
string$moreparamMore param to add on a href URL
int$notabletagDo no output table tags
string$formatfuncCall a specific function to output field
Returns
string HTML edit field

Definition at line 147 of file html.form.class.php.

References dol_htmlentitiesbr(), dol_print_date(), dol_print_email(), editInPlace(), GETPOST(), if, price(), price2num(), select_date(), and selectarray().

Form::editInPlace (   $object,
  $value,
  $htmlname,
  $condition,
  $inputType = 'textarea',
  $editvalue = null,
  $extObject = null,
  $custommsg = null 
)
private

Output edit in place form.

Parameters
object$objectObject
string$valueValue to show/edit
string$htmlnameDIV ID (field name)
int$conditionCondition to edit
string$inputTypeType of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
string$editvalueWhen in edit mode, use this value as $value instead of value
object$extObjectExternal object
mixed$custommsgString or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
Returns
string HTML edit in place

Definition at line 284 of file html.form.class.php.

References dol_nl2br(), dol_print_date(), and price().

Referenced by editfieldval().

Form::form_availability (   $page,
  $selected = '',
  $htmlname = 'availability',
  $addempty = 0 
)

Show a form to select a delivery delay.

Parameters
int$pagePage
string$selectedId condition pre-selectionne
string$htmlnameName of select html field
int$addemptyAjoute entree vide
Returns
void

Definition at line 3961 of file html.form.class.php.

References load_cache_availability(), print, and selectAvailabilityDelay().

Form::form_conditions_reglement (   $page,
  $selected = '',
  $htmlname = 'cond_reglement_id',
  $addempty = 0 
)

Show a form to select payment conditions.

Parameters
int$pagePage
string$selectedId condition pre-selectionne
string$htmlnameName of select html field
int$addemptyAdd empty entry
Returns
void

Definition at line 3928 of file html.form.class.php.

References load_cache_conditions_paiements(), print, and select_conditions_paiements().

Form::form_confirm (   $page,
  $title,
  $question,
  $action,
  $formquestion = '',
  $selectedchoice = "",
  $useajax = 0,
  $height = 170,
  $width = 500 
)

Show a confirmation HTML form or AJAX popup.

Parameters
string$pageUrl of page to call if confirmation is OK
string$titleTitle
string$questionQuestion
string$actionAction
array$formquestionAn array with forms complementary inputs
string$selectedchoice"" or "no" or "yes"
int$useajax0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx
int$heightForce height of box
int$widthForce width of box
Returns
void
Deprecated:
See also
formconfirm()

Definition at line 3564 of file html.form.class.php.

References $title, formconfirm(), and print.

Form::form_contacts (   $page,
  $societe,
  $selected = '',
  $htmlname = 'contactid' 
)

Show forms to select a contact.

Parameters
string$pagePage
Societe$societeFilter on third party
int$selectedId contact pre-selectionne
string$htmlnameName of HTML select. If 'none', we just show contact link.
Returns
void

Definition at line 4287 of file html.form.class.php.

References print, and select_contacts().

Form::form_date (   $page,
  $selected,
  $htmlname,
  $displayhour = 0,
  $displaymin = 0,
  $nooutput = 0 
)

Show a form + html select a date.

Parameters
string$pagePage
string$selectedDate preselected
string$htmlnameHtml name of date input fields or 'none'
int$displayhourDisplay hour selector
int$displayminDisplay minutes selector
int$nooutput1=No print output, return string
Returns
string
See also
select_date

Definition at line 4038 of file html.form.class.php.

References dol_print_date(), print, and select_date().

Form::form_modes_reglement (   $page,
  $selected = '',
  $htmlname = 'mode_reglement_id',
  $filtertype = '',
  $active = 1 
)

Show form with payment mode.

Parameters
string$pagePage
int$selectedId mode pre-selectionne
string$htmlnameName of select html field
string$filtertypeTo filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
int$activeActive or not, -1 = all
Returns
void

Definition at line 4115 of file html.form.class.php.

References load_cache_types_paiements(), print, and select_types_paiements().

Form::form_multicurrency_code (   $page,
  $selected = '',
  $htmlname = 'multicurrency_code' 
)

Show form with multicurrency code.

Parameters
string$pagePage
string$selectedcode pre-selectionne
string$htmlnameName of select html field
Returns
void

Definition at line 4147 of file html.form.class.php.

References currency_name(), dol_include_once(), print, and selectMultiCurrency().

Form::form_multicurrency_rate (   $page,
  $rate = '',
  $htmlname = 'multicurrency_tx',
  $currency = '' 
)

Show form with multicurrency rate.

Parameters
string$pagePage
double$rateCurrent rate
string$htmlnameName of select html field
string$currencyCurrency code to explain the rate
Returns
void

Definition at line 4175 of file html.form.class.php.

References price(), and print.

Form::form_project (   $page,
  $socid,
  $selected = '',
  $htmlname = 'projectid',
  $discard_closed = 0,
  $maxlength = 20,
  $forcefocus = 0,
  $nooutput = 0 
)

Show a form to select a project.

Parameters
int$pagePage
int$socidId third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
int$selectedId pre-selected project
string$htmlnameName of select field
int$discard_closedDiscard closed projects (0=Keep,1=hide completely except $selected,2=Disable)
int$maxlengthMax length
int$forcefocusForce focus on field (works with javascript only)
int$nooutputNo print is done. String is returned.
Returns
string Return html content

Definition at line 3874 of file html.form.class.php.

References print.

Form::form_remise_dispo (   $page,
  $selected,
  $htmlname,
  $socid,
  $amount,
  $filter = '',
  $maxvalue = 0,
  $more = '',
  $hidelist = 0 
)

Show a select box with available absolute discounts.

Parameters
string$pagePage URL where form is shown
int$selectedValue pre-selected
string$htmlnameName of SELECT component. If 'none', not changeable. Example 'remise_id'.
int$socidThird party id
float$amountTotal amount available
string$filterSQL filter on discounts
int$maxvalueMax value for lines that can be selected
string$moreMore string to add
int$hidelist1=Hide list
Returns
void

Definition at line 4221 of file html.form.class.php.

References price(), print, and select_remises().

Form::form_thirdparty (   $page,
  $selected = '',
  $htmlname = 'socid',
  $filter = '',
  $showempty = 0,
  $showtype = 0,
  $forcecombo = 0,
  $events = array() 
)

Output html select to select thirdparty.

Parameters
string$pagePage
string$selectedId preselected
string$htmlnameName of HTML select
string$filteroptional filters criteras
int$showemptyAdd an empty field
int$showtypeShow third party type in combolist (customer, prospect or supplier)
int$forcecomboForce to use combo box
array$eventsEvent options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
Returns
void

Definition at line 4335 of file html.form.class.php.

References print, and select_company().

Form::form_users (   $page,
  $selected = '',
  $htmlname = 'userid',
  $exclude = '',
  $include = '' 
)

Show a select form to choose a user.

Parameters
string$pagePage
string$selectedId of user preselected
string$htmlnameName of input html field. If 'none', we just output the user link.
array$excludeList of users id to exclude
array$includeList of users id to include
Returns
void

Definition at line 4077 of file html.form.class.php.

References print, and select_dolusers().

Form::formconfirm (   $page,
  $title,
  $question,
  $action,
  $formquestion = '',
  $selectedchoice = '',
  $useajax = 0,
  $height = 200,
  $width = 500,
  $disableformtag = 0 
)

Show a confirmation HTML form or AJAX popup.

Easiest way to use this is with useajax=1. If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters) just after calling this method. For example: print '<script type="text/javascript">'."\n"; print 'jQuery(document).ready(function() {'."\n"; print 'jQuery(".xxxlink").click(function(e) { jQuery("#aparamid").val(jQuery(this).attr("rel")); jQuery("#dialog-confirm-xxx").dialog("open"); return false; });'."\n"; print '});'."\n"; print '</script>'."\n";

Parameters
string$pageUrl of page to call if confirmation is OK. Can contains paramaters (param 'action' and 'confirm' will be reformated)
string$titleTitle
string$questionQuestion
string$actionAction
array$formquestionAn array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ...
string$selectedchoice"" or "no" or "yes"
int$useajax0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
int$heightForce height of box
int$widthForce width of box ('999' or '90'). Ignored and forced to 90% on smartphones.
int$disableformtag1=Disable form tag. Can be used if we are already inside a <form> section.
Returns
string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form

Definition at line 3593 of file html.form.class.php.

References $title, dol_escape_htmltag(), dol_escape_js(), select_date(), and selectyesno().

Referenced by form_confirm().

Form::formInputReason (   $page,
  $selected = '',
  $htmlname = 'demandreason',
  $addempty = 0 
)

Output HTML form to select list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) List found into table c_input_reason loaded by loadCacheInputReason.

Parameters
string$pagePage
string$selectedId condition pre-selectionne
string$htmlnameName of select html field
int$addemptyAdd empty entry
Returns
void

Definition at line 3995 of file html.form.class.php.

References loadCacheInputReason(), print, and selectInputReason().

Form::formSelectAccount (   $page,
  $selected = '',
  $htmlname = 'fk_account',
  $addempty = 0 
)

Display form to select bank account.

Parameters
string$pagePage
int$selectedId of bank account
string$htmlnameName of select html field
int$addempty1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
Returns
void

Definition at line 3438 of file html.form.class.php.

References print, and select_comptes().

Form::formSelectShippingMethod (   $page,
  $selected = '',
  $htmlname = 'shipping_method_id',
  $addempty = 0 
)

Display form to select shipping mode.

Parameters
string$pagePage
int$selectedId of shipping mode
string$htmlnameName of select html field
int$addempty1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
Returns
void

Definition at line 3244 of file html.form.class.php.

References print, and selectShippingMethod().

Form::load_cache_availability ( )

Charge dans cache la liste des délais de livraison possibles.

Returns
int Nb of lines loaded, <0 if KO

Definition at line 2829 of file html.form.class.php.

References $resql, dol_print_error(), dol_sort_array(), and dol_syslog().

Referenced by form_availability(), and selectAvailabilityDelay().

Form::load_cache_conditions_paiements ( )

Load into cache list of payment terms.

Returns
int Nb of lines loaded, <0 if KO

Definition at line 2782 of file html.form.class.php.

References $resql, dol_print_error(), dol_syslog(), and getEntity().

Referenced by form_conditions_reglement(), and select_conditions_paiements().

Form::load_cache_types_fees ( )

Load into cache cache_types_fees, array of types of fees.

Returns
int Nb of lines loaded, <0 if KO

Definition at line 883 of file html.form.class.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by select_type_fees().

Form::load_cache_types_paiements ( )

Charge dans cache la liste des types de paiements possibles.

Returns
int Nb of lines loaded, <0 if KO

Definition at line 2995 of file html.form.class.php.

References $resql, dol_print_error(), dol_sort_array(), and dol_syslog().

Referenced by form_modes_reglement(), and select_types_paiements().

Form::load_cache_vatrates (   $country_code)

Load into the cache vat rates of a country.

Parameters
string$country_codeCountry code with quotes ("'CA'", or "'CA,IN,...'")
Returns
int Nb of loaded lines, 0 if already loaded, <0 if KO

Definition at line 4481 of file html.form.class.php.

References $resql, dol_syslog(), and if.

Referenced by load_tva().

Form::load_tva (   $htmlname = 'tauxtva',
  $selectedrate = '',
  $societe_vendeuse = '',
  $societe_acheteuse = '',
  $idprod = 0,
  $info_bits = 0,
  $type = '',
  $options_only = false,
  $mode = 0 
)

Output an HTML select vat rate.

The name of this function should be selectVat. We keep bad name for compatibility purpose.

Parameters
string$htmlnameName of HTML select field
float | string$selectedrateForce preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing.
Societe$societe_vendeuseThirdparty seller
Societe$societe_acheteuseThirdparty buyer
int$idprodId product. O if unknown of NA.
int$info_bitsMiscellaneous information on line (1 for NPR)
int | string$type''=Unknown, 0=Product, 1=Service (Used if idprod not defined) Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle. Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu. Fin de règle. Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle. Sinon la TVA proposee par defaut=0. Fin de regle.
bool$options_onlyReturn HTML options lines only (for ajax treatment)
int$mode0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key
Returns
string

Definition at line 4561 of file html.form.class.php.

References $title, dol_strlen(), get_default_npr(), get_default_tva(), isInEEC(), load_cache_vatrates(), Product\TYPE_SERVICE, and vatrate().

Form::loadCacheInputReason ( )

Load into cache cache_demand_reason, array of input reasons.

Returns
int Nb of lines loaded, <0 if KO

Definition at line 2912 of file html.form.class.php.

References $resql, dol_print_error(), and dol_sort_array().

Referenced by formInputReason(), and selectInputReason().

static Form::multiselectarray (   $htmlname,
  $array,
  $selected = array(),
  $key_in_label = 0,
  $value_as_key = 0,
  $morecss = '',
  $translate = 0,
  $width = 0,
  $moreattrib = '',
  $elemtype = '' 
)
static

Show a multiselect form from an array.

Parameters
string$htmlnameName of select
array$arrayArray with key+value
array$selectedArray with key+value preselected
int$key_in_label1 pour afficher la key dans la valeur "[key] value"
int$value_as_key1 to use value as key
string$morecssAdd more css style
int$translateTranslate and encode value
int$widthForce width of select box. May be used only when using jquery couch. Example: 250, 95%
string$moreattribAdd more options on select component. Example: 'disabled'
string$elemtypeType of element we show ('category', ...)
Returns
string HTML multiselect string
See also
selectarray

Definition at line 5615 of file html.form.class.php.

Referenced by showCategories().

static Form::multiSelectArrayWithCheckbox (   $htmlname,
$array,
  $varpage 
)
static

Show a multiselect dropbox from an array.

Parameters
string$htmlnameName of HTML field
array$arrayArray with array of fields we could show. This array may be modified according to setup of user.
string$varpageId of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage);
Returns
string HTML multiselect string
See also
selectarray

Definition at line 5703 of file html.form.class.php.

References dol_escape_htmltag(), and img_picto().

Form::select_address (   $selected,
  $socid,
  $htmlname = 'address_id',
  $showempty = 0 
)

Return list of delivery address.

Parameters
string$selectedId contact pre-selectionn
int$socidId of company
string$htmlnameName of HTML field
int$showemptyAdd an empty field
Returns
integer|null

Definition at line 2734 of file html.form.class.php.

References $resql, dol_print_error(), dol_syslog(), and print.

Form::select_all_categories (   $type,
  $selected = '',
  $htmlname = "parent",
  $maxlength = 64,
  $excludeafterid = 0,
  $outputmode = 0 
)

Return list of categories having choosed type.

Parameters
string | int$typeType of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
string$selectedId of category preselected or 'auto' (autoselect category if there is only one element)
string$htmlnameHTML field name
int$maxlengthMaximum length for labels
int$excludeafteridExclude all categories after this leaf in category tree.
int$outputmode0=HTML select string, 1=Array
Returns
string
See also
select_categories

Definition at line 3475 of file html.form.class.php.

References dol_print_error(), dol_syslog(), and dol_trunc().

Referenced by showCategories().

Form::select_company (   $selected = '',
  $htmlname = 'socid',
  $filter = '',
  $showempty = '',
  $showtype = 0,
  $forcecombo = 0,
  $events = array(),
  $limit = 0,
  $morecss = 'minwidth100',
  $moreparam = '',
  $selected_input_value = '',
  $hidelabel = 1,
  $ajaxoptions = array() 
)

Output html form to select a third party.

Parameters
string$selectedPreselected type
string$htmlnameName of field in form
string$filteroptional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
string$showemptyAdd an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
int$showtypeShow third party type in combolist (customer, prospect or supplier)
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
array$eventsAjax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
int$limitMaximum number of elements
string$morecssAdd more css styles to the SELECT component
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
string$selected_input_valueValue of preselected input text (for use with ajax)
int$hidelabelHide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
array$ajaxoptionsOptions for ajax_autocompleter
Returns
string HTML string with select box for thirdparty.

Definition at line 998 of file html.form.class.php.

References ajax_autocompleter(), img_picto(), print, and select_thirdparty_list().

Referenced by form_thirdparty().

Form::select_comptes (   $selected = '',
  $htmlname = 'accountid',
  $statut = 0,
  $filtre = '',
  $useempty = 0,
  $moreattrib = '',
  $showcurrency = 0 
)

Return a HTML select list of bank accounts.

Parameters
string$selectedId account pre-selected
string$htmlnameName of select zone
int$statutStatus of searched accounts (0=open, 1=closed, 2=both)
string$filtreTo filter list
int$useempty1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
string$moreattribTo add more attribute on select
int$showcurrencyShow currency in label
Returns
void

Definition at line 3373 of file html.form.class.php.

References dol_print_error(), dol_syslog(), and print.

Referenced by formSelectAccount().

Form::select_conditions_paiements (   $selected = 0,
  $htmlname = 'condid',
  $filtertype = -1,
  $addempty = 0,
  $noinfoadmin = 0,
  $morecss = '' 
)

Return list of payment modes.

Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want. See instead to force the default value by the caller.

Parameters
int$selectedId of payment term to preselect by default
string$htmlnameNom de la zone select
int$filtertypeNot used
int$addemptyAdd an empty entry
int$noinfoadmin0=Add admin info, 1=Disable admin info
string$morecssAdd more CSS on select tag
Returns
void

Definition at line 3055 of file html.form.class.php.

References dol_syslog(), if, info_admin(), load_cache_conditions_paiements(), and print.

Referenced by form_conditions_reglement().

Form::select_contacts (   $socid,
  $selected = '',
  $htmlname = 'contactid',
  $showempty = 0,
  $exclude = '',
  $limitto = '',
  $showfunction = 0,
  $moreclass = '',
  $showsoc = 0,
  $forcecombo = 0,
  $events = array(),
  $options_only = false,
  $moreparam = '',
  $htmlid = '' 
)

Return list of all contacts (for a third party or all)

Parameters
int$socidId ot third party or 0 for all
string$selectedId contact pre-selectionne
string$htmlnameName of HTML field ('none' for a not editable field)
int$showempty0=no empty value, 1=add an empty value
string$excludeList of contacts id to exclude
string$limittoDisable answers that are not id in this array list
integer$showfunctionAdd function into label
string$moreclassAdd more class to class style
integer$showsocAdd company into label
int$forcecomboForce to use combo box
array$eventsEvent options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
bool$options_onlyReturn options only (for ajax treatment)
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
string$htmlidHtml id to use instead of htmlname
Returns
int <0 if KO, Nb of contact in list if OK You can use selectcontacts directly (warning order of param was changed)

Definition at line 1287 of file html.form.class.php.

References print, and selectcontacts().

Referenced by form_contacts().

Form::select_country (   $selected = '',
  $htmlname = 'country_id',
  $htmloption = '',
  $maxlength = 0,
  $morecss = 'minwidth300',
  $usecodeaskey = '' 
)

Return combo list of activated countries, into language of user.

Parameters
string$selectedId or Code or Label of preselected country
string$htmlnameName of html select object
string$htmloptionOptions html on select object
integer$maxlengthMax length for labels (0=no limit)
string$morecssMore css class
string$usecodeaskey'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key
Returns
string HTML string with select

Definition at line 651 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), dol_string_unaccent(), dol_syslog(), and dol_trunc().

Form::select_currency (   $selected = '',
  $htmlname = 'currency_id' 
)

Retourne la liste des devises, dans la langue de l'utilisateur.

Parameters
string$selectedpreselected currency code
string$htmlnamename of HTML select list
Returns
void

Definition at line 4371 of file html.form.class.php.

References print, and selectCurrency().

Form::select_date (   $set_time = '',
  $prefix = 're',
  $h = 0,
  $m = 0,
  $empty = 0,
  $form_name = "",
  $d = 1,
  $addnowlink = 0,
  $nooutput = 0,
  $disabled = 0,
  $fullday = '',
  $addplusone = '',
  $adddateof = '' 
)

Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.

Fields are preselected with :

  • set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM')
  • local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location)
  • Empty (fields empty), if set_time is -1 (in this case, parameter empty must also have value 1)
Parameters
timestamp$set_timePre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date (emptydate must be 0).
string$prefixPrefix for fields name
int$h1=Show also hours (-1 has same effect, but hour and minutes are prefilled with 23:59 if $set_time = -1)
int$m1=Show also minutes
int$empty0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
string$form_nameNot used
int$d1=Show days, month, years
int$addnowlinkAdd a link "Now"
int$nooutputDo not output html string but return it
int$disabledDisable input fields
int$fulldayWhen a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
string$addplusoneAdd a link "+1 hour". Value must be name of another select_date field.
datetime$adddateofAdd a link "Date of invoice" using the following date.
Returns
string|null Nothing or string if nooutput is 1
See also
form_date

Definition at line 4750 of file html.form.class.php.

References dol_now(), dol_print_date(), getServerTimeZoneInt(), and type.

Referenced by editfieldval(), form_date(), and formconfirm().

Form::select_dolgroups (   $selected = '',
  $htmlname = 'groupid',
  $show_empty = 0,
  $exclude = '',
  $disabled = 0,
  $include = '',
  $enableonly = '',
  $force_entity = 0 
)

Return select list of groups.

Parameters
string$selectedId group preselected
string$htmlnameField name in form
int$show_empty0=liste sans valeur nulle, 1=ajoute valeur inconnue
string$excludeArray list of groups id to exclude
int$disabledIf select list must be disabled
string$includeArray list of groups id to include
int$enableonlyArray list of groups id to be enabled. All other must be disabled
int$force_entity0 or Id of environment to force
Returns
string
See also
select_dolusers

Definition at line 6535 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), and dol_syslog().

Form::select_dolusers (   $selected = '',
  $htmlname = 'userid',
  $show_empty = 0,
  $exclude = null,
  $disabled = 0,
  $include = '',
  $enableonly = '',
  $force_entity = 0,
  $maxlength = 0,
  $showstatus = 0,
  $morefilter = '',
  $show_every = 0,
  $enableonlytext = '',
  $morecss = '',
  $noactive = 0 
)

Return select list of users.

Parameters
string$selectedUser id or user object of user preselected. If -1, we use id of current user.
string$htmlnameField name in form
int$show_empty0=list with no empty value, 1=add also an empty value into list
array$excludeArray list of users id to exclude
int$disabledIf select list must be disabled
array | string$includeArray list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
array$enableonlyArray list of users id to be enabled. If defined, it means that others will be disabled
int$force_entity0 or Id of environment to force
int$maxlengthMaximum length of string into list (0=no limit)
int$showstatus0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
string$morefilterAdd more filters into sql request
integer$show_every0=default list, 1=add also a value "Everybody" at beginning of list
string$enableonlytextIf option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
string$morecssMore css
int$noactiveShow only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
Returns
string HTML select string
See also
select_dolgroups

Definition at line 1462 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), dol_syslog(), and if.

Referenced by form_users(), select_dolusers_forevent(), and select_users().

Form::select_dolusers_forevent (   $action = '',
  $htmlname = 'userid',
  $show_empty = 0,
  $exclude = null,
  $disabled = 0,
  $include = '',
  $enableonly = '',
  $force_entity = 0,
  $maxlength = 0,
  $showstatus = 0,
  $morefilter = '',
  $showproperties = 0,
  $listofuserid = array(),
  $listofcontactid = array(),
  $listofotherid = array() 
)

Return select list of users.

Selected users are stored into session. List of users are provided into $_SESSION['assignedtouser'].

Parameters
string$actionValue for $action
string$htmlnameField name in form
int$show_empty0=list without the empty value, 1=add empty value
array$excludeArray list of users id to exclude
int$disabledIf select list must be disabled
array$includeArray list of users id to include or 'hierarchy' to have only supervised users
array$enableonlyArray list of users id to be enabled. All other must be disabled
int$force_entity0 or Id of environment to force
int$maxlengthMaximum length of string into list (0=no limit)
int$showstatus0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
string$morefilterAdd more filters into sql request
int$showpropertiesShow properties of each attendees
array$listofuseridArray with properties of each user
array$listofcontactidArray with properties of each contact
array$listofotheridArray with properties of each other contact
Returns
string HTML select string
See also
select_dolgroups

Definition at line 1658 of file html.form.class.php.

References dol_escape_htmltag(), if, and select_dolusers().

Form::select_duration (   $prefix,
  $iSecond = '',
  $disabled = 0,
  $typehour = 'select',
  $minunderhours = 0,
  $nooutput = 0 
)

Function to show a form to select a duration on a page.

Parameters
string$prefixPrefix for input fields
int$iSecondDefault preselected duration (number of seconds or '')
int$disabledDisable the combo box
string$typehourIf 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a text, if 'textselect' input hour is in text and input min is a combo
integer$minunderhoursIf 1, show minutes selection under the hours
int$nooutputDo not output html string but return it
Returns
string|null

Definition at line 5112 of file html.form.class.php.

Form::select_export_model (   $selected = '',
  $htmlname = 'exportmodelid',
  $type = '',
  $useempty = 0 
)

Return list of export templates.

Parameters
string$selectedId modele pre-selectionne
string$htmlnameName of HTML select
string$typeType of searched templates
int$useemptyAffiche valeur vide dans liste
Returns
void

Definition at line 6169 of file html.form.class.php.

References dol_print_error(), and print.

Form::select_incoterms (   $selected = '',
  $location_incoterms = '',
  $page = '',
  $htmlname = 'incoterm_id',
  $htmloption = '',
  $forcecombo = 1,
  $events = array() 
)

Return select list of incoterms.

Parameters
string$selectedId or Code of preselected incoterm
string$location_incotermsValue of input location
string$pageDefined the form action
string$htmlnameName of html select object
string$htmloptionOptions html on select object
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
array$eventsEvent options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
Returns
string HTML string with select and input

Definition at line 743 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), and dol_syslog().

Form::select_product_fourn_price (   $productid,
  $htmlname = 'productfournpriceid',
  $selected_supplier = '' 
)

Return list of suppliers prices for a product.

Parameters
int$productidId of product
string$htmlnameName of HTML field
int$selected_supplierPre-selected supplier if more than 1 result
Returns
void

Definition at line 2622 of file html.form.class.php.

References $form, dol_print_error(), dol_syslog(), and price().

Form::select_produits (   $selected = '',
  $htmlname = 'productid',
  $filtertype = '',
  $limit = 20,
  $price_level = 0,
  $status = 1,
  $finished = 2,
  $selected_input_value = '',
  $hidelabel = 0,
  $ajaxoptions = array(),
  $socid = 0,
  $showempty = '1',
  $forcecombo = 0,
  $morecss = '',
  $hidepriceinlabel = 0,
  $warehouseStatus = '',
  $selected_combinations = array() 
)

Return list of products for customer in Ajax if Ajax activated or go to select_produits_list.

Parameters
int$selectedPreselected products
string$htmlnameName of HTML select field (must be unique in page)
int$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
int$limitLimit on number of returned lines
int$price_levelLevel of price to show
int$status-1=Return all products, 0=Products not on sell, 1=Products on sell
int$finished2=all, 1=finished, 0=raw material
string$selected_input_valueValue of preselected input text (for use with ajax)
int$hidelabelHide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
array$ajaxoptionsOptions for ajax_autocompleter
int$socidThirdparty Id (to get also price dedicated to this customer)
string$showempty'' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
int$forcecomboForce to use combo box
string$morecssAdd more css on select
int$hidepriceinlabel1=Hide prices in label
string$warehouseStatuswarehouse status filter, following comma separated filter options can be used 'warehouseopen' = select products from open warehouses, 'warehouseclosed' = select products from closed warehouses, 'warehouseinternal' = select products from warehouses for internal correct/transfer only
array$selected_combinationsSelected combinations. Format: array([attrid] => attrval, [...])
Returns
void

Definition at line 1746 of file html.form.class.php.

References ajax_autocompleter(), img_picto(), print, and select_produits_list().

Form::select_produits_fournisseurs (   $socid,
  $selected = '',
  $htmlname = 'productid',
  $filtertype = '',
  $filtre = '',
  $ajaxoptions = array(),
  $hidelabel = 0,
  $alsoproductwithnosupplierprice = 0 
)

Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)

Parameters
int$socidId third party
string$selectedPreselected product
string$htmlnameName of HTML Select
string$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
string$filtreFor a SQL filter
array$ajaxoptionsOptions for ajax_autocompleter
int$hidelabelHide label (0=no, 1=yes)
int$alsoproductwithnosupplierprice1=Add also product without supplier prices
Returns
void

Definition at line 2361 of file html.form.class.php.

References ajax_autocompleter(), print, and select_produits_fournisseurs_list().

Form::select_produits_fournisseurs_list (   $socid,
  $selected = '',
  $htmlname = 'productid',
  $filtertype = '',
  $filtre = '',
  $filterkey = '',
  $statut = -1,
  $outputmode = 0,
  $limit = 100,
  $alsoproductwithnosupplierprice = 0 
)

Return list of suppliers products.

Parameters
int$socidId societe fournisseur (0 pour aucun filtre)
int$selectedProduit pre-selectionne
string$htmlnameNom de la zone select
string$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
string$filtrePour filtre sql
string$filterkeyFiltre des produits
int$statut-1=Return all products, 0=Products not on sell, 1=Products on sell (not used here, a filter on tobuy is already hard coded in request)
int$outputmode0=HTML select string, 1=Array
int$limitLimit of line number
int$alsoproductwithnosupplierprice1=Add also product without supplier prices
Returns
array Array of keys for json

Definition at line 2404 of file html.form.class.php.

References ajax_combobox(), dol_print_error(), dol_strlen(), dol_syslog(), dol_trunc(), price(), Product\TYPE_SERVICE, and vatrate().

Referenced by select_produits_fournisseurs().

Form::select_produits_list (   $selected = '',
  $htmlname = 'productid',
  $filtertype = '',
  $limit = 20,
  $price_level = 0,
  $filterkey = '',
  $status = 1,
  $finished = 2,
  $outputmode = 0,
  $socid = 0,
  $showempty = '1',
  $forcecombo = 0,
  $morecss = '',
  $hidepriceinlabel = 0,
  $warehouseStatus = '' 
)

Return list of products for a customer.

Parameters
int$selectedPreselected product
string$htmlnameName of select html
string$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
int$limitLimit on number of returned lines
int$price_levelLevel of price to show
string$filterkeyFilter on product
int$status-1=Return all products, 0=Products not on sell, 1=Products on sell
int$finishedFilter on finished field: 2=No filter
int$outputmode0=HTML select string, 1=Array
int$socidThirdparty Id (to get also price dedicated to this customer)
string$showempty'' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
int$forcecomboForce to use combo box
string$morecssAdd more css on select
int$hidepriceinlabel1=Hide prices in label
string$warehouseStatuswarehouse status filter, following comma separated filter options can be used 'warehouseopen' = select products from open warehouses, 'warehouseclosed' = select products from closed warehouses, 'warehouseinternal' = select products from warehouses for internal correct/transfer only
Returns
array Array of keys for json

Definition at line 1886 of file html.form.class.php.

References ajax_combobox(), constructProductListOption(), dol_print_error(), dol_syslog(), if, price2num(), Entrepot\STATUS_CLOSED, Entrepot\STATUS_OPEN_ALL, and Entrepot\STATUS_OPEN_INTERNAL.

Referenced by select_produits().

Form::select_remises (   $selected,
  $htmlname,
  $filter,
  $socid,
  $maxvalue = 0 
)

Return HTML combo list of absolute discounts.

Parameters
string$selectedId remise fixe pre-selectionnee
string$htmlnameNom champ formulaire
string$filterCriteres optionnels de filtre
int$socidId of thirdparty
int$maxvalueMax value for lines that can be selected
Returns
int Return number of qualifed lines in list

Definition at line 1203 of file html.form.class.php.

References $resql, dol_print_error(), dol_syslog(), dol_trunc(), price(), and print.

Referenced by form_remise_dispo().

Form::select_thirdparty (   $selected = '',
  $htmlname = 'socid',
  $filter = '',
  $limit = 20,
  $ajaxoptions = array(),
  $forcecombo = 0 
)

Return HTML code to select a company.

Parameters
int$selectedPreselected products
string$htmlnameName of HTML select field (must be unique in page)
int$filterFilter on thirdparty
int$limitLimit on number of returned lines
array$ajaxoptionsOptions for ajax_autocompleter
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
Returns
string Return select box for thirdparty.
Deprecated:
3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0)

Definition at line 975 of file html.form.class.php.

References select_thirdparty_list().

Form::select_thirdparty_list (   $selected = '',
  $htmlname = 'socid',
  $filter = '',
  $showempty = '',
  $showtype = 0,
  $forcecombo = 0,
  $events = array(),
  $filterkey = '',
  $outputmode = 0,
  $limit = 0,
  $morecss = 'minwidth100',
  $moreparam = '' 
)

Output html form to select a third party.

Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.

Parameters
string$selectedPreselected type
string$htmlnameName of field in form
string$filteroptional filters criteras (example: 's.rowid <> x', 's.client in (1,3)')
string$showemptyAdd an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty')
int$showtypeShow third party type in combolist (customer, prospect or supplier)
int$forcecomboForce to use standard HTML select component without beautification
array$eventsEvent options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
string$filterkeyFilter on key value
int$outputmode0=HTML select string, 1=Array
int$limitLimit number of answers
string$morecssAdd more css styles to the SELECT component
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
Returns
string HTML string with

Definition at line 1059 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), and dol_syslog().

Referenced by select_company(), and select_thirdparty().

Form::select_type_fees (   $selected = '',
  $htmlname = 'type',
  $showempty = 0 
)

Return list of types of notes.

Parameters
string$selectedPreselected type
string$htmlnameName of field in form
int$showemptyAdd an empty field
Returns
void

Definition at line 933 of file html.form.class.php.

References dol_syslog(), info_admin(), load_cache_types_fees(), and print.

Form::select_type_of_lines (   $selected = '',
  $htmlname = 'type',
  $showempty = 0,
  $hidetext = 0,
  $forceall = 0 
)

Return list of types of lines (product or service) Example: 0=product, 1=service, 9=other (for external module)

Parameters
string$selectedPreselected type
string$htmlnameName of field in html form
int$showemptyAdd an empty field
int$hidetextDo not show label 'Type' before combo box (used only if there is at least 2 choices to select)
integer$forceall1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service')
Returns
void

Definition at line 834 of file html.form.class.php.

References print.

Form::select_types_paiements (   $selected = '',
  $htmlname = 'paiementtype',
  $filtertype = '',
  $format = 0,
  $empty = 0,
  $noadmininfo = 0,
  $maxlength = 0,
  $active = 1,
  $morecss = '' 
)

Return list of payment methods.

Parameters
string$selectedId du mode de paiement pre-selectionne
string$htmlnameNom de la zone select
string$filtertypeTo filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or 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
int$activeActive or not, -1 = all
string$morecssAdd more CSS on select tag
Returns
void

Definition at line 3100 of file html.form.class.php.

References dol_syslog(), dol_trunc(), if, info_admin(), load_cache_types_paiements(), and print.

Referenced by form_modes_reglement().

Form::select_users (   $selected = '',
  $htmlname = 'userid',
  $show_empty = 0,
  $exclude = null,
  $disabled = 0,
  $include = '',
  $enableonly = '',
  $force_entity = 0 
)

Return select list of users.

Parameters
string$selectedId user preselected
string$htmlnameField name in form
int$show_empty0=liste sans valeur nulle, 1=ajoute valeur inconnue
array$excludeArray list of users id to exclude
int$disabledIf select list must be disabled
array$includeArray list of users id to include
int$enableonlyArray list of users id to be enabled. All other must be disabled
int$force_entity0 or Id of environment to force
Returns
void
Deprecated:
Use select_dolusers instead
See also
select_dolusers()

Definition at line 1436 of file html.form.class.php.

References print, and select_dolusers().

static Form::selectarray (   $htmlname,
  $array,
  $id = '',
  $show_empty = 0,
  $key_in_label = 0,
  $value_as_key = 0,
  $moreparam = '',
  $translate = 0,
  $maxlen = 0,
  $disabled = 0,
  $sort = '',
  $morecss = '',
  $addjscombo = 0,
  $moreparamonempty = '',
  $disablebademail = 0,
  $nohtmlescape = 0 
)
static

Return a HTML select string, built from an array of key+value.

Note: Do not apply langs->trans function on returned content, content may be entity encoded twice.

Parameters
string$htmlnameName of html select area. Must start with "multi" if this is a multiselect
array$arrayArray (key => value)
string|string[]$id Preselected key or preselected keys for multiselect
int | string$show_empty0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
int$key_in_label1 to show key into label with format "[key] value"
int$value_as_key1 to use value as key
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
int$translate1=Translate and encode value
int$maxlenLength maximum for labels
int$disabledHtml select box is disabled
string$sort'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
string$morecssAdd more class to css styles
int$addjscomboAdd js combo
string$moreparamonemptyAdd more param on the empty option line. Not used if show_empty not set
int$disablebademailCheck if an email is found into value and if not disable and colorize entry
int$nohtmlescapeNo html escaping.
Returns
string HTML select string.
See also
multiselectarray

Definition at line 5405 of file html.form.class.php.

Referenced by ActionsCardCommon\assign_values(), editfieldval(), FormCompany\form_prospect_level(), FormMail\get_form(), FormOther\getBoxesArea(), FormAccounting\select_account(), BookKeeping\select_account(), FormAccounting\select_auxaccount(), FormAccounting\select_bookkeeping_importkey(), FormAccounting\select_journal(), FormMailing\selectDestinariesStatus(), FormOrder\selectInputMethod(), dolReceiptPrinter\selectProfilePrinter(), FormOrder\selectSupplierOrderStatus(), FormBank\selectTypeOfBankAccount(), dolReceiptPrinter\selectTypePrinter(), and FormAccounting\selectyear_accountancy_bookkepping().

static Form::selectArrayAjax (   $htmlname,
  $url,
  $id = '',
  $moreparam = '',
  $moreparamtourl = '',
  $disabled = 0,
  $minimumInputLength = 1,
  $morecss = '',
  $callurlonselect = 0,
  $placeholder = '',
  $acceptdelayedhtml = 0 
)
static

Return a HTML select string, built from an array of key+value but content returned into select come from an Ajax call of an URL.

Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice.

Parameters
string$htmlnameName of html select area
string$urlUrl. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...)
string$idPreselected key
string$moreparamAdd more parameters onto the select tag
string$moreparamtourlAdd more parameters onto the Ajax called URL
int$disabledHtml select box is disabled
int$minimumInputLengthMinimum Input Length
string$morecssAdd more class to css styles
int$callurlonselectIf set to 1, some code is added so an url return by the ajax is called when value is selected.
string$placeholderString to use as placeholder
integer$acceptdelayedhtml1 if caller request to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect)
Returns
string HTML select string
See also
ajax_combobox in ajax.lib.php

Definition at line 5515 of file html.form.class.php.

Form::selectAvailabilityDelay (   $selected = '',
  $htmlname = 'availid',
  $filtertype = '',
  $addempty = 0 
)

Retourne la liste des types de delais de livraison possibles.

Parameters
int$selectedId du type de delais pre-selectionne
string$htmlnameNom de la zone select
string$filtertypeTo add a filter
int$addemptyAdd empty entry
Returns
void

Definition at line 2880 of file html.form.class.php.

References dol_syslog(), info_admin(), load_cache_availability(), and print.

Referenced by form_availability().

Form::selectcontacts (   $socid,
  $selected = '',
  $htmlname = 'contactid',
  $showempty = 0,
  $exclude = '',
  $limitto = '',
  $showfunction = 0,
  $moreclass = '',
  $options_only = false,
  $showsoc = 0,
  $forcecombo = 0,
  $events = array(),
  $moreparam = '',
  $htmlid = '' 
)

Return HTML code of the SELECT of list of all contacts (for a third party or all).

This also set the number of contacts found into $this->num

Parameters
int$socidId ot third party or 0 for all
array | int$selectedArray of ID of pre-selected contact id
string$htmlnameName of HTML field ('none' for a not editable field)
int$showempty0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit)
string$excludeList of contacts id to exclude
string$limittoDisable answers that are not id in this array list
integer$showfunctionAdd function into label
string$moreclassAdd more class to class style
bool$options_onlyReturn options only (for ajax treatment)
integer$showsocAdd company into label
int$forcecomboForce to use combo box
array$eventsEvent options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
string$htmlidHtml id to use instead of htmlname
Returns
int <0 if KO, Nb of contact in list if OK

Definition at line 1313 of file html.form.class.php.

References $resql, ajax_combobox(), dol_print_error(), and dol_syslog().

Referenced by select_contacts().

Form::selectCurrency (   $selected = '',
  $htmlname = 'currency_id' 
)

Retourne la liste des devises, dans la langue de l'utilisateur.

Parameters
string$selectedpreselected currency code
string$htmlnamename of HTML select list
Returns
string

Definition at line 4383 of file html.form.class.php.

References ajax_combobox(), and info_admin().

Referenced by select_currency().

Form::selectExpense (   $selected = '',
  $htmlname = 'fk_c_type_fees',
  $useempty = 0,
  $allchoice = 1,
  $useid = 0 
)

Return HTML to show a select of expense.

Parameters
string$selectedpreselected category
string$htmlnamename of HTML select list
integer$useempty1=Add empty choice
integer$allchoice1=Add all choice
integer$useid0=use 'code' as key, 1=use 'id' as key
Returns
string

Definition at line 6829 of file html.form.class.php.

References $resql.

Form::selectExpenseCategories (   $selected = '',
  $htmlname = 'fk_c_exp_tax_cat',
  $useempty = 0,
  $excludeid = array(),
  $target = '',
  $default_selected = 0,
  $params = array() 
)

Return HTML to show the select categories of expense category.

Parameters
string$selectedpreselected category
string$htmlnamename of HTML select list
integer$useempty1=Add empty line
array$excludeidid to exclude
string$targethtmlname of target select to bind event
int$default_selecteddefault category to select if fk_c_type_fees change = EX_KME
array$paramsparam to give
Returns
string

Definition at line 6703 of file html.form.class.php.

References $resql, and dol_print_error().

Form::selectExpenseRanges (   $selected = '',
  $htmlname = 'fk_range',
  $useempty = 0 
)

Return HTML to show the select ranges of expense range.

Parameters
string$selectedpreselected category
string$htmlnamename of HTML select list
integer$useempty1=Add empty line
Returns
string

Definition at line 6792 of file html.form.class.php.

References $resql, dol_print_error(), and price().

Form::selectForForms (   $objectdesc,
  $htmlname,
  $preselectedvalue,
  $showempty = '',
  $searchkey = '',
  $placeholder = '',
  $morecss = '',
  $moreparams = '',
  $forcecombo = 0 
)

Generic method to select a component from a combo list.

This is the generic method that will replace all specific existing methods.

Parameters
string$objectdescObjectclassname:Objectclasspath
string$htmlnameName of HTML select component
int$preselectedvaluePreselected value (ID of element)
string$showempty''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
string$searchkeySearch criteria
string$placeholderPlace holder
string$morecssMore CSS
string$moreparamsMore params provided to ajax call
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
Returns
string Return HTML string
See also
selectForFormsList select_thirdparty

Definition at line 5199 of file html.form.class.php.

Form::selectForFormsList (   $objecttmp,
  $htmlname,
  $preselectedvalue,
  $showempty = '',
  $searchkey = '',
  $placeholder = '',
  $morecss = '',
  $moreparams = '',
  $forcecombo = 0,
  $outputmode = 0 
)

Output html form to select an object.

Note, this function is called by selectForForms or by ajax selectobject.php

Parameters
Object$objecttmpObject
string$htmlnameName of HTML select component
int$preselectedvaluePreselected value (ID of element)
string$showempty''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
string$searchkeySearch value
string$placeholderPlace holder
string$morecssMore CSS
string$moreparamsMore params provided to ajax call
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
int$outputmode0=HTML select string, 1=Array
Returns
string Return HTML string
See also
selectForForms

Definition at line 5269 of file html.form.class.php.

Form::selectInputReason (   $selected = '',
  $htmlname = 'demandreasonid',
  $exclude = '',
  $addempty = 0 
)

Return list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) List found into table c_input_reason loaded by loadCacheInputReason.

Parameters
int$selectedId or code of type origin to select by default
string$htmlnameNom de la zone select
string$excludeTo exclude a code value (Example: SRC_PROP)
int$addemptyAdd an empty entry
Returns
void

Definition at line 2963 of file html.form.class.php.

References info_admin(), loadCacheInputReason(), and print.

Referenced by formInputReason().

Form::selectMassAction (   $selected,
  $arrayofaction,
  $alwaysvisible = 0 
)

Generate select HTML to choose massaction.

Parameters
string$selectedValue auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
int$arrayofactionarray('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
int$alwaysvisible1=select button always visible
Returns
string Select list

Definition at line 555 of file html.form.class.php.

References dol_escape_htmltag().

Form::selectMultiCurrency (   $selected = '',
  $htmlname = 'multicurrency_code',
  $useempty = 0 
)

Return array of currencies in user language.

Parameters
string$selectedpreselected currency code
string$htmlnamename of HTML select list
integer$useempty1=Add empty line
Returns
string

Definition at line 4426 of file html.form.class.php.

References $resql, and ajax_combobox().

Referenced by form_multicurrency_code().

Form::selectPriceBaseType (   $selected = '',
  $htmlname = 'price_base_type' 
)

Selection HT or TTC.

Parameters
string$selectedId pre-selectionne
string$htmlnameNom de la zone select
Returns
string Code of HTML select to chose tax or not

Definition at line 3153 of file html.form.class.php.

Form::selectShippingMethod (   $selected = '',
  $htmlname = 'shipping_method_id',
  $filtre = '',
  $useempty = 0,
  $moreattrib = '' 
)

Return a HTML select list of shipping mode.

Parameters
string$selectedId shipping mode pre-selected
string$htmlnameName of select zone
string$filtreTo filter list
int$useempty1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
string$moreattribTo add more attribute on select
Returns
void

Definition at line 3191 of file html.form.class.php.

References dol_print_error(), dol_syslog(), info_admin(), and print.

Referenced by formSelectShippingMethod().

Form::selectSituationInvoices (   $selected = '',
  $socid = 0 
)

Creates HTML last in cycle situation invoices selector.

Parameters
string$selectedPreselected ID
int$socidCompany ID
Returns
string HTML select

Definition at line 3275 of file html.form.class.php.

References $resql, and dol_syslog().

Form::selectUnits (   $selected = '',
  $htmlname = 'units',
  $showempty = 0 
)

Creates HTML units selector (code => label)

Parameters
string$selectedPreselected Unit ID
string$htmlnameSelect name
int$showemptyAdd a nempty line
Returns
string HTML select

Definition at line 3329 of file html.form.class.php.

References $resql.

Form::selectyesno (   $htmlname,
  $value = '',
  $option = 0,
  $disabled = false,
  $useempty = '' 
)

Return an html string with a select combo box to choose yes or no.

Parameters
string$htmlnameName of html select field
string$valuePre-selected value
int$option0 return yes/no, 1 return 1/0
bool$disabledtrue or false
int$useempty1=Add empty line
Returns
string See option

Definition at line 6128 of file html.form.class.php.

Referenced by formconfirm().

Form::showbarcode ( $object,
  $width = 100 
)

Return HTML code to output a barcode.

Parameters
Object$objectObject containing data to retrieve file name
int$widthWidth of photo
Returns
string HTML code to output barcode

Definition at line 6346 of file html.form.class.php.

Form::showCategories (   $id,
  $type,
  $rendermode = 0 
)

Render list of categories linked to object with id $id and type $type.

Parameters
int$idId of object
string$typeType of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated.
int$rendermode0=Default, use multiselect. 1=Emulate multiselect (recommended)
Returns
string String with categories

Definition at line 5791 of file html.form.class.php.

References img_object(), multiselectarray(), and select_all_categories().

Form::showCheckAddButtons (   $cssclass = 'checkforaction',
  $calljsfunction = 0 
)

Return HTML to show the search and clear seach button.

Parameters
string$cssclassCSS class
int$calljsfunction0=default. 1=call function initCheckForSelect() after changing status of checkboxes
Returns
string

Definition at line 6647 of file html.form.class.php.

Referenced by showFilterAndCheckAddButtons().

Form::showFilterAndCheckAddButtons (   $addcheckuncheckall = 0,
  $cssclass = 'checkforaction',
  $calljsfunction = 0 
)

Return HTML to show the search and clear seach button.

Parameters
int$addcheckuncheckallAdd the check all/uncheck all checkbox (use javascript) and code to manage this
string$cssclassCSS class
int$calljsfunction0=default. 1=call function initCheckForSelect() after changing status of checkboxes
Returns
string

Definition at line 6681 of file html.form.class.php.

References showCheckAddButtons(), and showFilterButtons().

Form::showFilterButtons ( )

Return HTML to show the search and clear seach button.

Returns
string

Definition at line 6628 of file html.form.class.php.

References dol_escape_htmltag().

Referenced by showFilterAndCheckAddButtons().

Form::showLinkedObjectBlock (   $object,
  $morehtmlright = '' 
)

Show linked object block.

Parameters
CommonObject$objectObject we want to show links to
string$morehtmlrightMore html to show on right of title
Returns
int <0 if KO, >=0 if OK

Definition at line 5835 of file html.form.class.php.

References dol_buildpath(), load_fiche_titre(), and print.

Form::showLinkToObjectBlock (   $object,
  $restrictlinksto = array(),
  $excludelinksto = array() 
)

Show block with links to link to other objects.

Parameters
CommonObject$objectObject we want to show links to
array$restrictlinkstoRestrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction.
array$excludelinkstoDo not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion.
Returns
string <0 if KO, >0 if OK

Definition at line 5963 of file html.form.class.php.

References dol_print_error(), getEntity(), price(), and print.

static Form::showphoto (   $modulepart,
  $object,
  $width = 100,
  $height = 0,
  $caneditfield = 0,
  $cssclass = 'photowithmargin',
  $imagesize = '',
  $addlinktofullsize = 1,
  $cache = 0 
)
static

Return HTML code to output a photo.

Parameters
string$modulepartKey to define module concerned ('societe', 'userphoto', 'memberphoto')
object$objectObject containing data to retrieve file name
int$widthWidth of photo
int$heightHeight of photo (auto if 0)
int$caneditfieldAdd edit fields
string$cssclassCSS name to use on img for photo
string$imagesize'mini', 'small' or '' (original)
int$addlinktofullsizeAdd link to fullsize image
int$cache1=Accept to use image in cache
Returns
string HTML code to output photo
See also
https://gravatar.com/site/implement/images/php/

Definition at line 6382 of file html.form.class.php.

References dol_hash(), dol_print_error(), get_exdir(), getAdvancedPreviewUrl(), and getImageFileNameForSize().

Referenced by Adherent\getNomUrl(), Societe\getNomUrl(), User\getNomUrl(), and User\getPhotoUrl().

Form::showrefnav (   $object,
  $paramid,
  $morehtml = '',
  $shownav = 1,
  $fieldid = 'rowid',
  $fieldref = 'ref',
  $morehtmlref = '',
  $moreparam = '',
  $nodbprefix = 0,
  $morehtmlleft = '',
  $morehtmlstatus = '',
  $morehtmlright = '' 
)

Return a HTML area with the reference of object and a navigation bar for a business object Note: To complete search with a particular filter on select, you can set $object->next_prev_filter set to define SQL criterias.

Parameters
object$objectObject to show.
string$paramidName of parameter to use to name the id into the URL next/previous link.
string$morehtmlMore html content to output just before the nav bar.
int$shownavShow Condition (navigation is shown if value is 1).
string$fieldidName of field id into database to use for select next and previous (we make the select max and min on this field compared to $object->ref). Use 'none' to disable next/prev.
string$fieldrefName of field ref of object (object->ref) to show or 'none' to not show ref.
string$morehtmlrefMore html to show after ref.
string$moreparamMore param to add in nav link url. Must start with '&...'.
int$nodbprefixDo not include DB prefix to forge table name.
string$morehtmlleftMore html code to show before ref.
string$morehtmlstatusMore html code to show under navigation arrows (status place).
string$morehtmlrightMore html code to show after ref.
Returns
string Portion HTML with ref + navigation buttons

Definition at line 6227 of file html.form.class.php.

References dol_htmlentities().

Form::textwithpicto (   $text,
  $htmltext,
  $direction = 1,
  $type = 'help',
  $extracss = '',
  $noencodehtmltext = 0,
  $notabs = 2,
  $tooltiptrigger = '',
  $forcenowrap = 0 
)

Show a text with a picto and a tooltip on picto.

Parameters
string$textText to show
string$htmltextContent of tooltip
int$direction1=Icon is after text, -1=Icon is before text, 0=no icon
string$typeType of picto ('info', 'help', 'warning', 'superadmin', 'mypicto', ...) or image filepath
string$extracssAdd a CSS style to td, div or span tag
int$noencodehtmltextDo not encode into html entity the htmltext
int$notabs0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
string$tooltiptrigger''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
int$forcenowrapForce no wrap between text and picto (works with notabs=2 only)
Returns
string HTML code of text, picto, tooltip

Definition at line 504 of file html.form.class.php.

References img_help(), img_picto(), img_warning(), and textwithtooltip().

Form::textwithtooltip (   $text,
  $htmltext,
  $tooltipon = 1,
  $direction = 0,
  $img = '',
  $extracss = '',
  $notabs = 2,
  $incbefore = '',
  $noencodehtmltext = 0,
  $tooltiptrigger = '',
  $forcenowrap = 0 
)

Show a text and picto with tooltip on text or picto.

Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip

Parameters
string$textText to show
string$htmltextHTML content of tooltip. Must be HTML/UTF8 encoded.
int$tooltipon1=tooltip on text, 2=tooltip on image, 3=tooltip sur les 2
int$direction-1=image is before, 0=no image, 1=image is after
string$imgHtml code for image (use img_xxx() function to get it)
string$extracssAdd a CSS style to td tags
int$notabs0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
string$incbeforeInclude code before the text
int$noencodehtmltextDo not encode into html entity the htmltext
string$tooltiptrigger''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
int$forcenowrapForce no wrap between text and picto (works with notabs=2 only)
Returns
string Code html du tooltip (texte+picto)
See also
Use function textwithpicto if you can. TODO Move this as static as soon as everybody use textwithpicto or ::textwithtooltip

Definition at line 419 of file html.form.class.php.

References dol_escape_htmltag(), and if.

Referenced by textwithpicto(), and top_menu().


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