dolibarr 21.0.0-alpha
project.lib.php File Reference

Functions used by project module. More...

Go to the source code of this file.

Functions

 project_prepare_head (Project $project, $moreparam='')
 Prepare array with list of tabs.
 
 task_prepare_head ($object)
 Prepare array with list of tabs.
 
 project_timesheet_prepare_head ($mode, $fuser=null)
 Prepare array with list of tabs.
 
 project_admin_prepare_head ()
 Prepare array with list of tabs.
 
 projectLinesa (&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $dummy='', $showbilltime=0, $arrayfields=array(), $arrayofselected=array())
 Show task lines with a particular parent.
 
 projectLinesPerAction (&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0)
 Output a task line into a pertime input mode.
 
 projectLinesPerDay (&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak=0, $arrayfields=array(), $extrafields=null)
 Output a task line into a pertime input mode.
 
 projectLinesPerWeek (&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak=0, $arrayfields=array(), $extrafields=null)
 Output a task line into a perday input mode.
 
 projectLinesPerMonth (&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak=0, $TWeek=array(), $arrayfields=array(), $extrafields=null)
 Output a task line into a perday input mode.
 
 searchTaskInChild (&$inc, $parent, &$lines, &$taskrole)
 Search in task lines with a particular parent if there is a task for a particular user (in taskrole)
 
 print_projecttasks_array ($db, $form, $socid, $projectsListId, $mytasks=0, $status=-1, $listofoppstatus=array(), $hiddenfields=array(), $max=0)
 Return HTML table with list of projects and number of opened tasks.
 
 getTaskProgressView ($task, $label=true, $progressNumber=true, $hideOnProgressNull=false, $spaced=false)
 
 getTaskProgressBadge ($task, $label='', $tooltip='')
 

Detailed Description

Functions used by project module.

Definition in file project.lib.php.

Function Documentation

◆ getTaskProgressBadge()

getTaskProgressBadge ( $task,
$label = '',
$tooltip = '' )
Parameters
Task$taskthe task object
string$labelempty = auto (progress), string = replace output
string$tooltipempty = auto , string = replace output
Returns
string
See also
getTaskProgressView()

Definition at line 3038 of file project.lib.php.

References getDolGlobalString().

Referenced by projectLinesa().

◆ getTaskProgressView()

getTaskProgressView ( $task,
$label = true,
$progressNumber = true,
$hideOnProgressNull = false,
$spaced = false )
Parameters
Task$taskthe task object
bool | string$labeltrue = auto, false = don't display, string = replace output
bool | string$progressNumbertrue = auto, false = don't display, string = replace output
bool$hideOnProgressNullhide if progress is null
bool$spacedused to add space at bottom (made by css)
Returns
string
See also
getTaskProgressBadge()

Definition at line 2906 of file project.lib.php.

References convertSecondToTime(), dol_htmlentities(), getDolGlobalString(), and img_warning().

Referenced by box_task\loadBox(), and projectLinesa().

◆ print_projecttasks_array()

print_projecttasks_array ( $db,
$form,
$socid,
$projectsListId,
$mytasks = 0,
$status = -1,
$listofoppstatus = array(),
$hiddenfields = array(),
$max = 0 )

Return HTML table with list of projects and number of opened tasks.

Parameters
DoliDB$dbDatabase handler
Form$formObject form
int$socidId thirdparty
int | string$projectsListIdId or ids of project I have permission on (separated with comma)
int<0,1>$mytasks Limited to task I am contact to
int<-1,1>$status -1=No filter on statut, 0 or 1 = Filter on status
array<int,string>$listofoppstatus List of opportunity status
string[]$hiddenfieldsList of info to not show ('projectlabel', 'declaredprogress', '...', )
int<0,max>$max Max nb of record to show in HTML list
Returns
void

Definition at line 2562 of file project.lib.php.

References convertSecondToTime(), dol_getIdFromCode(), getDolGlobalString(), price(), price2num(), and print_liste_field_titre().

◆ project_admin_prepare_head()

project_admin_prepare_head ( )

Prepare array with list of tabs.

Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 528 of file project.lib.php.

References complete_head_from_modules(), and getDolGlobalString().

◆ project_prepare_head()

project_prepare_head ( Project $project,
$moreparam = '' )

Prepare array with list of tabs.

Parameters
Project$projectObject related to tabs
string$moreparamMore param on url
Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 41 of file project.lib.php.

References complete_head_from_modules(), Link\count(), dol_dir_list(), dol_getcache(), dol_print_error(), dol_sanitizeFileName(), dol_setcache(), getDolGlobalString(), and setEventMessages().

◆ project_timesheet_prepare_head()

project_timesheet_prepare_head ( $mode,
$fuser = null )

Prepare array with list of tabs.

Parameters
string$modeMode
string$fuserFilter on user
Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 482 of file project.lib.php.

References complete_head_from_modules(), and getDolGlobalString().

◆ projectLinesa()

projectLinesa ( & $inc,
$parent,
& $lines,
& $level,
$var,
$showproject,
& $taskrole,
$projectsListId = '',
$addordertick = 0,
$projectidfortotallink = 0,
$dummy = '',
$showbilltime = 0,
$arrayfields = array(),
$arrayofselected = array() )

Show task lines with a particular parent.

Parameters
string$incLine number (start to 0, then increased by recursive call)
int$parentId of parent task to show (0 to show all)
Task[]$linesArray of lines
int$levelLevel (start to 0, then increased/decrease by recursive call), or -1 to show all level in order of $lines without the recursive groupment feature.
string$varNot used
int$showprojectShow project columns
int$taskroleArray of roles of user for each tasks
string$projectsListIdList of id of projects allowed to user (string separated with comma)
int$addordertickAdd a tick to move task
int$projectidfortotallink0 or Id of project to use on total line (link to see all time consumed for project)
string$dummyNot used.
int$showbilltimeAdd the column 'TimeToBill' and 'TimeBilled'
array<string,null|int|float|string>$arrayfields Array with displayed column information
string[]$arrayofselectedArray with selected fields
Returns
int Nb of tasks shown

Definition at line 600 of file project.lib.php.

References convertSecondToTime(), description, dol_escape_htmltag(), dol_print_date(), getDolGlobalString(), getTaskProgressBadge(), getTaskProgressView(), img_warning(), price(), projectLinesa(), and searchTaskInChild().

Referenced by projectLinesa().

◆ projectLinesPerAction()

projectLinesPerAction ( & $inc,
$parent,
$fuser,
$lines,
& $level,
& $projectsrole,
& $tasksrole,
$mine,
$restricteditformytask,
$preselectedday,
& $isavailable,
$oldprojectforbreak = 0 )

Output a task line into a pertime input mode.

Parameters
string$incLine number (start to 0, then increased by recursive call)
int$parentId of parent task to show (0 to show all)
?User$fuserRestrict list to user if defined
Task[]$linesArray of lines
int$levelLevel (start to 0, then increased/decrease by recursive call)
string$projectsroleArray of roles user has on project
string$tasksroleArray of roles user has on task
string$mineShow only task lines I am assigned to
int<0,1>$restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
int$preselecteddayPreselected day
array<int,array{morning:int<0,1>,afternoon:int<0,1>}>$isavailable Array with data that say if user is available for several days for morning and afternoon
int$oldprojectforbreakOld project id of last project break
Returns
array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks

Definition at line 1185 of file project.lib.php.

References convertSecondToTime(), dol_escape_htmltag(), dol_print_date(), and getDolGlobalString().

◆ projectLinesPerDay()

projectLinesPerDay ( & $inc,
$parent,
$fuser,
$lines,
& $level,
& $projectsrole,
& $tasksrole,
$mine,
$restricteditformytask,
$preselectedday,
& $isavailable,
$oldprojectforbreak = 0,
$arrayfields = array(),
$extrafields = null )

Output a task line into a pertime input mode.

Parameters
string$incLine number (start to 0, then increased by recursive call)
int$parentId of parent task to show (0 to show all)
?User$fuserRestrict list to user if defined
Task[]$linesArray of lines
int$levelLevel (start to 0, then increased/decrease by recursive call)
string$projectsroleArray of roles user has on project
string$tasksroleArray of roles user has on task
int<0,1>$mine Show only task lines I am assigned to
int<0,2>$restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
int$preselecteddayPreselected day
array<int,array{morning:int<0,1>,afternoon:int<0,1>}>$isavailable Array with data that say if user is available for several days for morning and afternoon
int$oldprojectforbreakOld project id of last project break
string[]$arrayfieldsArray of additional column
Extrafields$extrafieldsObject extrafields
Returns
array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks

Definition at line 1417 of file project.lib.php.

References convertSecondToTime(), dol_escape_htmltag(), dol_getdate(), dol_now(), dol_time_plus_duree(), getDolGlobalInt(), getDolGlobalString(), and projectLinesPerDay().

Referenced by projectLinesPerDay().

◆ projectLinesPerMonth()

projectLinesPerMonth ( & $inc,
$firstdaytoshow,
$fuser,
$parent,
$lines,
& $level,
& $projectsrole,
& $tasksrole,
$mine,
$restricteditformytask,
& $isavailable,
$oldprojectforbreak = 0,
$TWeek = array(),
$arrayfields = array(),
$extrafields = null )

Output a task line into a perday input mode.

Parameters
string$incLine output identificator (start to 0, then increased by recursive call)
int$firstdaytoshowFirst day to show
User | null$fuserRestrict list to user if defined
int$parentId of parent task to show (0 to show all)
Task[]$linesArray of lines (list of tasks but we will show only if we have a specific role on task)
int$levelLevel (start to 0, then increased/decrease by recursive call)
string$projectsroleArray of roles user has on project
string$tasksroleArray of roles user has on task
int<0,1>$mine Show only task lines I am assigned to
int<0,1>$restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
array<int,array{morning:int<0,1>,afternoon:int<0,1>}>$isavailable Array with data that say if user is available for several days for morning and afternoon
int$oldprojectforbreakOld project id of last project break
string[]$TWeekArray of week numbers ('02', ...
string[]$arrayfieldsArray of additional column
Extrafields$extrafieldsObject extrafields
Returns
array<string,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks (index is string, month is '01', ...)

Definition at line 2227 of file project.lib.php.

◆ projectLinesPerWeek()

projectLinesPerWeek ( & $inc,
$firstdaytoshow,
$fuser,
$parent,
$lines,
& $level,
& $projectsrole,
& $tasksrole,
$mine,
$restricteditformytask,
& $isavailable,
$oldprojectforbreak = 0,
$arrayfields = array(),
$extrafields = null )

Output a task line into a perday input mode.

Parameters
string$incLine output identificator (start to 0, then increased by recursive call)
int$firstdaytoshowFirst day to show
?User$fuserRestrict list to user if defined
int$parentId of parent task to show (0 to show all)
Task[]$linesArray of lines (list of tasks but we will show only if we have a specific role on task)
int$levelLevel (start to 0, then increased/decrease by recursive call)
string$projectsroleArray of roles user has on project
string$tasksroleArray of roles user has on task
int<0,1>$mine Show only task lines I am assigned to
int<0,2>$restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
array<int,array{morning:int<0,1>,afternoon:int<0,1>}>$isavailable Array with data that say if user is available for several days for morning and afternoon
int$oldprojectforbreakOld project id of last project break
string[]$arrayfieldsArray of additional column
Extrafields$extrafieldsObject extrafields
Returns
array<int,int> Array with time spent for $fuser for each day of week on tasks in $lines and subtasks

Definition at line 1820 of file project.lib.php.

References convertSecondToTime(), dol_escape_htmltag(), dol_getdate(), dol_now(), dol_time_plus_duree(), getDolGlobalInt(), and getDolGlobalString().

◆ searchTaskInChild()

searchTaskInChild ( & $inc,
$parent,
& $lines,
& $taskrole )

Search in task lines with a particular parent if there is a task for a particular user (in taskrole)

Parameters
int$incCounter that count number of lines legitimate to show (for return)
int$parentId of parent task to start
Task[]$linesArray of all tasks
string$taskroleArray of task filtered on a particular user
Returns
int 1 if there is

Definition at line 2522 of file project.lib.php.

Referenced by projectLinesa().

◆ task_prepare_head()

task_prepare_head ( $object)

Prepare array with list of tabs.

Parameters
CommonObject$objectObject related to tabs
Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 375 of file project.lib.php.

References $object, complete_head_from_modules(), Link\count(), dol_dir_list(), dol_print_error(), dol_sanitizeFileName(), and getDolGlobalString().