dolibarr 21.0.0-alpha
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.
 
 editfieldkey ($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0, $paramid='id', $help='')
 Output key field for an editable field.
 
 editfieldval ($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=1, $formatfunc='', $paramid='id', $gm='auto', $moreoptions=array(), $editaction='')
 Output value of a field for an editable field.
 
 widgetForTranslation ($fieldname, $object, $perm, $typeofdata='string', $check='', $morecss='')
 Output edit in place form.
 
 textwithtooltip ($text, $htmltext, $tooltipon=1, $direction=0, $img='', $extracss='', $notabs=3, $incbefore='', $noencodehtmltext=0, $tooltiptrigger='', $forcenowrap=0)
 Show a text and picto with tooltip on text or picto.
 
 textwithpicto ($text, $htmltext, $direction=1, $type='help', $extracss='', $noencodehtmltext=0, $notabs=3, $tooltiptrigger='', $forcenowrap=0)
 Show a text with a picto and a tooltip on picto.
 
 selectMassAction ($selected, $arrayofaction, $alwaysvisible=0, $name='massaction', $cssclass='checkforselect')
 Generate select HTML to choose massaction.
 
 select_country ($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0, $addspecialentries=0, $exclude_country_code=array(), $hideflags=0)
 Return combo list of activated countries, into language of user.
 
 select_incoterms ($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array(), $disableautocomplete=0)
 Return select list of incoterms.
 
 select_type_of_lines ($selected='', $htmlname='type', $showempty=0, $hidetext=0, $forceall=0, $morecss="")
 Return list of types of lines (product or service) Example: 0=product, 1=service, 9=other (for external module)
 
 load_cache_types_fees ()
 Load into cache cache_types_fees, array of types of fees.
 
 select_type_fees ($selected='', $htmlname='type', $showempty=0)
 Return list of types of notes.
 
 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(), $multiple=false, $excludeids=array(), $showcode=0)
 Output html form to select a third party This call select_thirdparty_list() or ajax depending on setup.
 
 select_contact ($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $morecss='', $nokeyifsocid=true, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $selected_input_value='', $filter='')
 Output html form to select a contact This call select_contacts() or ajax depending on setup.
 
 select_thirdparty_list ($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false, $excludeids=array(), $showcode=0)
 Output html form to select a third party.
 
 selectcontacts ($socid, $selected=array(), $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $morecss='', $options_only=0, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $multiple=false, $disableifempty=0, $filter='')
 Return HTML code of the SELECT of list of all contacts (for a third party or all).
 
 select_remises ($selected, $htmlname, $filter, $socid, $maxvalue=0)
 Return HTML combo list of absolute discounts.
 
 select_users ($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly=array(), $force_entity='0')
 Return the HTML select list of users.
 
 select_dolusers ($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $notdisabled=0, $outputmode=0, $multiple=false, $forcecombo=0)
 Return select list of users.
 
 select_dolusers_forevent ($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include=array(), $enableonly=array(), $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
 Return select list of users.
 
 select_dolresources_forevent ($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include=array(), $enableonly=array(), $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofresourceid=array())
 Return select list of resources.
 
 select_produits ($selected=0, $htmlname='productid', $filtertype='', $limit=0, $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=null, $nooutput=0, $status_purchase=-1)
 Return list of products for customer.
 
 select_bom ($selected='', $htmlname='bom_id', $limit=0, $status=1, $type=0, $showempty='1', $morecss='', $nooutput='', $forcecombo=0, $TProducts=[])
 Return list of BOM for customer in Ajax if Ajax activated or go to select_produits_list.
 
 select_produits_list ($selected=0, $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $filterkey='', $status=1, $finished=2, $outputmode=0, $socid=0, $showempty='1', $forcecombo=0, $morecss='maxwidth500', $hidepriceinlabel=0, $warehouseStatus='', $status_purchase=-1)
 Return list of products for a customer.
 
 select_produits_fournisseurs ($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0, $morecss='', $placeholder='')
 Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
 
 select_produits_fournisseurs_list ($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $filterkey='', $statut=-1, $outputmode=0, $limit=100, $alsoproductwithnosupplierprice=0, $morecss='', $showstockinlist=0, $placeholder='')
 Return list of suppliers products.
 
 select_product_fourn_price ($productid, $htmlname='productfournpriceid', $selected_supplier=0)
 Return list of suppliers prices for a product.
 
 load_cache_conditions_paiements ()
 
 load_cache_availability ()
 
 selectAvailabilityDelay ($selected='', $htmlname='availid', $filtertype='', $addempty=0, $morecss='')
 Return the list of type of delay available.
 
 loadCacheInputReason ()
 Load into cache cache_demand_reason, array of input reasons.
 
 selectInputReason ($selected='', $htmlname='demandreasonid', $exclude='', $addempty=0, $morecss='', $notooltip=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.
 
 load_cache_types_paiements ()
 
 select_conditions_paiements ($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='', $deposit_percent=-1, $noprint=0)
 print list of payment modes.
 
 getSelectConditionsPaiements ($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='', $deposit_percent=-1)
 Return list of payment modes.
 
 select_types_paiements ($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='', $nooutput=0)
 Return list of payment methods Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
 
 selectPriceBaseType ($selected='', $htmlname='price_base_type', $addjscombo=0)
 Selection HT or TTC.
 
 load_cache_transport_mode ()
 
 selectTransportMode ($selected='', $htmlname='transportmode', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
 
 selectShippingMethod ($selected='', $htmlname='shipping_method_id', $filtre='', $useempty=0, $moreattrib='', $noinfoadmin=0, $morecss='')
 Return a HTML select list of shipping mode.
 
 formSelectShippingMethod ($page, $selected='', $htmlname='shipping_method_id', $addempty=0)
 Display form to select shipping mode.
 
 selectSituationInvoices ($selected='', $socid=0)
 Creates HTML last in cycle situation invoices selector.
 
 selectUnits ($selected='', $htmlname='units', $showempty=0, $unit_type='')
 Creates HTML units selector (code => label)
 
 select_comptes ($selected='', $htmlname='accountid', $status=0, $filtre='', $useempty=0, $moreattrib='', $showcurrency=0, $morecss='', $nooutput=0)
 Return a HTML select list of bank accounts.
 
 selectEstablishments ($selected='', $htmlname='entity', $status=0, $filtre='', $useempty=0, $moreattrib='')
 Return a HTML select list of establishment.
 
 formSelectAccount ($page, $selected='', $htmlname='fk_account', $addempty=0)
 Display form to select bank account.
 
 select_all_categories ($type, $selected='', $htmlname="parent", $maxlength=64, $fromid=0, $outputmode=0, $include=0, $morecss='', $useempty=1)
 Return list of categories having chosen type.
 
 form_confirm ($page, $title, $question, $action, $formquestion=array(), $selectedchoice="", $useajax=0, $height=170, $width=500)
 
 formconfirm ($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=0, $width=500, $disableformtag=0, $labelbuttonyes='Yes', $labelbuttonno='No')
 
 form_project ($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0, $textifnoproject='', $morecss='')
 Show a form to select a project.
 
 form_conditions_reglement ($page, $selected='', $htmlname='cond_reglement_id', $addempty=0, $type='', $filtertype=-1, $deposit_percent=-1, $nooutput=0)
 Show a form to select payment conditions.
 
 form_availability ($page, $selected='', $htmlname='availability', $addempty=0)
 Show a form to select a delivery delay.
 
 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.
 
 form_date ($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0, $type='')
 Show a form + html select a date.
 
 form_users ($page, $selected='', $htmlname='userid', $exclude=array(), $include=array())
 Show a select form to choose a user.
 
 form_modes_reglement ($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1, $addempty=0, $type='', $nooutput=0)
 Show form with payment mode.
 
 formSelectTransportMode ($page, $selected='', $htmlname='transport_mode_id', $active=1, $addempty=0)
 Show form with transport mode.
 
 form_multicurrency_code ($page, $selected='', $htmlname='multicurrency_code')
 Show form with multicurrency code.
 
 form_multicurrency_rate ($page, $rate=0.0, $htmlname='multicurrency_tx', $currency='')
 Show form with multicurrency rate.
 
 form_remise_dispo ($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0)
 Show a select box with available absolute discounts.
 
 form_contacts ($page, $societe, $selected='', $htmlname='contactid')
 Show forms to select a contact.
 
 form_thirdparty ($page, $selected='', $htmlname='socid', $filter='', $showempty=0, $showtype=0, $forcecombo=0, $events=array(), $nooutput=0, $excludeids=array(), $textifnothirdparty='')
 Output html select to select thirdparty.
 
 select_currency ($selected='', $htmlname='currency_id')
 Retourne la liste des devises, dans la langue de l'utilisateur.
 
 selectCurrency ($selected='', $htmlname='currency_id', $mode=0, $useempty='')
 Retourne la liste des devises, dans la langue de l'utilisateur.
 
 selectMultiCurrency ($selected='', $htmlname='multicurrency_code', $useempty=0, $filter='', $excludeConfCurrency=false, $morecss='')
 Return array of currencies in user language.
 
 load_cache_vatrates ($country_code)
 Load into the cache ->cache_vatrates, all the vat rates of a country.
 
 load_tva ($htmlname='tauxtva', $selectedrate='', $societe_vendeuse=null, $societe_acheteuse=null, $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0, $type_vat=0)
 Output an HTML select vat rate.
 
 select_date ($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday=0, $addplusone='', $adddateof='')
 Show a HTML widget to input a date or combo list for day, month, years and optionally hours and minutes.
 
 selectDateToDate ($set_time='', $set_time_end='', $prefix='re', $empty=0, $forcenewline=0)
 Show 2 HTML widget to input a date or combo list for day, month, years and optionally hours and minutes.
 
 selectDate ($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $disabled=0, $fullday='', $addplusone='', $adddateof='', $openinghours='', $stepminutes=1, $labeladddateof='', $placeholder='', $gm='auto')
 Show a HTML widget to input a date or combo list for day, month, years and optionally hours and minutes.
 
 selectTypeDuration ($prefix, $selected='i', $excludetypes=array())
 selectTypeDuration
 
 select_duration ($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
 Function to show a form to select a duration on a page.
 
 selectTickets ($selected='', $htmlname='ticketid', $filtertype='', $limit=0, $status=1, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $selected_combinations=null, $nooutput=0)
 Return list of tickets in Ajax if Ajax activated or go to selectTicketsList.
 
 selectTicketsList ($selected='', $htmlname='ticketid', $filtertype='', $limit=20, $filterkey='', $status=1, $outputmode=0, $showempty='1', $forcecombo=0, $morecss='')
 Return list of tickets.
 
 selectProjects ($selected='', $htmlname='projectid', $filtertype='', $limit=0, $status=1, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $selected_combinations=null, $nooutput=0)
 Return list of projects in Ajax if Ajax activated or go to selectTicketsList.
 
 selectProjectsList ($selected='', $htmlname='projectid', $filtertype='', $limit=20, $filterkey='', $status=1, $outputmode=0, $showempty='1', $forcecombo=0, $morecss='')
 Return list of projects.
 
 selectMembers ($selected='', $htmlname='adherentid', $filtertype='', $limit=0, $status=1, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $selected_combinations=null, $nooutput=0)
 Return list of members in Ajax if Ajax activated or go to selectTicketsList.
 
 selectMembersList ($selected='', $htmlname='adherentid', $filtertype='', $limit=20, $filterkey='', $status=1, $outputmode=0, $showempty='1', $forcecombo=0, $morecss='')
 Return list of adherents.
 
 selectForFormsList ($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0, $disabled=0, $sortfield='', $filter='')
 Output html form to select an object.
 
 showCategories ($id, $type, $rendermode=0, $nolink=0)
 Render list of categories linked to object with id $id and type $type.
 
 showLinkedObjectBlock ($object, $morehtmlright='', $compatibleImportElementsList=array(), $title='RelatedObjects')
 Show linked object block.
 
 showLinkToObjectBlock ($object, $restrictlinksto=array(), $excludelinksto=array())
 Show block with links to link to other objects.
 
 selectyesno ($htmlname, $value='', $option=0, $disabled=false, $useempty=0, $addjscombo=0, $morecss='width75', $labelyes='Yes', $labelno='No')
 Return an html string with a select combo box to choose yes or no.
 
 select_export_model ($selected='', $htmlname='exportmodelid', $type='', $useempty=0)
 Return list of export templates.
 
 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 criteria.
 
 showbarcode (&$object, $width=100, $morecss='')
 Return HTML code to output a barcode.
 
 select_dolgroups ($selected=0, $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly=array(), $force_entity='0', $multiple=false, $morecss='minwidth200')
 Return select list of groups.
 
 showFilterButtons ($pos='')
 Return HTML to show the search and clear search button.
 
 showCheckAddButtons ($cssclass='checkforaction', $calljsfunction=0, $massactionname="massaction")
 Return HTML to show the search and clear search button.
 
 showFilterAndCheckAddButtons ($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0, $massactionname="massaction")
 Return HTML to show the search and clear search button.
 
 selectExpenseCategories ($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array(), $info_admin=1)
 Return HTML to show the select of expense categories.
 
 selectExpenseRanges ($selected='', $htmlname='fk_range', $useempty=0)
 Return HTML to show the select ranges of expense range.
 
 selectExpense ($selected='', $htmlname='fk_c_type_fees', $useempty=0, $allchoice=1, $useid=0)
 Return HTML to show a select of expense.
 
 selectInvoice ($socid=-1, $selected='', $htmlname='invoiceid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null)
 Output a combo list with invoices qualified for a third party.
 
 selectInvoiceRec ($selected='', $htmlname='facrecid', $maxlength=24, $option_only=0, $show_empty='1', $forcefocus=0, $disabled=0, $morecss='maxwidth500')
 Output a combo list with invoices qualified for a third party.
 
 searchComponent ($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput=array(), $search_component_params_hidden='')
 Output the component to make advanced search criteries.
 
 selectModelMail ($prefix, $modelType='', $default=0, $addjscombo=0)
 selectModelMail
 
 buttonsSaveCancel ($save_label='Save', $cancel_label='Cancel', $morebuttons=array(), $withoutdiv=false, $morecss='', $dol_openinpopup='')
 Output the buttons to submit a creation/edit form.
 
 load_cache_invoice_subtype ()
 Load into cache list of invoice subtypes.
 
 getSelectInvoiceSubtype ($selected=0, $htmlname='subtypeid', $addempty=0, $noinfoadmin=0, $morecss='')
 Return list of invoice subtypes.
 

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='minwidth75', $addjscombo=1, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
 Return a HTML select string, built from an array of key+value.
 
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.
 
static selectArrayFilter ($htmlname, $array, $id='', $moreparam='', $disableFiltering=0, $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0, $textfortitle='')
 Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter.
 
static multiselectarray ($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=-1)
 Show a multiselect form from an array.
 
static multiSelectArrayWithCheckbox ($htmlname, &$array, $varpage, $pos='')
 Show a multiselect dropbox from an array.
 
static showphoto ($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='', $noexternsourceoverwrite=0)
 Return HTML code to output a photo.
 

Protected Member Functions

 editInPlace ($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null)
 Output edit in place form.
 
 constructProductListOption (&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel=0, $filterkey='', $novirtualstock=0)
 Function to forge the string with OPTIONs of SELECT.
 
 constructTicketListOption (&$objp, &$opt, &$optJson, $selected, $filterkey='')
 constructTicketListOption.
 
 constructProjectListOption (&$objp, &$opt, &$optJson, $selected, $filterkey='')
 constructProjectListOption.
 
 constructMemberListOption (&$objp, &$opt, &$optJson, $selected, $filterkey='')
 constructMemberListOption.
 

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 55 of file html.form.class.php.

Constructor & Destructor Documentation

◆ __construct()

Form::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Reimplemented in FormAccounting, FormAdvTargetEmailing, FormCron, FormMail, FormProjets, and FormWebPortal.

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

Member Function Documentation

◆ buttonsSaveCancel()

Form::buttonsSaveCancel ( $save_label = 'Save',
$cancel_label = 'Cancel',
$morebuttons = array(),
$withoutdiv = false,
$morecss = '',
$dol_openinpopup = '' )

Output the buttons to submit a creation/edit form.

Parameters
string$save_labelAlternative label for save button
string$cancel_labelAlternative label for cancel button
array<array{addclass?:string,name?:string,label_key?:string}>$morebuttons Add additional buttons between save and cancel
bool$withoutdivOption to remove enclosing centered div
string$morecssMore CSS
string$dol_openinpopupIf the button are shown in a context of a page shown inside a popup, we put here the string name of popup.
Returns
string Html code with the buttons

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

References dol_escape_htmltag(), and getNonce().

◆ constructMemberListOption()

Form::constructMemberListOption ( & $objp,
& $opt,
& $optJson,
$selected,
$filterkey = '' )
protected

constructMemberListOption.

This define value for &$opt and &$optJson.

Parameters
object$objpResult set of fetch
string$optOption (var used for returned value in string option format)
mixed[]$optJsonOption (var used for returned value in json format)
string$selectedPreselected value
string$filterkeyFilter key to highlight
Returns
void

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

◆ constructProductListOption()

Form::constructProductListOption ( & $objp,
& $opt,
& $optJson,
$price_level,
$selected,
$hidepriceinlabel = 0,
$filterkey = '',
$novirtualstock = 0 )
protected

Function to forge the string with OPTIONs of SELECT.

This define value for &$opt and &$optJson. This function is called by select_produits_list().

Parameters
stdClass$objpResultset of fetch
string$optOption (var used for returned value in string option format)
array{key:string,value:string,label:string,label2:string,desc:string,type:string,price_ht:string,price_ttc:string,price_ht_locale:string,price_ttc_locale:string,pricebasetype:string,tva_tx:string,default_vat_code:string,qty:string,discount:string,duration_value:string,duration_unit:string,pbq:string,labeltrans:string,desctrans:string,ref_customer:string}$optJson Option (var used for returned value in json format)
int$price_levelPrice level
int$selectedPreselected value
int<0,1>$hidepriceinlabel Hide price in label
string$filterkeyFilter key to highlight
int<0,1>$novirtualstock Do not load virtual stock, even if slow option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO is on.
Returns
void

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

References dol_escape_htmltag(), dol_print_error(), dol_strlen(), dol_syslog(), dol_trunc(), getCountry(), getDolGlobalInt(), getDolGlobalString(), getEntity(), measuringUnitString(), price(), price2num(), showDimensionInBestUnit(), Product\TYPE_PRODUCT, Product\TYPE_SERVICE, and vatrate().

Referenced by select_produits_list().

◆ constructProjectListOption()

Form::constructProjectListOption ( & $objp,
& $opt,
& $optJson,
$selected,
$filterkey = '' )
protected

constructProjectListOption.

This define value for &$opt and &$optJson.

Parameters
stdClass$objpResult set of fetch
string$optOption (var used for returned value in string option format)
array{key:string,value:string,type:string}$optJson Option (var used for returned value in json format)
string$selectedPreselected value
string$filterkeyFilter key to highlight
Returns
void

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

◆ constructTicketListOption()

Form::constructTicketListOption ( & $objp,
& $opt,
& $optJson,
$selected,
$filterkey = '' )
protected

constructTicketListOption.

This define value for &$opt and &$optJson.

Parameters
object$objpResult set of fetch
string$optOption (var used for returned value in string option format)
mixed[]$optJsonOption (var used for returned value in json format)
string$selectedPreselected value
string$filterkeyFilter key to highlight
Returns
void

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

◆ editfieldkey()

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

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 (on the page we show)
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), 'dayhour' or 'datehourpicker' 'checkbox: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 ' '
string$paramidKey of parameter for id ('id', 'socid')
string$helpTooltip help
Returns
string HTML edit field

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

References $object, getDolGlobalString(), GETPOST(), img_edit(), and textwithpicto().

◆ editfieldval()

Form::editfieldval ( $text,
$htmlname,
$value,
$object,
$perm,
$typeofdata = 'string',
$editvalue = '',
$extObject = null,
$custommsg = null,
$moreparam = '',
$notabletag = 1,
$formatfunc = '',
$paramid = 'id',
$gm = 'auto',
$moreoptions = array(),
$editaction = '' )

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
CommonObject$objectObject (that we want to show)
boolean$permPermission to allow button to edit parameter
string$typeofdataType of data ('string' by default, 'checkbox', 'email', 'phone', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'safehtmlstring', 'restricthtml', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
string$editvalueWhen in edit mode, use this value as $value instead of value (for example, you can provide here a formatted price instead of numeric value, or a select combo). Use '' to use same than $value
?CommonObject$extObjectExternal object ???
mixed$custommsgString or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
string$moreparamMore param to add on the form on action href URL parameter
int$notabletagDo no output table tags
string$formatfuncCall a specific method of $object->$formatfunc to output field in view mode (For example: 'dol_print_email')
string$paramidKey of parameter for id ('id', 'socid')
string$gm'auto' or 'tzuser' or 'tzuserrel' or 'tzserver' (when $typeofdata is a date)
array<string,int>$moreoptions Array with more options. For example array('addnowlink'=>1), array('valuealreadyhtmlescaped'=>1)
string$editaction[=''] use GETPOST default action or set action to edit mode
Returns
string HTML edit field

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

References $object, dol_escape_htmltag(), dol_htmlentitiesbr(), dol_htmlwithnojs(), dol_print_date(), dol_print_email(), dol_print_phone(), dol_print_url(), dol_string_neverthesehtmltags(), dol_string_onlythesehtmltags(), editInPlace(), getDolGlobalString(), GETPOST(), img_picto(), price(), price2num(), selectarray(), and selectDate().

◆ editInPlace()

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

Output edit in place form.

Parameters
CommonObject$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:loadmethod:savemethod:buttononly')
string$editvalueWhen in edit mode, use this value as $value instead of value
?CommonObject$extObjectExternal object
mixed$custommsgString or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
Returns
string HTML edit in place

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

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

Referenced by editfieldval().

◆ form_availability()

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$addemptyAdd an empty entry
Returns
void

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

References load_cache_availability(), and selectAvailabilityDelay().

◆ form_conditions_reglement()

Form::form_conditions_reglement ( $page,
$selected = '',
$htmlname = 'cond_reglement_id',
$addempty = 0,
$type = '',
$filtertype = -1,
$deposit_percent = -1,
$nooutput = 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
string$typeType ('direct-debit' or 'bank-transfer')
int$filtertypeIf > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
int$deposit_percent< 0 : deposit_percent input makes no sense (for example, in list filters) 0 : use default deposit percentage from entry > 0 : force deposit percentage (for example, from company object)
int$nooutputNo print is done. String is returned.
Returns
string HTML output or ''

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

References dol_escape_htmltag(), getSelectConditionsPaiements(), and load_cache_conditions_paiements().

◆ form_confirm()

Form::form_confirm ( $page,
$title,
$question,
$action,
$formquestion = array(),
$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{text:string}|array<array{label:string,type:string,size:string,morecss:string,moreattr:string,style:string}>$formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...'))
string$selectedchoice"" or "no" or "yes"
int | string$useajax0=No, 1=Yes use Ajax to show the popup, 2=Yes and also 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
Returns
void
Deprecated
See also
formconfirm()

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

References dol_syslog(), and formconfirm().

◆ form_contacts()

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

Show forms to select a contact.

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

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

References getDolGlobalString(), and selectcontacts().

◆ form_date()

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

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
string$type'direct-debit' or 'bank-transfer'
Returns
string
See also
selectDate()

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

References dol_escape_htmltag(), dol_print_date(), and selectDate().

◆ form_modes_reglement()

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

Show form with payment mode.

Parameters
string$pagePage
string$selectedId mode pre-selectionne
string$htmlnameName of select html field
string$filtertypeTo filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
int$activeActive or not, -1 = all
int$addempty1=Add empty entry
string$typeType ('direct-debit' or 'bank-transfer')
int$nooutput1=Return string, no output
Returns
string HTML output or ''

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

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

◆ form_multicurrency_code()

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 6207 of file html.form.class.php.

References currency_name(), and selectMultiCurrency().

◆ form_multicurrency_rate()

Form::form_multicurrency_rate ( $page,
$rate = 0.0,
$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 6235 of file html.form.class.php.

References price(), and price2num().

◆ form_project()

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

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)
string$selectedId preselected 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.
string$textifnoprojectText to show if no project
string$morecssMore CSS
Returns
string Return html content

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

◆ form_remise_dispo()

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

Show a select box with available absolute discounts.

Parameters
string$pagePage URL where form is shown
int$selectedValue preselected
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
int$discount_type0 => customer discount, 1 => supplier discount
Returns
void

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

References dol_escape_htmltag(), getDolGlobalString(), price(), and select_remises().

◆ form_thirdparty()

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

Output html select to select thirdparty.

Parameters
string$pagePage
string$selectedId preselected
string$htmlnameName of HTML select
string$filterOptional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here (example: 's.rowid <> x', 's.client IN (1,3)'). Do not use a filter coming from input of users.
string|int<0,1>$showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
int<0,1>$showtype Show third party type in combolist (customer, prospect or supplier)
int<0,1>$forcecombo Force to use combo box
array<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
int$nooutputNo print output. Return it only.
int[]$excludeidsExclude IDs from the select combo
string$textifnothirdpartyText to show if no thirdparty
Returns
string HTML output or ''

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

References select_company().

◆ form_users()

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

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.
int[]$excludeList of users id to exclude
int[]$includeList of users id to include
Returns
void

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

References select_dolusers().

◆ formconfirm()

Form::formconfirm ( $page,
$title,
$question,
$action,
$formquestion = '',
$selectedchoice = '',
$useajax = 0,
$height = 0,
$width = 500,
$disableformtag = 0,
$labelbuttonyes = 'Yes',
$labelbuttonno = 'No' )
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 nonce="'.getNonce().'" 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 parameters (param 'action' and 'confirm' will be reformatted)
string$titleTitle
string$questionQuestion
string$actionAction
array<array{name:string,value:string,values:string[],default:string,label:string,type:string,size:string,morecss:string,moreattr:string,style:string,inputko?:int<0,1>}>|string|null$formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...')) 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss', 'other', 'onecolumn' or 'hidden'...
int<0,1>|''|'no'|'yes'|'1'|'0'$selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0
int<0,2>|string$useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
int | string$heightForce height of box (0 = auto)
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.
string$labelbuttonyesLabel for Yes
string$labelbuttonnoLabel for No
Returns
string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form

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

References dol_escape_htmltag(), dol_escape_js(), getNonce(), img_help(), img_picto(), multiselectarray(), selectarray(), selectDate(), and selectyesno().

Referenced by form_confirm().

◆ formInputReason()

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 6007 of file html.form.class.php.

References loadCacheInputReason(), and selectInputReason().

◆ formSelectAccount()

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

Display form to select bank account.

Parameters
string$pagePage
string$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 5254 of file html.form.class.php.

References img_picto(), and select_comptes().

◆ formSelectShippingMethod()

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

Display form to select shipping mode.

Parameters
string$pagePage
string$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 4960 of file html.form.class.php.

References selectShippingMethod().

◆ formSelectTransportMode()

Form::formSelectTransportMode ( $page,
$selected = '',
$htmlname = 'transport_mode_id',
$active = 1,
$addempty = 0 )

Show form with transport mode.

Parameters
string$pagePage
string$selectedId mode pre-select
string$htmlnameName of select html field
int$activeActive or not, -1 = all
int$addempty1=Add empty entry
Returns
void

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

References load_cache_transport_mode(), and selectTransportMode().

◆ getSelectConditionsPaiements()

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

Return list of payment modes.

Constant MAIN_DEFAULT_PAYMENT_TERM_ID can be 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$filtertypeIf > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
int$addemptyAdd an empty entry
int$noinfoadmin0=Add admin info, 1=Disable admin info
string$morecssAdd more CSS on select tag
int$deposit_percent< 0 : deposit_percent input makes no sense (for example, in list filters) 0 : use default deposit percentage from entry > 0 : force deposit percentage (for example, from company object)
Returns
string String for the HTML select component

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

References ajax_combobox(), dol_syslog(), getDolGlobalString(), getNonce(), info_admin(), and load_cache_conditions_paiements().

Referenced by form_conditions_reglement(), and select_conditions_paiements().

◆ getSelectInvoiceSubtype()

Form::getSelectInvoiceSubtype ( $selected = 0,
$htmlname = 'subtypeid',
$addempty = 0,
$noinfoadmin = 0,
$morecss = '' )

Return list of invoice subtypes.

Parameters
int$selectedId of invoice subtype to preselect by default
string$htmlnameSelect field name
int<0,1>$addempty Add an empty entry
int<0,1>$noinfoadmin 0=Add admin info, 1=Disable admin info
string$morecssAdd more CSS on select tag
Returns
string String for the HTML select component

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

References ajax_combobox(), dol_syslog(), and info_admin().

◆ load_cache_availability()

Form::load_cache_availability ( )
 Load int a cache property th elist of possible delivery delays.
Returns
int Nb of lines loaded, <0 if KO

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

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

Referenced by form_availability(), and selectAvailabilityDelay().

◆ load_cache_conditions_paiements()

Form::load_cache_conditions_paiements ( )
 Load into cache list of payment terms
Returns
int Nb of lines loaded, <0 if KO

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

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

Referenced by form_conditions_reglement(), and getSelectConditionsPaiements().

◆ load_cache_invoice_subtype()

Form::load_cache_invoice_subtype ( )

Load into cache list of invoice subtypes.

Returns
int Nb of lines loaded, <0 if KO

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

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

◆ load_cache_transport_mode()

Form::load_cache_transport_mode ( )
 Load in cache list of transport mode
Returns
int Nb of lines loaded, <0 if KO

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

References dol_print_error(), dol_sort_array(), dol_syslog(), and getEntity().

Referenced by formSelectTransportMode(), and selectTransportMode().

◆ load_cache_types_fees()

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 1224 of file html.form.class.php.

References dol_print_error(), and dol_syslog().

Referenced by select_type_fees().

◆ load_cache_types_paiements()

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 4455 of file html.form.class.php.

References dol_print_error(), dol_sort_array(), dol_syslog(), and getEntity().

Referenced by form_modes_reglement(), and select_types_paiements().

◆ load_cache_vatrates()

Form::load_cache_vatrates ( $country_code)

Load into the cache ->cache_vatrates, all the 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 6603 of file html.form.class.php.

References dol_getIdFromCode(), and dol_syslog().

Referenced by load_tva().

◆ load_tva()

Form::load_tva ( $htmlname = 'tauxtva',
$selectedrate = '',
$societe_vendeuse = null,
$societe_acheteuse = null,
$idprod = 0,
$info_bits = 0,
$type = '',
$options_only = false,
$mode = 0,
$type_vat = 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) If seller not subject to VAT, default VAT=0. End of rule. If (seller country==buyer country), then default VAT=product's VAT. End of rule. If (seller and buyer in EU) and sold product = new means of transportation (car, boat, airplane), default VAT =0 (VAT must be paid by the buyer to his country's tax office and not the seller). End of rule. If (seller and buyer in EU) and buyer=private person, then default VAT=VAT of sold product. End of rule. If (seller and buyer in EU) and buyer=company then default VAT =0. End of rule. Else, default proposed VAT==0. End of rule.
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
int$type_vat0=All type, 1=VAT rate sale, 2=VAT rate purchase
Returns
string

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

References dol_escape_htmltag(), dol_strlen(), get_default_npr(), get_default_tva(), getDolGlobalString(), isInEEC(), load_cache_vatrates(), Product\TYPE_SERVICE, and vatrate().

◆ loadCacheInputReason()

Form::loadCacheInputReason ( )

Load into cache cache_demand_reason, array of input reasons.

Returns
int Nb of lines loaded, <0 if KO

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

References dol_print_error(), and dol_sort_array().

Referenced by formInputReason(), and selectInputReason().

◆ multiselectarray()

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

Show a multiselect form from an array.

WARNING: Use this only for short lists.

Parameters
string$htmlnameName of select
array<string,string|array{id:string,label:string,color:string,picto:string,labelhtml:string}>$array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> ))
string[]$selectedArray of keys preselected
int<0,1>$key_in_label 1 to show key like in "[key] value"
int<0,1>$value_as_key 1 to use value as key
string$morecssAdd more css style
int<0,1>$translate Translate and encode value
int | string$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', ...). Will execute a formatting function on it. To use in readonly mode if js component support HTML formatting.
string$placeholderString to use as placeholder
int<-1,1>$addjscombo Add js combo
Returns
string HTML multiselect string
See also
selectarray(), selectArrayAjax(), selectArrayFilter()

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

References dol_escape_htmltag(), dol_escape_js(), dol_htmlentitiesbr(), getDolGlobalString(), getNonce(), and img_picto().

Referenced by formconfirm(), FormCategory\getFilterBox(), FormAccounting\multi_select_journal(), FormOrder\selectOrderStatus(), FormProjets\selectProjectsStatus(), FormOrder\selectSupplierOrderStatus(), showCategories(), and FormCompany\showRoles().

◆ multiSelectArrayWithCheckbox()

static Form::multiSelectArrayWithCheckbox ( $htmlname,
& $array,
$varpage,
$pos = '' )
static

Show a multiselect dropbox from an array.

If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default.

Parameters
string$htmlnameName of HTML field
array<string,array{label:string,checked:string,enabled?:string,type?:string,langfile?:string}>$array Array 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);
string$posPosition colon on liste value 'left' or '' (meaning 'right').
Returns
string HTML multiselect string
See also
selectarray()

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

◆ searchComponent()

Form::searchComponent ( $arrayofcriterias,
$search_component_params,
$arrayofinputfieldsalreadyoutput = array(),
$search_component_params_hidden = '' )

Output the component to make advanced search criteries.

Parameters
array<array<string,array{type:string}>>$arrayofcriterias Array of available search criteria. Example: array($object->element => $object->fields, 'otherfamily' => otherarrayoffields, ...)
array<int,string>$search_component_params Array of selected search criteria
string[]$arrayofinputfieldsalreadyoutputArray of input fields already inform. The component will not generate a hidden input field if it is in this list.
string$search_component_params_hiddenString with $search_component_params criteria
Returns
string HTML component for advanced search

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

References dol_escape_htmltag(), dolForgeExplodeAnd(), forgeSQLFromUniversalSearchCriteria(), and removeGlobalParenthesis().

◆ select_all_categories()

Form::select_all_categories ( $type,
$selected = '',
$htmlname = "parent",
$maxlength = 64,
$fromid = 0,
$outputmode = 0,
$include = 0,
$morecss = '',
$useempty = 1 )

Return list of categories having chosen 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). Not used if $outputmode = 1.
string$htmlnameHTML field name
int$maxlengthMaximum length for labels
int | string | array$fromidKeep only or Exclude (depending on $include parameter) all categories (including the leaf $fromid) into the tree after this id $fromid. $fromid can be an :
  • int (id of category)
  • string (categories ids separated by comma)
    • array (list of categories ids)
      Parameters
      int<0,3>$outputmode 0=HTML select string, 1=Array with full label only, 2=Array extended, 3=Array with full picto + label
      int<0,1>$include [=0] Removed or 1=Keep only
      string$morecssMore CSS
      int<0,2>$useempty 0=No empty value, 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. Default is 1.
      Returns
      string|array<int,string>|array<int,array{id:int,fulllabel:string,color:string,picto:string}>|array<int,array{rowid:int,id:int,fk_parent:int,label:string,description:string,color:string,position:string,visible:int,ref_ext:string,picto:string,fullpath:string,fulllabel:string}> String list or Array of categories
      See also
      select_categories()

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

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

Referenced by FormCategory\getFilterBox(), and showCategories().

◆ select_bom()

Form::select_bom ( $selected = '',
$htmlname = 'bom_id',
$limit = 0,
$status = 1,
$type = 0,
$showempty = '1',
$morecss = '',
$nooutput = '',
$forcecombo = 0,
$TProducts = [] )

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

Parameters
string$selectedPreselected BOM id
string$htmlnameName of HTML select field (must be unique in page).
int$limitLimit on number of returned lines
int$statusSell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM
int$typetype of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM)
string|int<0,1>$showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
string$morecssAdd more css on select
string$nooutputNo print, return the output into a string
int$forcecomboForce to use combo box
string[]$TProductsAdd filter on a defined product
Returns
void|string

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

References ajax_combobox(), dol_print_error(), getDolGlobalInt(), and getEntity().

◆ select_company()

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(),
$multiple = false,
$excludeids = array(),
$showcode = 0 )

Output html form to select a third party This call select_thirdparty_list() or ajax depending on setup.

This component is not able to support multiple select.

Parameters
int | string$selectedPreselected ID
string$htmlnameName of field in form
string$filterOptional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here. Example: ((s.client:IN:1,3) AND (s.status:=:1)). Do not use a filter coming from input of users.
string|int<1,1>$showempty Add 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<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events Ajax 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<0,3>$hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
array<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
bool$multipleadd [] in the name of element and add 'multiple' attribute (not working with ajax_autocompleter)
string[]$excludeidsExclude IDs from the select combo
int<0,1>$showcode Show code
Returns
string HTML string with select box for thirdparty.

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

References ajax_autocompleter(), ajax_event(), dol_escape_htmltag(), getDolGlobalString(), img_picto(), and select_thirdparty_list().

Referenced by form_thirdparty().

◆ select_comptes()

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

Return a HTML select list of bank accounts.

Parameters
int | string$selectedId account preselected
string$htmlnameName of select zone
int$statusStatus of searched accounts (0=open, 1=closed, 2=both)
string$filtreTo filter the list. This parameter must not come from input of users
int | string$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
string$morecssMore CSS
int$nooutput1=Return string, do not send to output
Returns
int|string If noouput=0: Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...), If nooutput=1: Return a HTML select string.

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

References ajax_combobox(), dol_print_error(), dol_syslog(), and getEntity().

Referenced by formSelectAccount().

◆ select_conditions_paiements()

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

print list of payment modes.

Constant MAIN_DEFAULT_PAYMENT_TERM_ID can be 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$filtertypeIf > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
int$addemptyAdd an empty entry
int$noinfoadmin0=Add admin info, 1=Disable admin info
string$morecssAdd more CSS on select tag
int$deposit_percent< 0 : deposit_percent input makes no sense (for example, in list filters) 0 : use default deposit percentage from entry > 0 : force deposit percentage (for example, from company object)
int$noprintif set to one we return the html to print, if 0 (default) we print it
Returns
void|string
Deprecated
Use getSelectConditionsPaiements() instead and handle noprint locally.

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

References getSelectConditionsPaiements().

◆ select_contact()

Form::select_contact ( $socid,
$selected = '',
$htmlname = 'contactid',
$showempty = 0,
$exclude = '',
$limitto = '',
$showfunction = 0,
$morecss = '',
$nokeyifsocid = true,
$showsoc = 0,
$forcecombo = 0,
$events = array(),
$moreparam = '',
$htmlid = '',
$selected_input_value = '',
$filter = '' )

Output html form to select a contact This call select_contacts() or ajax depending on setup.

This component is not able to support multiple select.

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 of third party or 0 for all or -1 for empty list
int | string$selectedID of preselected contact id
string$htmlnameName of HTML field ('none' for a not editable field)
int<0,3>|string$showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list
string$excludeList of contacts id to exclude
string$limittoNot used
integer$showfunctionAdd function into label
string$morecssAdd more class to class style
bool$nokeyifsocidWhen 1, we force the option "Press a key to show list" to 0 if there is a value for $socid
integer$showsocAdd company into label
int$forcecombo1=Force to use combo box (so no ajax beautify effect)
array<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events Event 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
string$selected_input_valueValue of preselected input text (for use with ajax)
string$filterOptional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>()] are allowed here. Example: ((s.client:IN:1,3) AND (s.status:=:1)). Do not use a filter coming from input of users.
Returns
int|string Return integer <0 if KO, HTML with select string if OK.

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

References ajax_autocompleter(), ajax_event(), dol_escape_htmltag(), getDolGlobalString(), and selectcontacts().

◆ select_country()

Form::select_country ( $selected = '',
$htmlname = 'country_id',
$htmloption = '',
$maxlength = 0,
$morecss = 'minwidth300',
$usecodeaskey = '',
$showempty = 1,
$disablefavorites = 0,
$addspecialentries = 0,
$exclude_country_code = array(),
$hideflags = 0 )

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$htmloptionMore html options on select object
integer$maxlengthMax length for labels (0=no limit)
string$morecssMore css class
string$usecodeaskey''=Use id as key (default), 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key
int<0,1>|string$showempty Show empty choice
int<0,1>$disablefavorites 1=Disable favorites,
int<0,1>$addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...)
string[]$exclude_country_codeArray of country code (iso2) to exclude
int<0,1>$hideflags Hide flags
Returns
string HTML string with select

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

References ajax_combobox(), dol_escape_htmltag(), dol_print_error(), dol_sort_array(), dol_string_unaccent(), dol_syslog(), dol_trunc(), and picto_from_langcode().

◆ select_currency()

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
Deprecated
Returns
void

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

References selectCurrency().

◆ select_date()

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

Show a HTML widget to input a date or combo list for day, month, years and optionally 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
integer | string$set_timePre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
string$prefixPrefix for fields name
int$h1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty
int$m1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty
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.
int | string$adddateofAdd a link "Date of invoice" using the following date.
Returns
string '' or HTML component string if nooutput is 1
Deprecated
See also
selectDate(), form_date(), select_month(), select_year(), select_dayofweek()

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

References dol_syslog(), and selectDate().

◆ select_dolgroups()

Form::select_dolgroups ( $selected = 0,
$htmlname = 'groupid',
$show_empty = 0,
$exclude = '',
$disabled = 0,
$include = '',
$enableonly = array(),
$force_entity = '0',
$multiple = false,
$morecss = 'minwidth200' )

Return select list of groups.

Parameters
int | object | object[]$selectedId group or group(s) preselected
string$htmlnameField name in form
int<0,1>$show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
string | int[]$excludeArray list of groups id to exclude
int<0,1>$disabled If select list must be disabled
string | int[]$includeArray list of groups id to include
int[]$enableonlyArray list of groups id to be enabled. All other must be disabled
string$force_entity'0' or Ids of environment to force
bool$multipleadd [] in the name of element and add 'multiple' attribute (not working with ajax_autocompleter)
string$morecssMore css to add to html component
Returns
string HTML Componont to select a group
See also
select_dolusers()

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

References ajax_combobox(), dol_print_error(), dol_syslog(), and getDolGlobalInt().

◆ select_dolresources_forevent()

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

Return select list of resources.

Selected resources are stored into session. List of resources are provided into $_SESSION['assignedtoresource'].

Parameters
string$actionValue for $action
string$htmlnameField name in form
int$show_empty0=list without the empty value, 1=add empty value
int[]$excludeArray list of users id to exclude
int<0,1>$disabled If select list must be disabled
int[] | string$includeArray list of users id to include or 'hierarchy' to have only supervised users
int[]$enableonlyArray list of users id to be enabled. All other must be disabled
string$force_entity'0' or Ids of environment to force
int$maxlengthMaximum length of string into list (0=no limit)
int<-1,1>$showstatus 0=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<int,array{transparency:bool|int<0,1>}>$listofresourceid Array with properties of each resource
Returns
string HTML select string

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

References dol_escape_htmltag(), getNonce(), and img_picto().

◆ select_dolusers()

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

Return select list of users.

Parameters
string | int | User$selectedUser id or user object of user preselected. If 0 or < -2, we use id of current user. If -1 or '', keep unselected (if empty is allowed)
string$htmlnameField name in form
int<0,1>|string$show_empty 0=list with no empty value, 1=add also an empty value into list
int[] | null$excludeArray list of users id to exclude
int$disabledIf select list must be disabled
int[] | string$includeArray list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
array | string$enableonlyArray list of users id to be enabled. If defined, it means that others will be disabled
string$force_entity'0' or list of Ids of environment to force, separated by a coma, or 'default' = do no extend to all entities allowed to superadmin.
int$maxlengthMaximum length of string into list (0=no limit)
int<-1,1>$showstatus 0=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 (Example: 'employee = 1'). This value must not come from user input.
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<0,1>$notdisabled Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
int<0,2>$outputmode 0=HTML select string, 1=Array, 2=Detailed array
bool$multipleadd [] in the name of element and add 'multiple' attribute
int<0,1>$forcecombo Force the component to be a simple combo box without ajax
Returns
string|array<int,string|array{id:int,label:string,labelhtml:string,color:string,picto:string}> HTML select string
See also
select_dolgroups()

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

References ajax_combobox(), dol_escape_htmltag(), dol_print_error(), dol_syslog(), getDolGlobalInt(), getDolGlobalString(), and getEntity().

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

◆ select_dolusers_forevent()

Form::select_dolusers_forevent ( $action = '',
$htmlname = 'userid',
$show_empty = 0,
$exclude = null,
$disabled = 0,
$include = array(),
$enableonly = array(),
$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<0,1>$show_empty 0=list without the empty value, 1=add empty value
int[]$excludeArray list of users id to exclude
int<0,1>$disabled If select list must be disabled
int[] | string$includeArray list of users id to include or 'hierarchy' to have only supervised users
int[] | int$enableonlyArray list of users id to be enabled. All other must be disabled
string$force_entity'0' or Ids of environment to force
int$maxlengthMaximum length of string into list (0=no limit)
int<0,1>$showstatus 0=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
int[]$listofuseridArray with properties of each user
int[]$listofcontactidArray with properties of each contact
int[]$listofotheridArray with properties of each other contact
Returns
string HTML select string
See also
select_dolgroups()

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

References dol_escape_htmltag(), getNonce(), img_picto(), and select_dolusers().

◆ select_duration()

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 | string$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 HTML component

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

◆ select_export_model()

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 9798 of file html.form.class.php.

References dol_print_error().

◆ select_incoterms()

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

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<0,1>$forcecombo Force to load all values and output a standard combobox (with no beautification)
array<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events 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<0,1>$disableautocomplete Disable autocomplete
Returns
string HTML string with select and input

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

References ajax_combobox(), ajax_multiautocompleter(), dol_print_error(), and dol_syslog().

◆ select_product_fourn_price()

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

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
string

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

References dol_print_error(), dol_syslog(), getDolGlobalString(), getEntity(), and price().

◆ select_produits()

Form::select_produits ( $selected = 0,
$htmlname = 'productid',
$filtertype = '',
$limit = 0,
$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 = null,
$nooutput = 0,
$status_purchase = -1 )

Return list of products for customer.

Use 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 | string$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
int$limitLimit on number of returned lines
int$price_levelLevel of price to show
int$statusSell status: -1=No filter on sell status, 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<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
int$socidThirdparty Id (to get also price dedicated to this customer)
string|int<0,1>$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<0,1>$hidepriceinlabel 1=Hide prices in label
string$warehouseStatusWarehouse status filter to count the quantity in stock. Following comma separated filter options can be used 'warehouseopen' = count products from open warehouses, 'warehouseclosed' = count products from closed warehouses, 'warehouseinternal' = count products from warehouses for internal correct/transfer only
?mixed[]$selected_combinationsSelected combinations. Format: array([attrid] => attrval, [...])
int<0,1>$nooutput No print if 1, return the output into a string
int<-1,1>$status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase
Returns
void|string

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

References ajax_autocompleter(), getDolGlobalString(), getNonce(), img_picto(), and select_produits_list().

◆ select_produits_fournisseurs()

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

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<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
int<0,1>$hidelabel Hide label (0=no, 1=yes)
int<0,1>$alsoproductwithnosupplierprice 1=Add also product without supplier prices
string$morecssMore CSS
string$placeholderPlaceholder
Returns
void

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

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

◆ select_produits_fournisseurs_list()

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

Return list of suppliers products.

Parameters
int$socidId of supplier thirdparty (0 = no filter)
string$selectedProduct price preselected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD')
string$htmlnameName of HTML select
string$filtertypeFilter on product type (''=nofilter, 0=product, 1=service)
string$filtreGeneric filter. Data must not come from user input.
string$filterkeyFilter of produdts
int$statut-1=Return all products, 0=Products not on buy, 1=Products on buy
int$outputmode0=HTML select string, 1=Array
int$limitLimit of line number
int$alsoproductwithnosupplierprice1=Add also product without supplier prices
string$morecssAdd more CSS
int$showstockinlistShow stock information (slower).
string$placeholderPlaceholder
Returns
array|string Array of keys for json or HTML component

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

References ajax_combobox(), dol_escape_htmltag(), dol_print_error(), dol_strlen(), dol_syslog(), dol_trunc(), getDolGlobalInt(), getDolGlobalString(), getEntity(), img_object(), measuringUnitString(), price(), price2num(), showDimensionInBestUnit(), Product\TYPE_PRODUCT, Product\TYPE_SERVICE, and vatrate().

Referenced by select_produits_fournisseurs().

◆ select_produits_list()

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

Return list of products for a customer.

Called by select_produits.

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|int<0,1>$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 to group/count stock. Following comma separated filter options can be used. 'warehouseopen' = count products from open warehouses, 'warehouseclosed' = count products from closed warehouses, 'warehouseinternal' = count products from warehouses for internal correct/transfer only
int$status_purchasePurchase status -1=Return all products, 0=Products not on purchase, 1=Products on purchase
Returns
array|string Array of keys for json

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

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

Referenced by select_produits().

◆ select_remises()

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

Return HTML combo list of absolute discounts.

Parameters
string$selectedId Fixed reduction preselected
string$htmlnameName of the form field
string$filterOptional filter critreria
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 2018 of file html.form.class.php.

References ajax_combobox(), dol_print_error(), dol_syslog(), dol_trunc(), getDolGlobalString(), and price().

Referenced by form_remise_dispo().

◆ 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 = '',
$multiple = false,
$excludeids = array(),
$showcode = 0 )

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. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>] are allowed here, example: 's.rowid <> x' If you need parenthesis, use the Universal Filter Syntax, example: '(s.client:in:1,3)' Do not use a filter coming from input of users.
string|int<0,1>$showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty')
int<0,1>$showtype Show third party type in combolist (customer, prospect or supplier)
int$forcecomboForce to use standard HTML select component without beautification
array<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events Event 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<0,1>$outputmode 0=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
bool$multipleadd [] in the name of element and add 'multiple' attribute
string[]$excludeidsExclude IDs from the select combo
int<0,1>$showcode Show code in list
Returns
array<int,array{key:int,value:string,label:string,labelhtml:string}>|string HTML string with
See also
select_company()

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

References ajax_combobox(), dol_escape_htmltag(), dol_print_error(), dol_syslog(), forgeSQLFromUniversalSearchCriteria(), getDolGlobalInt(), getDolGlobalString(), getEntity(), and testSqlAndScriptInject().

Referenced by select_company().

◆ select_type_fees()

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 1275 of file html.form.class.php.

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

◆ select_type_of_lines()

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

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<0,1>|string$showempty Add 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, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service')
string$morecssMore css
Returns
void

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

References ajax_combobox(), and getDolGlobalString().

◆ select_types_paiements()

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

Return list of payment methods Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.

Parameters
string$selectedId or code or preselected payment mode
string$htmlnameName of select field
string$filtertypeTo filter on field type in llx_c_paiement ('CRDT' or 'DBIT' or array('code'=>xx,'label'=>zz))
int$format0=id+label, 1=code+code, 2=code+label, 3=id+code
int$empty1=can be empty, 0 otherwise
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
int$nooutput1=Return string, do not send to output
Returns
string|void String for the HTML select component

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

References ajax_combobox(), dol_syslog(), dol_trunc(), getDolGlobalString(), info_admin(), and load_cache_types_paiements().

Referenced by form_modes_reglement().

◆ select_users()

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

Return the HTML select list of users.

Parameters
string$selectedId user preselected
string$htmlnameField name in form
int<0,1>$show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
int[]$excludeArray list of users id to exclude
int<0,1>$disabled If select list must be disabled
int[] | string$includeArray list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
int[] | int$enableonlyArray list of users id to be enabled. All other must be disabled
string$force_entity'0' or Ids of environment to force
Returns
void
Deprecated
Use select_dolusers instead
See also
select_dolusers()

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

References select_dolusers().

◆ selectarray()

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 = 'minwidth75',
$addjscombo = 1,
$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. Try to start name with "multi" or "search_multi" if this is a multiselect
array{label:string,data-html:string,disable?:int<0,1>,css?:string}$array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
string | string[]$idPreselected key or array of preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record.
int<0,1>|string$show_empty 0 no empty value allowed, 1 or string to add an empty value into list (If 1: key is -1 and value is '' or ' ', If placeholder string: key is -1 and value is the string), <0 to add an empty value with key that is this value.
int<0,1>$key_in_label 1 to show key into label with format "[key] value"
int<0,1>$value_as_key 1 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<0,1>$translate 1=Translate and encode value
int$maxlenLength maximum for labels
int<0,1>$disabled Html 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$disablebademail1=Check if a not valid email, 2=Check string '—', and if found into value, disable and colorize entry
int$nohtmlescapeNo html escaping (not recommended, use 'data-html' if you need to use label with HTML content).
Returns
string HTML select string.
See also
multiselectarray(), selectArrayAjax(), selectArrayFilter()

Reimplemented in FormWebPortal.

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

Referenced by ActionsCardCommon\assign_values(), editfieldval(), FormCompany\form_prospect_level(), formconfirm(), FormCompany\formProspectContactLevel(), FormCompany\formThirdpartyType(), FormMail\get_form(), Ticket\printSelectStatus(), BookKeeping\select_account(), FormAccounting\select_account(), FormAccounting\select_auxaccount(), FormAccounting\select_bookkeeping_importkey(), FormAccounting\select_journal(), FormMailing\selectDestinariesStatus(), FormOrder\selectInputMethod(), dolReceiptPrinter\selectProfilePrinter(), FormBank\selectTypeOfBankAccount(), dolReceiptPrinter\selectTypePrinter(), and FormAccounting\selectyear_accountancy_bookkepping().

◆ selectArrayAjax()

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 = caller is requesting 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
selectArrayFilter(), ajax_combobox() in ajax.lib.php

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

◆ selectArrayFilter()

static Form::selectArrayFilter ( $htmlname,
$array,
$id = '',
$moreparam = '',
$disableFiltering = 0,
$disabled = 0,
$minimumInputLength = 1,
$morecss = '',
$callurlonselect = 0,
$placeholder = '',
$acceptdelayedhtml = 0,
$textfortitle = '' )
static

Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter.

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
array<string,array{text:string,url:string}>$array Array (key=>array('text'=>'A text', 'url'=>'An url'), ...)
string$idPreselected key
string$moreparamAdd more parameters onto the select tag
int<0,1>$disableFiltering If set to 1, results are not filtered with searched string
int<0,1>$disabled Html select box is disabled
int$minimumInputLengthMinimum Input Length
string$morecssAdd more class to css styles
int<0,1>$callurlonselect If 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
int<0,1>$acceptdelayedhtml 1 = caller is requesting 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)
string$textfortitleText to show on title.
Returns
string HTML select string
See also
selectArrayAjax(), ajax_combobox() in ajax.lib.php

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

References dol_escape_js().

◆ selectAvailabilityDelay()

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

Return the list of type of delay available.

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

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

References ajax_combobox(), dol_escape_htmltag(), dol_syslog(), info_admin(), and load_cache_availability().

Referenced by form_availability().

◆ selectcontacts()

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

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 Note: you must use the select_contact() to get the component to select a contact. This function must only be called by select_contact.

Parameters
int$socidId of third party or 0 for all or -1 for empty list
array | int | string$selectedArray of ID of preselected contact id
string$htmlnameName of HTML field ('none' for a not editable field)
int<0,3>|string$showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list
string$excludeList of contacts id to exclude
string$limittoDisable answers that are not id in this array list
integer$showfunctionAdd function into label
string$morecssAdd more class to class style
int$options_only1=Return options only (for ajax treatment), 2=Return array
integer$showsocAdd company into label
int$forcecomboForce to use combo box (so no ajax beautify effect)
array<array{method:string,url:string,htmlname:string,params:array<string,string>}>$events Event 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
bool$multipleadd [] in the name of element and add 'multiple' attribute
integer$disableifemptySet tag 'disabled' on select if there is no choice
string$filterOptional filters criteras. WARNING: To avoid SQL injection, only few chars [.a-z0-9 =<>] are allowed here, example: 's.rowid <> x' If you need parenthesis, use the Universal Filter Syntax, example: '(s.client:in:1,3)' Do not use a filter coming from input of users.
Returns
int|string|array<int,array{key:int,value:string,label:string,labelhtml:string}> Return integer <0 if KO, HTML with select string if OK.

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

References ajax_combobox(), dol_print_error(), dol_syslog(), forgeSQLFromUniversalSearchCriteria(), getDolGlobalInt(), getDolGlobalString(), getEntity(), and testSqlAndScriptInject().

Referenced by form_contacts(), and select_contact().

◆ selectCurrency()

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

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

Parameters
string$selectedpreselected currency code
string$htmlnamename of HTML select list
int$mode0 = Add currency symbol into label, 1 = Add 3 letter iso code
string$useempty'1'=Allow empty value
Returns
string

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

References ajax_combobox(), dol_escape_htmltag(), and info_admin().

Referenced by select_currency().

◆ selectDate()

Form::selectDate ( $set_time = '',
$prefix = 're',
$h = 0,
$m = 0,
$empty = 0,
$form_name = "",
$d = 1,
$addnowlink = 0,
$disabled = 0,
$fullday = '',
$addplusone = '',
$adddateof = '',
$openinghours = '',
$stepminutes = 1,
$labeladddateof = '',
$placeholder = '',
$gm = 'auto' )

Show a HTML widget to input a date or combo list for day, month, years and optionally 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
integer | string$set_timePre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
string$prefixPrefix for fields name
int$h1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 or 4 (4=hours on a new line)=Show hour always empty
int$m1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty
int$empty0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
string$form_nameNot used
int<0,1>$d 1=Show days, month, years
int<0,2>$addnowlink Add a link "Now", 1 with server time, 2 with local computer time
int<0,1>$disabled Disable input fields
int | string$fulldayWhen a checkbox with id #fullday is checked, hours are set with 00:00 (if value if 'fulldaystart') or 23:59 (if value is 'fulldayend')
string$addplusoneAdd a link "+1 hour". Value must be name of another selectDate field.
int | string | array$adddateofAdd a link "Date of ..." using the following date. Must be array(array('adddateof'=>..., 'labeladddateof'=>...))
string$openinghoursSpecify hour start and hour end for the select ex 8,20
int$stepminutesSpecify step for minutes between 1 and 30
string$labeladddateofLabel to use for the $adddateof parameter. Deprecated. Used only when $adddateof is not an array.
string$placeholderPlaceholder
mixed$gm'auto' (for backward compatibility, avoid this), 'gmt' or 'tzserver' or 'tzuserrel'
Returns
string Html for selectDate
See also
form_date(), select_month(), select_year(), select_dayofweek()

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

References button, disabled, dol_escape_js(), dol_now(), dol_print_date(), getDolGlobalString(), and getServerTimeZoneInt().

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

◆ selectDateToDate()

Form::selectDateToDate ( $set_time = '',
$set_time_end = '',
$prefix = 're',
$empty = 0,
$forcenewline = 0 )

Show 2 HTML widget to input a date or combo list for day, month, years and optionally 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
integer | string$set_timePre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
integer | string$set_time_endPre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date with 00:00 hour (Parameter 'empty' must be 0 or 2).
string$prefixPrefix for fields name
int$empty0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
int$forcenewlineForce new line between the 2 dates.
Returns
string Html for selectDate
See also
form_date(), select_month(), select_year(), select_dayofweek()

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

References selectDate().

◆ selectEstablishments()

Form::selectEstablishments ( $selected = '',
$htmlname = 'entity',
$status = 0,
$filtre = '',
$useempty = 0,
$moreattrib = '' )

Return a HTML select list of establishment.

Parameters
string$selectedId establishment preselected
string$htmlnameName of select zone
int$statusStatus of searched establishment (0=open, 1=closed, 2=both)
string$filtreTo filter list. This parameter must not come from input of users
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
int Return integer <0 if error, Num of establishment found if OK (0, 1, 2, ...)

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

References dol_print_error(), and dol_syslog().

◆ selectExpense()

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 10617 of file html.form.class.php.

◆ selectExpenseCategories()

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

Return HTML to show the select of expense categories.

Parameters
string$selectedpreselected category
string$htmlnamename of HTML select list
int<0,1>$useempty 1=Add empty line
int[]$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<string,int|string>$params param to give
int<0,1>$info_admin Show the tooltip help picto to setup list
Returns
string

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

References ajax_combobox(), currentToken(), getEntity(), getNonce(), and info_admin().

◆ selectExpenseRanges()

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 10581 of file html.form.class.php.

◆ selectForFormsList()

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

Output html form to select an object.

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

Parameters
Object$objecttmpObject to know the table to scan for combo.
string$htmlnameName of HTML select component
int$preselectedvaluePreselected value (ID of element)
string|int<0,1>$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
int$disabled1=Html component is disabled
string$sortfieldSort field
string$filterAdd more filter (Universal Search Filter)
Returns
string|array Return HTML string
See also
selectForForms()

Reimplemented in FormWebPortal.

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

◆ selectInputReason()

Form::selectInputReason ( $selected = '',
$htmlname = 'demandreasonid',
$exclude = '',
$addempty = 0,
$morecss = '',
$notooltip = 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
string$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
string$morecssAdd more css to the HTML select component
int$notooltipDo not show the tooltip for admin
Returns
void

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

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

Referenced by formInputReason().

◆ selectInvoice()

Form::selectInvoice ( $socid = -1,
$selected = '',
$htmlname = 'invoiceid',
$maxlength = 24,
$option_only = 0,
$show_empty = '1',
$discard_closed = 0,
$forcefocus = 0,
$disabled = 0,
$morecss = 'maxwidth500',
$projectsListId = '',
$showproject = 'all',
$usertofilter = null )

Output a combo list with invoices qualified for a third party.

Parameters
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)
string$selectedId invoice preselected
string$htmlnameName of HTML select
int$maxlengthMaximum length of label
int$option_onlyReturn only html options lines without the select tag
string$show_emptyAdd an empty line ('1' or string to show for empty line)
int$discard_closedDiscard closed projects (0=Keep,1=hide completely,2=Disable)
int$forcefocusForce focus on field (works with javascript only)
int$disabledDisabled
string$morecssMore css added to the select component
string$projectsListId''=Automatic filter on project allowed. List of id=Filter on project ids.
string$showproject'all' = Show project info, ''=Hide project info
User$usertofilterUser object to use for filtering
Returns
string HTML Select Invoice

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

◆ selectInvoiceRec()

Form::selectInvoiceRec ( $selected = '',
$htmlname = 'facrecid',
$maxlength = 24,
$option_only = 0,
$show_empty = '1',
$forcefocus = 0,
$disabled = 0,
$morecss = 'maxwidth500' )

Output a combo list with invoices qualified for a third party.

Parameters
string$selectedId invoice preselected
string$htmlnameName of HTML select
int$maxlengthMaximum length of label
int$option_onlyReturn only html options lines without the select tag
string$show_emptyAdd an empty line ('1' or string to show for empty line)
int$forcefocusForce focus on field (works with javascript only)
int$disabledDisabled
string$morecssMore css added to the select component
Returns
int Nbr of project if OK, <0 if KO

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

References ajax_combobox(), dol_syslog(), dol_trunc(), and getEntity().

◆ selectMassAction()

Form::selectMassAction ( $selected,
$arrayofaction,
$alwaysvisible = 0,
$name = 'massaction',
$cssclass = 'checkforselect' )

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.
array<string,string>$arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
int$alwaysvisible1=select button always visible
string$nameName for massaction
string$cssclassCSS class used to check for select
Returns
string|void Select list

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

References ajax_combobox(), dol_escape_htmltag(), and getNonce().

◆ selectMembers()

Form::selectMembers ( $selected = '',
$htmlname = 'adherentid',
$filtertype = '',
$limit = 0,
$status = 1,
$selected_input_value = '',
$hidelabel = 0,
$ajaxoptions = array(),
$socid = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '',
$selected_combinations = null,
$nooutput = 0 )

Return list of members in Ajax if Ajax activated or go to selectTicketsList.

Parameters
string$selectedPreselected tickets
string$htmlnameName of HTML select field (must be unique in page).
string$filtertypeTo add a filter
int$limitLimit on number of returned lines
int$statusTicket status
string$selected_input_valueValue of preselected input text (for use with ajax)
int<0,3>$hidelabel Hide label (0=no, 1=yes, 2=show search icon before and placeholder, 3 search icon after)
array<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
int$socidThirdparty Id (to get also price dedicated to this customer)
string|int<0,1>$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
array<string,string>$selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
int<0,1>$nooutput No print, return the output into a string
Returns
string

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

◆ selectMembersList()

Form::selectMembersList ( $selected = '',
$htmlname = 'adherentid',
$filtertype = '',
$limit = 20,
$filterkey = '',
$status = 1,
$outputmode = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '' )

Return list of adherents.

Called by selectMembers.

Parameters
string$selectedPreselected adherent
string$htmlnameName of select html
string$filtertypeFilter on adherent type
int$limitLimit on number of returned lines
string$filterkeyFilter on member status
int$statusMember status
int$outputmode0=HTML select string, 1=Array
string|int<0,1>$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
Returns
array|string Array of keys for json or HTML string component

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

◆ selectModelMail()

Form::selectModelMail ( $prefix,
$modelType = '',
$default = 0,
$addjscombo = 0 )

selectModelMail

Parameters
string$prefixPrefix
string$modelTypeModel type
int<0,1>$default 1=Show also Default mail template
int<0,1>$addjscombo Add js combobox
Returns
string HTML select string

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

References ajax_combobox().

◆ selectMultiCurrency()

Form::selectMultiCurrency ( $selected = '',
$htmlname = 'multicurrency_code',
$useempty = 0,
$filter = '',
$excludeConfCurrency = false,
$morecss = '' )

Return array of currencies in user language.

Parameters
string$selectedPreselected currency code
string$htmlnameName of HTML select list
integer$useempty1=Add empty line
string$filterOptional filters criteras (example: 'code <> x', ' in (1,3)')
bool$excludeConfCurrencyfalse = If company current currency not in table, we add it into list. Should always be available. true = we are in currency_rate update , we don't want to see conf->currency in select
string$morecssMore css
Returns
string HTML component

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

References ajax_combobox(), and getEntity().

Referenced by form_multicurrency_code().

◆ selectPriceBaseType()

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

Selection HT or TTC.

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

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

References ajax_combobox().

◆ selectProjects()

Form::selectProjects ( $selected = '',
$htmlname = 'projectid',
$filtertype = '',
$limit = 0,
$status = 1,
$selected_input_value = '',
$hidelabel = 0,
$ajaxoptions = array(),
$socid = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '',
$selected_combinations = null,
$nooutput = 0 )

Return list of projects in Ajax if Ajax activated or go to selectTicketsList.

Parameters
string$selectedPreselected tickets
string$htmlnameName of HTML select field (must be unique in page).
string$filtertypeTo add a filter
int$limitLimit on number of returned lines
int$statusTicket status
string$selected_input_valueValue of preselected input text (for use with ajax)
int<0,3>$hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
array<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
int$socidThirdparty Id (to get also price dedicated to this customer)
string|int<0,1>$showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
int<0,1>$forcecombo Force to use combo box
string$morecssAdd more css on select
array<string,string>$selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
int<0,1>$nooutput No print, return the output into a string
Returns
string

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

◆ selectProjectsList()

Form::selectProjectsList ( $selected = '',
$htmlname = 'projectid',
$filtertype = '',
$limit = 20,
$filterkey = '',
$status = 1,
$outputmode = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '' )

Return list of projects.

Called by selectProjects.

Parameters
string$selectedPreselected project
string$htmlnameName of select html
string$filtertypeFilter on project type
int$limitLimit on number of returned lines
string$filterkeyFilter on project ref or subject
int$statusTicket status
int$outputmode0=HTML select string, 1=Array
string|int<0,1>$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
Returns
array|string Array of keys for json or HTML component

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

◆ selectShippingMethod()

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

Return a HTML select list of shipping mode.

Parameters
string$selectedId shipping mode preselected
string$htmlnameName of select zone
string$filtreTo filter list. This parameter must not come from input of users
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$noinfoadmin0=Add admin info, 1=Disable admin info
string$morecssMore CSS
Returns
void

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

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

Referenced by formSelectShippingMethod().

◆ selectSituationInvoices()

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 4991 of file html.form.class.php.

References dol_syslog(), and getEntity().

◆ selectTickets()

Form::selectTickets ( $selected = '',
$htmlname = 'ticketid',
$filtertype = '',
$limit = 0,
$status = 1,
$selected_input_value = '',
$hidelabel = 0,
$ajaxoptions = array(),
$socid = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '',
$selected_combinations = null,
$nooutput = 0 )

Return list of tickets in Ajax if Ajax activated or go to selectTicketsList.

Parameters
string$selectedPreselected tickets
string$htmlnameName of HTML select field (must be unique in page).
string$filtertypeTo add a filter
int$limitLimit on number of returned lines
int$statusTicket status
string$selected_input_valueValue of preselected input text (for use with ajax)
int<0,3>$hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
array<string,string|string[]>$ajaxoptions Options for ajax_autocompleter
int$socidThirdparty Id (to get also price dedicated to this customer)
string|int<0,1>$showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text.
int<0,1>$forcecombo Force to use combo box
string$morecssAdd more css on select
array<string,string>$selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
int<0,1>$nooutput No print, return the output into a string
Returns
string

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

◆ selectTicketsList()

Form::selectTicketsList ( $selected = '',
$htmlname = 'ticketid',
$filtertype = '',
$limit = 20,
$filterkey = '',
$status = 1,
$outputmode = 0,
$showempty = '1',
$forcecombo = 0,
$morecss = '' )

Return list of tickets.

Called by selectTickets.

Parameters
string$selectedPreselected ticket
string$htmlnameName of select html
string$filtertypeFilter on ticket type
int$limitLimit on number of returned lines
string$filterkeyFilter on ticket ref or subject
int$statusTicket status
int$outputmode0=HTML select string, 1=Array
string|int<0,1>$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
Returns
array|string Array of keys for json or HTML component

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

◆ selectTransportMode()

Form::selectTransportMode ( $selected = '',
$htmlname = 'transportmode',
$format = 0,
$empty = 1,
$noadmininfo = 0,
$maxlength = 0,
$active = 1,
$morecss = '' )
 Return list of transport mode for intracomm report
Parameters
string$selectedId of the transport mode preselected
string$htmlnameName of the select field
int$format0=id+label, 1=code+code, 2=code+label, 3=id+code
int$empty1=can be empty, 0 else
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 4831 of file html.form.class.php.

References dol_syslog(), dol_trunc(), info_admin(), and load_cache_transport_mode().

Referenced by formSelectTransportMode().

◆ selectTypeDuration()

Form::selectTypeDuration ( $prefix,
$selected = 'i',
$excludetypes = array() )

selectTypeDuration

Parameters
string$prefixPrefix
string$selectedSelected duration type
string[]$excludetypesArray of duration types to exclude. Example array('y', 'm')
Returns
string HTML select string

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

◆ selectUnits()

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

Creates HTML units selector (code => label)

Parameters
string$selectedPreselected Unit ID
string$htmlnameSelect name
int<0,1>$showempty Add an empty line
string$unit_typeRestrict to one given unit type
Returns
string HTML select

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

◆ selectyesno()

Form::selectyesno ( $htmlname,
$value = '',
$option = 0,
$disabled = false,
$useempty = 0,
$addjscombo = 0,
$morecss = 'width75',
$labelyes = 'Yes',
$labelno = 'No' )

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
int$addjscombo1=Add js beautifier on combo box
string$morecssMore CSS
string$labelyesLabel for Yes
string$labelnoLabel for No
Returns
string See option

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

References ajax_combobox().

Referenced by formconfirm().

◆ showbarcode()

Form::showbarcode ( & $object,
$width = 100,
$morecss = '' )

Return HTML code to output a barcode.

Parameters
CommonObject$objectObject containing data to retrieve file name
int$widthWidth of photo
string$morecssMore CSS on img of barcode
Returns
string HTML code to output barcode

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

References $object.

◆ showCategories()

Form::showCategories ( $id,
$type,
$rendermode = 0,
$nolink = 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<0,1>$rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended)
int<0,1>$nolink 1=Do not add html links
Returns
string String with categories

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

References multiselectarray(), and select_all_categories().

◆ showCheckAddButtons()

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

Return HTML to show the search and clear search button.

Parameters
string$cssclassCSS class
int$calljsfunction0=default. 1=call function initCheckForSelect() after changing status of checkboxes
string$massactionnameMass action button name that will launch an action on the selected items
Returns
string

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

References getNonce().

Referenced by showFilterAndCheckAddButtons().

◆ showFilterAndCheckAddButtons()

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

Return HTML to show the search and clear search 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
string$massactionnameMass action name
Returns
string

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

References showCheckAddButtons(), and showFilterButtons().

◆ showFilterButtons()

Form::showFilterButtons ( $pos = '')

Return HTML to show the search and clear search button.

Parameters
string$posPosition of colon on the list. Value 'left' or 'right'
Returns
string

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

Referenced by showFilterAndCheckAddButtons().

◆ showLinkedObjectBlock()

Form::showLinkedObjectBlock ( $object,
$morehtmlright = '',
$compatibleImportElementsList = array(),
$title = 'RelatedObjects' )

Show linked object block.

Parameters
CommonObject$objectObject we want to show links to
string$morehtmlrightMore html to show on right of title
array<int,string>$compatibleImportElementsList Array of compatibles elements object for "import from" action
string$titleTitle
Returns
int Return Number of different types

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

References $object, dol_buildpath(), getDolGlobalInt(), and load_fiche_titre().

◆ showLinkToObjectBlock()

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
string[]$restrictlinkstoRestrict links to some elements, for example array('order') or array('supplier_order'). null or array() if no restriction.
string[]$excludelinkstoDo not show links of this type, for example array('order') or array('supplier_order'). null or array() if no exclusion.
Returns
string HTML block

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

References $object, dol_escape_htmltag(), dol_print_error(), getDolGlobalString(), getEntity(), getNonce(), GETPOST(), and price().

◆ showphoto()

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

Return HTML code to output a photo.

Parameters
string$modulepartKey to define module concerned ('societe', 'userphoto', 'memberphoto')
Societe | Adherent | Contact | User | CommonObject$objectObject containing data to retrieve file name
int$widthWidth of photo
int$heightHeight of photo (auto if 0)
int<0,1>$caneditfield Add edit fields
string$cssclassCSS name to use on img for photo
string$imagesize'mini', 'small' or '' (original)
int<0,1>$addlinktofullsize Add link to fullsize image
int<0,1>$cache 1=Accept to use image in cache
string$forcecapture'', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''.
int<0,1>$noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module)
Returns
string HTML code to output photo
See also
getImagePublicURLOfObject()

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

References $object, dol_hash(), dolIsAllowedForPreview(), get_exdir(), getAdvancedPreviewUrl(), getDolGlobalString(), getImageFileNameForSize(), getMaxFileSizeArray(), and img_picto().

Referenced by Adherent\getKanbanView(), Contact\getKanbanView(), User\getKanbanView(), User\getLoginUrl(), Adherent\getNomUrl(), Contact\getNomUrl(), User\getNomUrl(), WebPortalMember\getNomUrl(), User\getPhotoUrl(), Adherent\getTooltipContentArray(), Contact\getTooltipContentArray(), Societe\getTooltipContentArray(), User\getTooltipContentArray(), and top_menu_user().

◆ showrefnav()

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 criteria.

Parameters
CommonObject$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<0,1>$shownav Show 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<0,1>$nodbprefix Do 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 9849 of file html.form.class.php.

References $object, dol_htmlentities(), getDolGlobalInt(), getDolGlobalString(), picto_from_langcode(), and textwithpicto().

◆ textwithpicto()

Form::textwithpicto ( $text,
$htmltext,
$direction = 1,
$type = 'help',
$extracss = '',
$noencodehtmltext = 0,
$notabs = 3,
$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', 'infoclickable', 'help', 'helpclickable', 'warning', 'superadmin', 'mypicto@mymodule', ...) or image filepath or 'none'
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 and hidden on smartphone, 'abconsmartphone'=Tooltip on hover and on click on smartphone, 'abc'=Tooltip on click (abc is a unique key, clickable link is on image or on link if param $type='none' or on both if $type='xxxclickable')
int$forcenowrapForce no wrap between text and picto (works with notabs=2 only)
Returns
string HTML code of text, picto, tooltip

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

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

Referenced by editfieldkey(), and showrefnav().

◆ textwithtooltip()

Form::textwithtooltip ( $text,
$htmltext,
$tooltipon = 1,
$direction = 0,
$img = '',
$extracss = '',
$notabs = 3,
$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 on both
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
textwithpicto() Use textwithpicto() instead of textwithtooltip if you can.

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

References dol_escape_htmltag().

Referenced by textwithpicto().

◆ widgetForTranslation()

Form::widgetForTranslation ( $fieldname,
$object,
$perm,
$typeofdata = 'string',
$check = '',
$morecss = '' )

Output edit in place form.

Parameters
string$fieldnameName of the field
CommonObject$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$checkSame coe than $check parameter of GETPOST()
string$morecssMore CSS
Returns
string HTML code for the edit of alternative language

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

References $object, getDolGlobalString(), getNonce(), GETPOST(), img_picto(), and picto_from_langcode().


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