dolibarr 23.0.3
FormWebPortal Class Reference

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

Inheritance diagram for FormWebPortal:
Collaboration diagram for FormWebPortal:

Public Member Functions

 __construct ($db)
 Constructor.
 
 inputDate ($name, $value='', $placeholder='', $id='', $morecss='', $moreparam='')
 Input for date.
 
 getDocumentsLink ($modulepart, $modulesubdir, $filedir, $filter='', $morecss='', $allfiles=0)
 Show a Document icon with link(s) You may want to call this into a div like this: print '.
 
 getSignatureLink ($modulepart, $object, $morecss='')
 Show a Signature icon with link You may want to call this into a div like this: print '.
 
 selectForForms ($objectdesc, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $disabled=0, $selected_input_value='', $objectfield='')
 Generic method to select a component from a combo list.
 
 showInputFieldForObject ($object, $val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='')
 Return HTML string to put an input field into a page Code very similar with showInputField for common object.
 
 inputType ($type, $name, $value='', $id='', $morecss='', $moreparam='', $label='', $addInputLabel='')
 Html for input with label.
 
 inputSelectAjax ($htmlName, $array, $id, $ajaxUrl, $ajaxData=[], $morecss='minwidth75', $moreparam='')
 Html for select with get options by AJAX.
 
 inputHtml ($htmlName, $value, $morecss='', $moreparam='')
 Html for HTML area.
 
 inputText ($htmlName, $value, $morecss='', $moreparam='', $options=array())
 Html for HTML area.
 
 inputRadio ($htmlName, $options, $selectedValue, $morecss='', $moreparam='')
 Html for input radio.
 
 inputStars ($htmlName, $size, $value, $morecss='', $moreparam='')
 Html for input stars.
 
 inputIcon ($htmlName, $value, $morecss='', $moreparam='')
 Html for input icon.
 
 inputGeoPoint ($htmlName, $value, $type='')
 Html for input geo point.
 
 outputMultiValues ($values)
 Html for show selected multiple values.
 
 outputStars ($size, $value)
 Html for show stars.
 
 outputIcon ($value)
 Html for show icon.
 
 outputGeoPoint ($value, $type)
 Html for show geo point.
 
 getNomUrl (&$object, $withpicto=0, $option='', $maxlength=0, $save_lastsearch_value=-1, $notooltip=0, $morecss='', $add_label=0, $sep=' - ')
 Return link of object.
 
 printFieldCell ($key, $label, $value, $params=array())
 Return HTML code of the cell.
 
 selectCurrency ($selected='', $htmlname='currency_id', $mode=0, $useempty='')
 Retourne la liste des devises, dans la langue de l'utilisateur.
 
- Public Member Functions inherited from Form
 getDurationTypes (Translate $langs, $plurial=true, $reverse=false)
 Return an array of Duration Types.
 
 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, $htmltooltip, $direction=1, $type='help', $extracss='valignmiddle', $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_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="", $useajaxcombo=1)
 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='', $showalso=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(), $canremoveowner=1)
 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, $warehouseId=0)
 Return list of products.
 
 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, $warehouseId=0)
 Return list of products for a customer.
 
 select_produits_fournisseurs ($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0, $morecss='', $placeholder='', $nooutput=0)
 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_rule_for_lines_dates ()
 Loads into a cache property the list of possible rules for line dates.
 
 load_cache_availability ()
 Load int a cache property the list of possible delivery delays.
 
 selectAvailabilityDelay ($selected='', $htmlname='availid', $filtertype='', $addempty=0, $morecss='')
 Return the list of type of delay available.
 
 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.
 
 getSelectRuleForLinesDates ($selected='', $htmlname='rule_for_lines_dates', $addempty=0)
 Returns select with rule for lines dates.
 
 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='')
 Return list of transport mode for intracomm report.
 
 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, $addentrynone=0)
 Return a HTML select list of bank accounts.
 
 selectRib ($selected='', $htmlname='ribcompanyid', $filtre='', $useempty=0, $moreattrib='', $showibanbic=0, $morecss='', $nooutput=0)
 Return a HTML select list of bank accounts customer.
 
 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.
 
 formRib ($page, $selected='', $htmlname='ribcompanyid', $filtre='', $addempty=0, $showibanbic=0)
 Display form to select bank customer account.
 
 selectCategories ($categtype, $htmlname, $object=null)
 Return HTML component to select a category.
 
 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')
 Show a confirmation HTML form or AJAX popup.
 
 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_rule_for_lines_dates ($page, $selected='', $htmlname='rule_for_lines_dates', $addempty=0, $nooutput=0)
 Form select for rule for lines dates.
 
 form_availability ($page, $selected='', $htmlname='availability', $addempty=0)
 Show a form to select a delivery delay.
 
 formInputReason ($page, $selected='', $htmlname='demandreason', $addempty=0, $morecss='')
 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.
 
 selectMultiCurrency ($selected='', $htmlname='multicurrency_code', $useempty=0, $filter='', $excludeConfCurrency=false, $morecss='maxwidth200 widthcentpercentminusx')
 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', $calendarpicto='')
 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(), $morecss='minwidth75 maxwidth100')
 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, $excludeids=array())
 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='', $excludeids=array())
 Return list of adherents.
 
 selectForFormsList ($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0, $disabled=0, $sortfield='', $filter='', $sortorder='ASC')
 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(), $nooutput=0)
 Show block with links "to link to" other objects.
 
 selectyesno ($htmlname, $value='', $option=0, $disabled=false, $useempty=0, $addjscombo=0, $morecss='yesno 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 user 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.
 
 selectExpenseFees ($selected='', $htmlname='fk_c_type_fees', $useempty=0, $allchoice=1, $useid=0)
 Return HTML to show a select of expense.
 
 selectInvoiceForTimeProject ($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 for a project.
 
 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 TODO Bad method.
 
 searchComponent ($arrayofcriterias, $search_component_params, $arrayofinputfieldsalreadyoutput=array(), $search_component_params_hidden='', $arrayoffiltercriterias=array())
 Output the component to make advanced search criteria.
 
 selectModelMail ($prefix, $modelType='', $default=0, $addjscombo=0, $selected=0, $morecss='')
 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.
 
 getSearchFilterToolInput ($dataTarget, $htmlName='search-tools-input', $value='', $params=[])
 

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 showphoto ($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='', $noexternsourceoverwrite=0, $usesharelinkifavailable=0)
 Return HTML code to output a photo.
 
static convertAllLink ($html, $additionalViewImageParams='', $additionalDocumentParams='')
 Convert all link of the provided html output.
 
- Static Public Member Functions inherited from Form
static radio ($htmlName, $radioItems, $selected='', $moreGlobalParams=[])
 Generates a set of HTML radio inputs from an array of key-value items.
 
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='', $nu='', $placeholder='', $addjscombo=-1)
 Show a multiselect form from an array.
 
static multiSelectArrayWithCheckbox ($htmlname, &$array, $varpage, $pos='')
 Show a multiselect dropbox from an array.
 

Additional Inherited Members

- Protected Member Functions inherited from Form
 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 for WebPortal must be here.

Definition at line 35 of file html.formwebportal.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormWebPortal::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Reimplemented from Form.

Definition at line 53 of file html.formwebportal.class.php.

Member Function Documentation

◆ convertAllLink()

static FormWebPortal::convertAllLink ( $html,
$additionalViewImageParams = '',
$additionalDocumentParams = '' )
static

Convert all link of the provided html output.

Parameters
string$htmlHtml output
string$additionalViewImageParamsAdditional parameters for viewimage link
string$additionalDocumentParamsAdditional parameters for document link
Returns
string Html output with all link converted

Definition at line 1666 of file html.formwebportal.class.php.

References $context, dol_escape_js(), and Context\getInstance().

◆ getDocumentsLink()

FormWebPortal::getDocumentsLink ( $modulepart,
$modulesubdir,
$filedir,
$filter = '',
$morecss = '',
$allfiles = 0 )

Show a Document icon with link(s) You may want to call this into a div like this: print '.

'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'

';

Parameters
string$modulepart'propal', 'facture', 'facture_fourn', ...
string$modulesubdirSub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
string$filedirFull path to directory to scan
string$filterFilter filenames on this regex string (Example: '.pdf$')
string$morecssAdd more css to the download picto
int<0,1>$allfiles 0=Only generated docs, 1=All files
Returns
string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles

Definition at line 225 of file html.formwebportal.class.php.

References $context, dol_dir_list(), dol_mimetype(), get_exdir(), getDolGlobalString(), Context\getInstance(), img_mime(), and isModEnabled().

◆ getNomUrl()

FormWebPortal::getNomUrl ( & $object,
$withpicto = 0,
$option = '',
$maxlength = 0,
$save_lastsearch_value = -1,
$notooltip = 0,
$morecss = '',
$add_label = 0,
$sep = ' - ' )

Return link of object.

Parameters
CommonObject$objectObject handler
int$withpictoAdd picto into link
string$optionWhere point the link ('stock', 'composition', 'category', 'supplier', '')
int$maxlengthMaxlength of ref
int$save_lastsearch_value-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
int$notooltipNo tooltip
string$morecss''=Add more css on link
int$add_label0=Default, 1=Add label into string, >1=Add first chars into string
string$sep' - '=Separator between ref and label if option 'add_label' is set
Returns
string String with URL

Reimplemented from Form.

Definition at line 1583 of file html.formwebportal.class.php.

References $object, and dol_string_nohtmltag().

◆ getSignatureLink()

FormWebPortal::getSignatureLink ( $modulepart,
$object,
$morecss = '' )

Show a Signature icon with link You may want to call this into a div like this: print '.

'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'

';

Parameters
string$modulepart'proposal', 'facture', 'facture_fourn', ...
Object$objectObject linked to the document to be signed
string$morecssAdd more css to the download picto
Returns
string Output string with HTML link of signature (might be empty string).

Definition at line 326 of file html.formwebportal.class.php.

References $object.

◆ inputDate()

FormWebPortal::inputDate ( $name,
$value = '',
$placeholder = '',
$id = '',
$morecss = '',
$moreparam = '' )

Input for date.

Parameters
string$nameName of html input
string | int$value[=''] Value of input (format : YYYY-MM-DD)
string$placeholder[=''] Placeholder for input (keep empty for no label)
string$id[=''] Id
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input date

Definition at line 69 of file html.formwebportal.class.php.

References Form\selectDate().

Referenced by showInputFieldForObject().

◆ inputGeoPoint()

FormWebPortal::inputGeoPoint ( $htmlName,
$value,
$type = '' )

Html for input geo point.

Parameters
string$htmlNameHtml name
string$valueValue
string$typeType (linestrg, multipts, point, polygon)
Returns
string Html for input geo point

Reimplemented from Form.

Definition at line 1474 of file html.formwebportal.class.php.

References getDolGlobalString().

◆ inputHtml()

FormWebPortal::inputHtml ( $htmlName,
$value,
$morecss = '',
$moreparam = '' )

Html for HTML area.

Parameters
string$htmlNameHtml name
string$value[=''] Value
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input with label

Reimplemented from Form.

Definition at line 1269 of file html.formwebportal.class.php.

References getDolGlobalInt(), and isModEnabled().

◆ inputIcon()

FormWebPortal::inputIcon ( $htmlName,
$value,
$morecss = '',
$moreparam = '' )

Html for input icon.

Parameters
string$htmlNameHtml name
string$valueValue
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input icon

Reimplemented from Form.

Definition at line 1434 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute(), and getDolGlobalInt().

◆ inputRadio()

FormWebPortal::inputRadio ( $htmlName,
$options,
$selectedValue,
$morecss = '',
$moreparam = '' )

Html for input radio.

Parameters
string$htmlNameHtml name
array<string,string>$options List of option
string$selectedValueSelected value
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input radio

Reimplemented from Form.

Definition at line 1361 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute().

◆ inputSelectAjax()

FormWebPortal::inputSelectAjax ( $htmlName,
$array,
$id,
$ajaxUrl,
$ajaxData = [],
$morecss = 'minwidth75',
$moreparam = '' )

Html for select with get options by AJAX.

Parameters
string$htmlNameName
array<string,mixed>$array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
string$idPreselected key or preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record.
string$ajaxUrlAjax page Url
array<string,string>$ajaxData Additional data send to the AJAX page
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input with label

Reimplemented from Form.

Definition at line 1227 of file html.formwebportal.class.php.

References $id.

◆ inputStars()

FormWebPortal::inputStars ( $htmlName,
$size,
$value,
$morecss = '',
$moreparam = '' )

Html for input stars.

Parameters
string$htmlNameHtml name
int$sizeNumber of stars
int$valueValue
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
Returns
string Html for input stars

Reimplemented from Form.

Definition at line 1383 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute(), and img_picto().

◆ inputText()

FormWebPortal::inputText ( $htmlName,
$value,
$morecss = '',
$moreparam = '',
$options = array() )

Html for HTML area.

Parameters
string$htmlNameHtml name
string$value[=''] Value
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
array<string,mixed>$options Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
Returns
string Html for input with label

Reimplemented from Form.

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

◆ inputType()

FormWebPortal::inputType ( $type,
$name,
$value = '',
$id = '',
$morecss = '',
$moreparam = '',
$label = '',
$addInputLabel = '' )

Html for input with label.

Parameters
string$typeType of input : button, checkbox, color, email, hidden, month, number, password, radio, range, tel, text, time, url, week
string$nameName
string$value[=''] Value
string$id[=''] Id
string$morecss[=''] Class
string$moreparam[=''] Add attributes (checked, required, etc)
string$label[=''] Label
string$addInputLabel[=''] Add label for input
Returns
string Html for input with label

Reimplemented from Form.

Definition at line 1193 of file html.formwebportal.class.php.

References $id, and dolPrintHTMLForAttribute().

Referenced by showInputFieldForObject().

◆ outputGeoPoint()

FormWebPortal::outputGeoPoint ( $value,
$type )

Html for show geo point.

Parameters
string$valueValue
string$typeType (linestrg, multipts, point, polygon)
Returns
string Html for show geo point

Reimplemented from Form.

Definition at line 1552 of file html.formwebportal.class.php.

◆ outputIcon()

FormWebPortal::outputIcon ( $value)

Html for show icon.

Parameters
string$valueValue
Returns
string Html for show icon

Reimplemented from Form.

Definition at line 1538 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute().

◆ outputMultiValues()

FormWebPortal::outputMultiValues ( $values)

Html for show selected multiple values.

Parameters
string[]$valuesValues
Returns
string Html for show selected multiple values

Reimplemented from Form.

Definition at line 1498 of file html.formwebportal.class.php.

◆ outputStars()

FormWebPortal::outputStars ( $size,
$value )

Html for show stars.

Parameters
int$sizeNumber of stars
int$valueValue
Returns
string Html for show stars

Reimplemented from Form.

Definition at line 1521 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute(), and img_picto().

◆ printFieldCell()

FormWebPortal::printFieldCell ( $key,
$label,
$value,
$params = array() )

Return HTML code of the cell.

Parameters
string$keyField code
string$labelField label
string$valueField value
array<string,mixed>$params More parameters:
  • 'required' : (boolean) If field required
  • 'cell_class' : (string) Additional class for the cell div
  • 'cell_attributes' : (string) Additional attributes for the cell div
  • 'label_class' : (string) Additional class for the label div
  • 'label_attributes' : (string) Additional attributes for the label div
  • 'value_class' : (string) Additional class for the value div
  • 'value_attributes' : (string) Additional attributes for the value div
Returns
string HTML code

Definition at line 1636 of file html.formwebportal.class.php.

References dolPrintHTMLForAttribute().

◆ selectarray()

static FormWebPortal::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.
array<string,mixed>$array Array like array(key => value) or array(key=>array('label'=>..., 'data-...'=>..., 'disabled'=>..., 'css'=>...))
string | string[]$idPreselected key or preselected keys for multiselect. Use 'ifone' to autoselect record if there is only one record.
int | string$show_empty0 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$key_in_label1 to show key into label with format "[key] value"
int$value_as_key1 to use value as key
string$moreparamAdd more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
int$translate1=Translate and encode value
int$maxlenLength maximum for labels
int$disabledHtml select box is disabled
string$sort'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
string$morecssAdd more class to css styles
int$addjscomboAdd js combo
string$moreparamonemptyAdd more param on the empty option line. Not used if show_empty not set
int$disablebademail1=Check if a not valid email, 2=Check string '—', and if found into value, disable and colorize entry
int$nohtmlescapeNo html escaping.
Returns
string HTML select string.

Reimplemented from Form.

Definition at line 121 of file html.formwebportal.class.php.

References $id, dol_escape_htmltag(), dol_trunc(), and dolPrintHTMLForAttribute().

◆ selectCurrency()

FormWebPortal::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, 2 = Add both symbol and code
string$useempty'1'=Allow empty value
Returns
string HTML component

Reimplemented from Form.

Definition at line 1688 of file html.formwebportal.class.php.

◆ selectForForms()

FormWebPortal::selectForForms ( $objectdesc,
$htmlname,
$preselectedvalue,
$showempty = '',
$searchkey = '',
$placeholder = '',
$morecss = '',
$moreparams = '',
$forcecombo = 0,
$disabled = 0,
$selected_input_value = '',
$objectfield = '' )

Generic method to select a component from a combo list.

Can use autocomplete with ajax after x key pressed or a full combo, depending on setup. This is the generic method that will replace all specific existing methods.

Parameters
string$objectdesc'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc.
string$htmlnameName of HTML select component
int$preselectedvaluePreselected value (ID of element)
string$showempty''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
string$searchkeySearch criteria
string$placeholderPlace holder
string$morecssMore CSS
string$moreparamsMore params provided to ajax call
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
int$disabled1=Html component is disabled
string$selected_input_valueValue of preselected input text (for use with ajax)
string$objectfieldObject:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
Returns
string Return HTML string
See also
selectForFormsList(), select_thirdparty_list()

Definition at line 361 of file html.formwebportal.class.php.

References dol_include_once(), dol_syslog(), getEntity(), and Form\selectForFormsList().

◆ showInputFieldForObject()

FormWebPortal::showInputFieldForObject ( $object,
$val,
$key,
$value,
$moreparam = '',
$keysuffix = '',
$keyprefix = '',
$morecss = '' )

Return HTML string to put an input field into a page Code very similar with showInputField for common object.

Parameters
Object$objectCommon object
array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}$val Array of properties for field to show
string$keyKey of attribute
string | mixed[]$valuePreselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array)
string$moreparamTo add more parameters on html input tag
string$keysuffixPrefix string to add into name and id of field (can be used to avoid duplicate names)
string$keyprefixSuffix string to add into name and id of field (can be used to avoid duplicate names)
string$morecssValue for css to define style/length of field. May also be a numeric.
Returns
string

Definition at line 425 of file html.formwebportal.class.php.

References dol_escape_htmltag(), dol_syslog(), dol_trunc(), inputDate(), inputType(), and price().

◆ showphoto()

static FormWebPortal::showphoto ( $modulepart,
$object,
$width = 100,
$height = 0,
$caneditfield = 0,
$cssclass = 'photowithmargin',
$imagesize = '',
$addlinktofullsize = 1,
$cache = 0,
$forcecapture = '',
$noexternsourceoverwrite = 0,
$usesharelinkifavailable = 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
''|'user'|'environment'$forcecapture '', 'user' (user-facing camera) or 'environment' ('outward-facing camera'). Force the 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)
int<0,1>$usesharelinkifavailable Use 1 to use the share=key link if available. This is slower.
Returns
string HTML code to output photo
See also
getImagePublicURLOfObject()

Reimplemented from Form.

Definition at line 1612 of file html.formwebportal.class.php.

References $object.


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