Qual: Removed errors

This commit is contained in:
Laurent Destailleur 2011-09-20 16:20:22 +00:00
parent e89806aa62
commit b2c2adf307
3 changed files with 795 additions and 765 deletions

View File

@ -359,10 +359,10 @@ class Skeleton_Class // extends CommonObject
/** /**
* Initialisz object with example values * Initialise object with example values
* Id must be 0 if object instance is a specimen * Id must be 0 if object instance is a specimen
* *
* @return none * @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {

View File

@ -163,8 +163,8 @@ class Project extends CommonObject
/** /**
* Update a project * Update a project
* *
* @param $user User object of making update * @param User $user User object of making update
* @param $notrigger 1=Disable all triggers * @param int $notrigger 1=Disable all triggers
* @return int * @return int
*/ */
function update($user, $notrigger=0) function update($user, $notrigger=0)
@ -284,8 +284,9 @@ class Project extends CommonObject
/** /**
* Return list of projects * Return list of projects
* @param socid To filter on a particular third party *
* @return array Liste of projects * @param int $socid To filter on a particular third party
* @return array List of projects
*/ */
function liste_array($socid='') function liste_array($socid='')
{ {
@ -324,9 +325,10 @@ class Project extends CommonObject
} }
/** /**
* \brief Return list of elements for type linked to project * Return list of elements for type linked to project
* \param type 'propal','order','invoice','order_supplier','invoice_supplier' *
* \return array List of orders linked to project, <0 if error * @param string $type 'propal','order','invoice','order_supplier','invoice_supplier'
* @return array List of orders linked to project, <0 if error
*/ */
function get_element_list($type) function get_element_list($type)
{ {
@ -376,8 +378,9 @@ class Project extends CommonObject
/** /**
* Delete a project from database * Delete a project from database
* @param user User *
* @param notrigger Disable triggers * @param User $user User
* @param int $notrigger Disable triggers
* @return int <0 if KO, 0 if not possible, >0 if OK * @return int <0 if KO, 0 if not possible, >0 if OK
*/ */
function delete($user, $notrigger=0) function delete($user, $notrigger=0)
@ -469,7 +472,8 @@ class Project extends CommonObject
/** /**
* Validate a project * Validate a project
* @param user User that validate *
* @param User $user User that validate
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setValid($user) function setValid($user)
@ -521,7 +525,8 @@ class Project extends CommonObject
/** /**
* Close a project * Close a project
* @param user User that validate *
* @param User $user User that validate
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setClose($user) function setClose($user)
@ -573,9 +578,10 @@ class Project extends CommonObject
} }
/** /**
* \brief Return status label of object * Return status label of object
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto *
* \return string Label * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/ */
function getLibStatut($mode=0) function getLibStatut($mode=0)
{ {
@ -583,10 +589,11 @@ class Project extends CommonObject
} }
/** /**
* \brief Renvoi status label for a status * Renvoi status label for a status
* \param statut id statut *
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $statut id statut
* \return string Label * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
@ -627,10 +634,11 @@ class Project extends CommonObject
} }
/** /**
* \brief Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* \param option Variante ('', 'nolink') * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \return string Chaine avec URL * @param string $option Variante ('', 'nolink')
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {
@ -658,7 +666,9 @@ class Project extends CommonObject
} }
/** /**
* \brief Initialise object with default value to be used as example * Initialise object with default value to be used as example
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
@ -734,9 +744,11 @@ class Project extends CommonObject
} }
/** /**
* \brief Check if user has read permission on project * Check if user has read permission on project
* @param user Object user to evaluate *
* @param noprint 0=Print forbidden message if no permission, 1=Return -1 if no permission * @param User $user Object user to evaluate
* @param int $noprint 0=Print forbidden message if no permission, 1=Return -1 if no permission
* @return void
*/ */
function restrictedProjectArea($user,$noprint=0) function restrictedProjectArea($user,$noprint=0)
{ {
@ -795,11 +807,11 @@ class Project extends CommonObject
/** /**
* Return array of projects a user has permission on, is affected to, or all projects * Return array of projects a user has permission on, is affected to, or all projects
* *
* @param user User object * @param User $user User object
* @param mode 0=All project I have permission on, 1=Projects affected to me only, 2=Will return list of all projects with no test on contacts * @param int $mode 0=All project I have permission on, 1=Projects affected to me only, 2=Will return list of all projects with no test on contacts
* @param list 0=Return array,1=Return string list * @param int $list 0=Return array,1=Return string list
* @param socid 0=No filter on third party, id of third party * @param int $socid 0=No filter on third party, id of third party
* @return array or string * @return array Array of projects
*/ */
function getProjectsAuthorizedForUser($user,$mode=0,$list=0,$socid=0) function getProjectsAuthorizedForUser($user,$mode=0,$list=0,$socid=0)
{ {

View File

@ -77,10 +77,11 @@ class Task extends CommonObject
/** /**
* \brief Create in database * Create into database
* \param user User that create *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that create
* \return int <0 if KO, Id of created object if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger=0) function create($user, $notrigger=0)
{ {
@ -159,9 +160,10 @@ class Task extends CommonObject
/** /**
* \brief Load object in memory from database * Load object in memory from database
* \param id id object *
* \return int <0 if KO, >0 if OK * @param int $id Id object
* @return int <0 if KO, >0 if OK
*/ */
function fetch($id) function fetch($id)
{ {
@ -227,10 +229,11 @@ class Task extends CommonObject
/** /**
* \brief Update database * Update database
* \param user User that modify *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that modify
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=0, $notrigger=0)
{ {
@ -298,10 +301,11 @@ class Task extends CommonObject
/** /**
* \brief Delete object in database * Delete object in database
* \param user User that delete *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that delete
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger=0) function delete($user, $notrigger=0)
{ {
@ -374,8 +378,9 @@ class Task extends CommonObject
} }
/** /**
* \brief Return nb of children * Return nb of children
* \return <0 if KO, 0 if no children, >0 if OK *
* @return int <0 if KO, 0 if no children, >0 if OK
*/ */
function hasChildren() function hasChildren()
{ {
@ -406,10 +411,11 @@ class Task extends CommonObject
/** /**
* \brief Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* \param option Sur quoi pointe le lien * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \return string Chaine avec URL * @param int $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='') function getNomUrl($withpicto=0,$option='')
{ {
@ -431,8 +437,10 @@ class Task extends CommonObject
} }
/** /**
* \brief Initialise object with example values * Initialise object with example values
* \remarks id must be 0 if object instance is a specimen. * id must be 0 if object instance is a specimen.
*
* @return void
*/ */
function initAsSpecimen() function initAsSpecimen()
{ {
@ -450,11 +458,12 @@ class Task extends CommonObject
/** /**
* Return list of tasks for all projects or for one particular project * Return list of tasks for all projects or for one particular project
* Sort order is on project, TODO then of position of task, and last on title of first level task * Sort order is on project, TODO then of position of task, and last on title of first level task
* @param usert Object user to limit tasks affected to a particular user *
* @param userp Object user to limit projects of a particular user and public projects * @param User $usert Object user to limit tasks affected to a particular user
* @param projectid Project id * @param User $userp Object user to limit projects of a particular user and public projects
* @param socid Third party id * @param int $projectid Project id
* @param mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists * @param int $socid Third party id
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
* @return array Array of tasks * @return array Array of tasks
*/ */
function getTasksArray($usert=0, $userp=0, $projectid=0, $socid=0, $mode=0) function getTasksArray($usert=0, $userp=0, $projectid=0, $socid=0, $mode=0)
@ -547,11 +556,12 @@ class Task extends CommonObject
} }
/** /**
* Return list of roles for a user for each projects or each tasks (or a particular project or task) * Return list of roles for a user for each projects or each tasks (or a particular project or task).
* @param userp Return roles on project for this internal user (task id can't be defined) *
* @param usert Return roles on task for this internal user * @param User $userp Return roles on project for this internal user (task id can't be defined)
* @param projectid Project id list separated with , to filter on project * @param User $usert Return roles on task for this internal user
* @param taskid Task id to filter on a task * @param int $projectid Project id list separated with , to filter on project
* @param int $taskid Task id to filter on a task
* @return array Array (projectid => 'list of roles for project' or taskid => 'list of roles for task') * @return array Array (projectid => 'list of roles for project' or taskid => 'list of roles for task')
*/ */
function getUserRolesForProjectsOrTasks($userp,$usert,$projectid='',$taskid=0) function getUserRolesForProjectsOrTasks($userp,$usert,$projectid='',$taskid=0)
@ -623,8 +633,10 @@ class Task extends CommonObject
/** /**
* \brief Return list of id of contacts of task * Return list of id of contacts of task
* \return array Array of id of contacts *
* @param string $source Source
* @return array Array of id of contacts
*/ */
function getListContactId($source='internal') function getListContactId($source='internal')
{ {
@ -644,9 +656,11 @@ class Task extends CommonObject
/** /**
* \brief Add time spent * Add time spent
* \param user user id *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user user id
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return void
*/ */
function addTimeSpent($user, $notrigger=0) function addTimeSpent($user, $notrigger=0)
{ {
@ -713,9 +727,10 @@ class Task extends CommonObject
} }
/** /**
* \brief Load object in memory from database * Load object in memory from database
* \param id id object *
* \return int <0 if KO, >0 if OK * @param int $id Id object
* @return int <0 if KO, >0 if OK
*/ */
function fetchTimeSpent($id) function fetchTimeSpent($id)
{ {
@ -760,9 +775,11 @@ class Task extends CommonObject
} }
/** /**
* \brief Update time spent * Update time spent
* \param user User id *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User id
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function updateTimeSpent($user, $notrigger=0) function updateTimeSpent($user, $notrigger=0)
{ {
@ -820,10 +837,11 @@ class Task extends CommonObject
} }
/** /**
* \brief Delete time spent * Delete time spent
* \param user User that delete *
* \param notrigger 0=launch triggers after, 1=disable triggers * @param User $user User that delete
* \return int <0 if KO, >0 if OK * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function delTimeSpent($user, $notrigger=0) function delTimeSpent($user, $notrigger=0)
{ {