dolibarr 20.0.0
FormOther Class Reference

Class permettant la generation de composants html autre Only common components are here. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 getHTMLScannerForm ($jstoexecuteonadd='barcodescannerjs', $mode='all', $warehouseselect=0)
 Return the HTML code for scanner tool.
 
 select_export_model ($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null)
 Return HTML select list of export models.
 
 select_import_model ($selected='', $htmlname='importmodelid', $type='', $useempty=0, $fk_user=null)
 Return list of export models.
 
 select_ecotaxes ($selected='', $htmlname='ecotaxe_id')
 Return list of ecotaxes with label.
 
 select_revenue_stamp ($selected='', $htmlname='revenuestamp', $country_code='')
 Return list of revenue stamp for country.
 
 select_percent ($selected=0, $htmlname='percent', $disabled=0, $increment=5, $start=0, $end=100, $showempty=0)
 Return a HTML select list to select a percent.
 
 select_categories ($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='')
 Return select list for categories (to use in form search selectors)
 
 select_salesrepresentatives ($selected, $htmlname, $user, $showstatus=0, $showempty=1, $morecss='', $norepresentative=0)
 Return select list for categories (to use in form search selectors)
 
 selectProjectTasks ($selectedtask=0, $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0, $filteronprojstatus='', $morecss='')
 Return list of project and tasks.
 
 select_color ($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors=[])
 Output a HTML code to select a color.
 
 CreateColorIcon ($color, $module, $name, $x=12, $y=12)
 Create an image for color.
 
 select_dayofweek ($selected='', $htmlname='weekid', $useempty=0)
 Return HTML combo list of week.
 
 select_month ($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='minwidth50 maxwidth75imp valignmiddle', $addjscombo=false)
 Return HTML combo list of month.
 
 select_year ($selected='', $htmlname='yearid', $useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle maxwidth75imp', $addjscombo=false)
 Return HTML combo list of years.
 
 selectyear ($selected='', $htmlname='yearid', $useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle width75', $addjscombo=false)
 Return HTML combo list of years.
 
 select_dictionary ($htmlname, $dictionarytable, $keyfield='code', $labelfield='label', $selected='', $useempty=0, $moreattrib='')
 Return a HTML select list of a dictionary.
 
 selectAutoManual ($htmlname, $value='', $option=0, $disabled=false, $useempty=0)
 Return an html string with a select combo box to choose yes or no.
 
 selectGroupByField ($object, $search_groupby, &$arrayofgroupby, $morecss='minwidth200 maxwidth250', $showempty='1')
 Return HTML select list to select a group by field.
 
 selectXAxisField ($object, $search_xaxis, &$arrayofxaxis, $showempty='1', $morecss='minwidth250 maxwidth500')
 Return HTML select list to select a group by field.
 

Static Public Member Functions

static showColor ($color, $textifnotdefined='')
 Output a HTML thumb of color or a text if not defined.
 
static selectColor ($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors=[], $morecss='', $setpropertyonselect='', $default='')
 Output a HTML code to select a color.
 
static getBoxesArea ($user, $areacode)
 Get array with HTML tabs with boxes of a particular area including personalized choices of user.
 

Private Member Functions

 _pLineSelect (&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0)
 Write lines of a project (all lines of a project if parent = 0)
 

Detailed Description

Class permettant la generation de composants html autre Only common components are here.

Definition at line 41 of file html.formother.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormOther::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 56 of file html.formother.class.php.

Member Function Documentation

◆ _pLineSelect()

FormOther::_pLineSelect ( & $inc,
$parent,
$lines,
$level = 0,
$selectedtask = 0,
$selectedproject = 0,
$disablechildoftaskid = 0 )
private

Write lines of a project (all lines of a project if parent = 0)

Parameters
int$incCursor counter
int$parentId of parent task we want to see
array$linesArray of task lines
int$levelLevel
int$selectedtaskId selected task
int$selectedprojectId selected project
int$disablechildoftaskid1=Disable task that are child of the provided task id
Returns
void

Definition at line 704 of file html.formother.class.php.

◆ CreateColorIcon()

FormOther::CreateColorIcon ( $color,
$module,
$name,
$x = 12,
$y = 12 )

Create an image for color.

Parameters
string$colorColor of image
string$moduleName of module
string$nameName of image
int$xLargeur de l'image en pixels
int$yHauteur de l'image en pixels
Returns
void

Definition at line 1003 of file html.formother.class.php.

◆ getBoxesArea()

static FormOther::getBoxesArea ( $user,
$areacode )
static

Get array with HTML tabs with boxes of a particular area including personalized choices of user.

Class 'Form' must be known.

Parameters
User$userObject User
string$areacodeCode of area for pages - 0 = Home page ... See getListOfPagesForBoxes()
Returns
array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)

Definition at line 1221 of file html.formother.class.php.

◆ getHTMLScannerForm()

FormOther::getHTMLScannerForm ( $jstoexecuteonadd = 'barcodescannerjs',
$mode = 'all',
$warehouseselect = 0 )

Return the HTML code for scanner tool.

This must be called into an existing <form>

Parameters
string$jstoexecuteonaddName of javascript function to call once the barcode scanning session is complete and user has click on "Add".
string$mode'all' (both product and lot barcode) or 'product' (product barcode only) or 'lot' (lot number only)
int$warehouseselect0 (disable warehouse select) or 1 (enable warehouse select)
Returns
string HTML component

Definition at line 70 of file html.formother.class.php.

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

◆ select_categories()

FormOther::select_categories ( $type,
$selected = 0,
$htmlname = 'search_categ',
$nocateg = 0,
$showempty = 1,
$morecss = '' )

Return select list for categories (to use in form search selectors)

Parameters
int$typeType of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
integer$selectedPreselected value
string$htmlnameName of combo list
int$nocategShow also an entry "Not categorized"
int | string$showemptyAdd also an empty line
string$morecssMore CSS
Returns
string Html combo list code
See also
select_all_categories()

Definition at line 409 of file html.formother.class.php.

◆ select_color()

FormOther::select_color ( $set_color = '',
$prefix = 'f_color',
$form_name = '',
$showcolorbox = 1,
$arrayofcolors = [] )

Output a HTML code to select a color.

Parameters
string$set_colorPre-selected color
string$prefixName of HTML field
string$form_nameDeprecated. Not used.
int$showcolorbox1=Show color code and color box, 0=Show only color code
array$arrayofcolorsArray of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
Returns
void
Deprecated
Use instead selectColor
See also
selectColor()

Definition at line 839 of file html.formother.class.php.

◆ select_dayofweek()

FormOther::select_dayofweek ( $selected = '',
$htmlname = 'weekid',
$useempty = 0 )

Return HTML combo list of week.

Parameters
string$selectedPreselected value
string$htmlnameNom de la zone select
int$useemptyAffiche valeur vide dans liste
Returns
string

Definition at line 1041 of file html.formother.class.php.

◆ select_dictionary()

FormOther::select_dictionary ( $htmlname,
$dictionarytable,
$keyfield = 'code',
$labelfield = 'label',
$selected = '',
$useempty = 0,
$moreattrib = '' )

Return a HTML select list of a dictionary.

Parameters
string$htmlnameName of select zone
string$dictionarytableDictionary table
string$keyfieldField for key
string$labelfieldLabel field
string$selectedSelected value
int$useempty1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
string$moreattribMore attributes on HTML select tag
Returns
void

Definition at line 1451 of file html.formother.class.php.

◆ select_ecotaxes()

FormOther::select_ecotaxes ( $selected = '',
$htmlname = 'ecotaxe_id' )

Return list of ecotaxes with label.

Parameters
string$selectedPreselected ecotaxes
string$htmlnameName of combo list
Returns
integer

Definition at line 268 of file html.formother.class.php.

◆ select_export_model()

FormOther::select_export_model ( $selected = '',
$htmlname = 'exportmodelid',
$type = '',
$useempty = 0,
$fk_user = null )

Return HTML select list of export models.

Parameters
string$selectedId modele pre-selectionne
string$htmlnameNom de la zone select
string$typeType des modeles recherches
int$useemptyShow an empty value in list
int$fk_userUser we want templates
Returns
void

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

◆ select_import_model()

FormOther::select_import_model ( $selected = '',
$htmlname = 'importmodelid',
$type = '',
$useempty = 0,
$fk_user = null )

Return list of export models.

Parameters
string$selectedId modele pre-selectionne
string$htmlnameNom de la zone select
string$typeType des modeles recherches
int$useemptyAffiche valeur vide dans liste
int$fk_userUser that has created the template
Returns
void

Definition at line 209 of file html.formother.class.php.

◆ select_month()

FormOther::select_month ( $selected = '',
$htmlname = 'monthid',
$useempty = 0,
$longlabel = 0,
$morecss = 'minwidth50 maxwidth75imp valignmiddle',
$addjscombo = false )

Return HTML combo list of month.

Parameters
string$selectedPreselected value
string$htmlnameName of HTML select object
int$useemptyShow empty in list
int$longlabelShow long label
string$morecssMore Css
bool$addjscomboAdd js combo
Returns
string

Definition at line 1088 of file html.formother.class.php.

◆ select_percent()

FormOther::select_percent ( $selected = 0,
$htmlname = 'percent',
$disabled = 0,
$increment = 5,
$start = 0,
$end = 100,
$showempty = 0 )

Return a HTML select list to select a percent.

Parameters
integer$selectedpourcentage pre-selectionne
string$htmlnamenom de la liste deroulante
int$disabledDisabled or not
int$incrementincrement value
int$startstart value
int$endend value
int$showemptyAdd also an empty line
Returns
string HTML select string

Definition at line 373 of file html.formother.class.php.

◆ select_revenue_stamp()

FormOther::select_revenue_stamp ( $selected = '',
$htmlname = 'revenuestamp',
$country_code = '' )

Return list of revenue stamp for country.

Parameters
string$selectedValue of preselected revenue stamp
string$htmlnameName of combo list
string$country_codeCountry Code
Returns
string HTML select list

Definition at line 319 of file html.formother.class.php.

◆ select_salesrepresentatives()

FormOther::select_salesrepresentatives ( $selected,
$htmlname,
$user,
$showstatus = 0,
$showempty = 1,
$morecss = '',
$norepresentative = 0 )

Return select list for categories (to use in form search selectors)

Parameters
int | string$selectedPreselected value
string$htmlnameName of combo list (example: 'search_sale')
User$userObject user
int$showstatus0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
int | string$showempty1=show also an empty value or text to show for empty
string$morecssMore CSS
int$norepresentativeShow also an entry "Not categorized"
Returns
string Html combo list code

Definition at line 481 of file html.formother.class.php.

◆ select_year()

FormOther::select_year ( $selected = '',
$htmlname = 'yearid',
$useempty = 0,
$min_year = 10,
$max_year = 5,
$offset = 0,
$invert = 0,
$option = '',
$morecss = 'valignmiddle maxwidth75imp',
$addjscombo = false )

Return HTML combo list of years.

Parameters
string$selectedPreselected value (''=current year, -1=none, year otherwise)
string$htmlnameName of HTML select object
int$useemptyAffiche valeur vide dans liste
int$min_yearOffset of minimum year into list (by default current year -10)
int$max_yearOffset of maximum year into list (by default current year + 5)
int$offsetOffset
int$invertInvert
string$optionOption
string$morecssMore CSS
bool$addjscomboAdd js combo
Returns
void
Deprecated

Definition at line 1143 of file html.formother.class.php.

◆ selectAutoManual()

FormOther::selectAutoManual ( $htmlname,
$value = '',
$option = 0,
$disabled = false,
$useempty = 0 )

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 automatic/manual, 1 return 1/0
bool$disabledtrue or false
int$useempty1=Add empty line
Returns
string See option

Definition at line 1504 of file html.formother.class.php.

◆ selectColor()

static FormOther::selectColor ( $set_color = '',
$prefix = 'f_color',
$form_name = '',
$showcolorbox = 1,
$arrayofcolors = [],
$morecss = '',
$setpropertyonselect = '',
$default = '' )
static

Output a HTML code to select a color.

Field will return an hexa color like '334455'.

Parameters
string$set_colorPre-selected color with format '#......'
string$prefixName of HTML field
string$form_nameDeprecated. Not used.
int$showcolorbox1=Show color code and color box, 0=Show only color code
array$arrayofcolorsArray of possible colors to choose in the selector. All colors are possible if empty. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
string$morecssAdd css style into input field
string$setpropertyonselectSet this CSS property after selecting a color
string$defaultDefault color
Returns
string
See also
showColor()

Definition at line 859 of file html.formother.class.php.

◆ selectGroupByField()

FormOther::selectGroupByField ( $object,
$search_groupby,
& $arrayofgroupby,
$morecss = 'minwidth200 maxwidth250',
$showempty = '1' )

Return HTML select list to select a group by field.

Parameters
mixed$objectObject analyzed
array$search_groupbyArray of preselected fields
array$arrayofgroupbyArray of groupby to fill
string$morecssMore CSS
string$showempty'1' or 'text'
Returns
string HTML string component

Definition at line 1544 of file html.formother.class.php.

◆ selectProjectTasks()

FormOther::selectProjectTasks ( $selectedtask = 0,
$projectid = 0,
$htmlname = 'task_parent',
$modeproject = 0,
$modetask = 0,
$mode = 0,
$useempty = 0,
$disablechildoftaskid = 0,
$filteronprojstatus = '',
$morecss = '' )

Return list of project and tasks.

Parameters
int$selectedtaskPre-selected task
int$projectidProject id
string$htmlnameName of html select
int$modeproject1 to restrict on projects owned by user
int$modetask1 to restrict on tasks associated to user
int$mode0=Return list of tasks and their projects, 1=Return projects and tasks if exists
int$useempty0=Allow empty values
int$disablechildoftaskid1=Disable task that are child of the provided task id
string$filteronprojstatusFilter on project status ('-1'=no filter, '0,1'=Draft+Validated status)
string$morecssMore css
Returns
void

Definition at line 667 of file html.formother.class.php.

◆ selectXAxisField()

FormOther::selectXAxisField ( $object,
$search_xaxis,
& $arrayofxaxis,
$showempty = '1',
$morecss = 'minwidth250 maxwidth500' )

Return HTML select list to select a group by field.

Parameters
mixed$objectObject analyzed
array$search_xaxisArray of preselected fields
array$arrayofxaxisArray of groupby to fill
string$showempty'1' or 'text'
string$morecssMore css
Returns
string HTML string component

Definition at line 1567 of file html.formother.class.php.

◆ selectyear()

FormOther::selectyear ( $selected = '',
$htmlname = 'yearid',
$useempty = 0,
$min_year = 10,
$max_year = 5,
$offset = 0,
$invert = 0,
$option = '',
$morecss = 'valignmiddle width75',
$addjscombo = false )

Return HTML combo list of years.

Parameters
string$selectedPreselected value (''=current year, -1=none, year otherwise)
string$htmlnameName of HTML select object
int$useemptyAffiche valeur vide dans liste
int$min_yearOffset of minimum year into list (by default current year -10)
int$max_yearOffset of maximum year into list (by default current year + 5)
int$offsetOffset
int$invertInvert
string$optionOption
string$morecssMore css
bool$addjscomboAdd js combo
Returns
string

Definition at line 1164 of file html.formother.class.php.

◆ showColor()

static FormOther::showColor ( $color,
$textifnotdefined = '' )
static

Output a HTML thumb of color or a text if not defined.

Parameters
string$colorString with hex (FFFFFF) or comma RGB ('255,255,255')
string$textifnotdefinedText to show if color not defined
Returns
string Show color string
See also
selectColor()

Definition at line 809 of file html.formother.class.php.


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