dolibarr  17.0.4
Public Member Functions | List of all members
FormProjets Class Reference

Class to manage building of HTML components. More...

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 select_projects ($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey='', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='', $morefilter='')
 Output a combo list with projects qualified for a third party / user. More...
 
 select_projects_list ($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey='', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500', $morefilter='')
 Returns an array with projects qualified for a third party. More...
 
 selectTasks ($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showmore='all', $usertofilter=null)
 Output a combo list with tasks qualified for a third party. More...
 
 select_element ($table_element, $socid=0, $morecss='', $limitonstatus=-2, $projectkey="fk_projet", $placeholder='')
 Build a HTML select list of element of same thirdparty to suggest to link them to project. More...
 
 selectOpportunityStatus ($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0, $morecss='', $noadmininfo=0, $addcombojs=0)
 Build a HTML select list of element of same thirdparty to suggest to link them to project. More...
 

Detailed Description

Class to manage building of HTML components.

Definition at line 30 of file html.formprojet.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormProjets::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

References db.

Member Function Documentation

◆ select_element()

FormProjets::select_element (   $table_element,
  $socid = 0,
  $morecss = '',
  $limitonstatus = -2,
  $projectkey = "fk_projet",
  $placeholder = '' 
)

Build a HTML select list of element of same thirdparty to suggest to link them to project.

Parameters
string$table_elementTable of the element to update
string$socidIf of thirdparty to use as filter or 'id1,id2,...'
string$morecssMore CSS
int$limitonstatusAdd filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement
string$projectkeyEquivalent key to fk_projet for actual table_element
string$placeholderPlaceholder
Returns
int|string The HTML select list of element or '' if nothing or -1 if KO

Definition at line 522 of file html.formprojet.class.php.

◆ select_projects()

FormProjets::select_projects (   $socid = -1,
  $selected = '',
  $htmlname = 'projectid',
  $maxlength = 16,
  $option_only = 0,
  $show_empty = 1,
  $discard_closed = 0,
  $forcefocus = 0,
  $disabled = 0,
  $mode = 0,
  $filterkey = '',
  $nooutput = 0,
  $forceaddid = 0,
  $morecss = '',
  $htmlid = '',
  $morefilter = '' 
)

Output a combo list with projects qualified for a third party / user.

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 | Project$selectedId of preselected project or Project (or ''). Note: If you know the ref, you can also provide it into $selected_input_value to save one request in some cases.
string$htmlnameName of HTML field
int$maxlengthMaximum length of label
int$option_onlyReturn only html options lines without the select tag
int$show_emptyAdd an empty line
int$discard_closedDiscard closed projects (0=Keep, 1=hide completely, 2=Disable). Use a negative value to not show the "discarded" tooltip.
int$forcefocusForce focus on field (works with javascript only)
int$disabledDisabled
int$mode0 for HTML mode and 1 for JSON mode
string$filterkeyKey to filter on ref or title
int$nooutputNo print output. Return it only.
int$forceaddidForce to add project id in list, event if not qualified
string$morecssMore css
int$htmlidHtml id to use instead of htmlname
string$morefilterMore filters (Must be a sql sanitized string)
Returns
string Return html content

Definition at line 80 of file html.formprojet.class.php.

◆ select_projects_list()

FormProjets::select_projects_list (   $socid = -1,
  $selected = '',
  $htmlname = 'projectid',
  $maxlength = 24,
  $option_only = 0,
  $show_empty = 1,
  $discard_closed = 0,
  $forcefocus = 0,
  $disabled = 0,
  $mode = 0,
  $filterkey = '',
  $nooutput = 0,
  $forceaddid = 0,
  $htmlid = '',
  $morecss = 'maxwidth500',
  $morefilter = '' 
)

Returns an array with projects 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)
int$selectedId project preselected
string$htmlnameNom de la zone html
int$maxlengthMaximum length of label
int$option_onlyReturn only html options lines without the select tag
int$show_emptyAdd an 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
int$mode0 for HTML mode and 1 for array return (to be used by json_encode for example)
string$filterkeyKey to filter on title or ref
int$nooutputNo print output. Return it only.
int$forceaddidForce to add project id in list, event if not qualified
int$htmlidHtml id to use instead of htmlname
string$morecssMore CSS
string$morefilterMore filters (Must be a sql sanitized string)
Returns
int Nb of project if OK, <0 if KO

Definition at line 148 of file html.formprojet.class.php.

◆ selectOpportunityStatus()

FormProjets::selectOpportunityStatus (   $htmlname,
  $preselected = '-1',
  $showempty = 1,
  $useshortlabel = 0,
  $showallnone = 0,
  $showpercent = 0,
  $morecss = '',
  $noadmininfo = 0,
  $addcombojs = 0 
)

Build a HTML select list of element of same thirdparty to suggest to link them to project.

Parameters
string$htmlnameHTML name
string$preselectedPreselected (int or 'all' or 'none')
int$showemptyAdd an empty line
int$useshortlabelUse short label
int$showallnoneAdd choice "All" and "None"
int$showpercentShow default probability for status
string$morecssAdd more css
int$noadmininfo0=Add admin info, 1=Disable admin info
int$addcombojs1=Add a js combo
Returns
int|string The HTML select list of element or '' if nothing or -1 if KO

Definition at line 680 of file html.formprojet.class.php.

◆ selectTasks()

FormProjets::selectTasks (   $socid = -1,
  $selected = '',
  $htmlname = 'taskid',
  $maxlength = 24,
  $option_only = 0,
  $show_empty = '1',
  $discard_closed = 0,
  $forcefocus = 0,
  $disabled = 0,
  $morecss = 'maxwidth500',
  $projectsListId = '',
  $showmore = 'all',
  $usertofilter = null 
)

Output a combo list with tasks 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)
int$selectedId task 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$showmore'all' = Show project info, 'progress' = Show task progression, ''=Show nothing more
User$usertofilterUser object to use for filtering
Returns
int Nbr of tasks if OK, <0 if KO

Definition at line 330 of file html.formprojet.class.php.


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