';
} else {
- $text .= '
'.$langs->trans("NotAvailable").'
';
+ $text .= '
'.$langs->trans("NotAvailable").'
';
}
}
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index 8e389d862d3..1a879173684 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -108,11 +108,11 @@ class Orders extends DolibarrApi
*
* Return an array with order informations
*
- * @param int $id ID of order
+ * @param int $id ID of order
* @param string $ref Ref of object
* @param string $ref_ext External reference of object
- * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
- * @return array|mixed data without useless information
+ * @param int $contact_list 0: Returned array of contacts/addresses contains all properties, 1: Return array contains just id
+ * @return Object Object with cleaned properties
*
* @throws RestException
*/
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index c9886a176f0..537c7c9acb6 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -122,8 +122,8 @@ class BankAccounts extends DolibarrApi
/**
* Get account by ID.
*
- * @param int $id ID of account
- * @return array Account object
+ * @param int $id ID of account
+ * @return Object Object with cleaned properties
*
* @throws RestException
*/
@@ -313,9 +313,9 @@ class BankAccounts extends DolibarrApi
/**
* Update account
*
- * @param int $id ID of account
- * @param array $request_data data
- * @return int
+ * @param int $id ID of account
+ * @param array $request_data data
+ * @return Object Object with cleaned properties
*/
public function put($id, $request_data = null)
{
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 26fb26d4cdb..7896b26e8b0 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -271,7 +271,7 @@ if (empty($reshook)) {
}
// Delete
- if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer) {
+ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) {
$object->delete($user);
header("Location: ".DOL_URL_ROOT.'/compta/facture/invoicetemplate_list.php');
@@ -1175,8 +1175,8 @@ if ($action == 'create') {
}
// Confirm delete of repeatable invoice
- if ($action == 'ask_deleteinvoice') {
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1);
+ if ($action == 'delete') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_delete', '', 'no', 1);
}
// Call Hook formConfirm
diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php
index 960d2ac4744..4a743e5b070 100644
--- a/htdocs/core/class/comment.class.php
+++ b/htdocs/core/class/comment.class.php
@@ -351,16 +351,18 @@ class Comment extends CommonObject
/**
- * Load comments linked with current task
+ * Load comments linked with current task into ->comments
*
* @param string $element_type Element type
* @param int $fk_element Id of element
- * @return array Comment array
+ * @return int Result
*/
public function fetchAllFor($element_type, $fk_element)
{
global $db, $conf;
+
$this->comments = array();
+
if (!empty($element_type) && !empty($fk_element)) {
$sql = "SELECT";
$sql .= " c.rowid";
diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php
index f2dfb80960e..9c01f133bf6 100644
--- a/htdocs/core/class/evalmath.class.php
+++ b/htdocs/core/class/evalmath.class.php
@@ -198,9 +198,9 @@ class EvalMath
}
/**
- * vars
+ * Function vars
*
- * @return string Output
+ * @return array Output
*/
public function vars()
{
@@ -211,9 +211,9 @@ class EvalMath
}
/**
- * vars
+ * Function funcs
*
- * @return string Output
+ * @return array Output
*/
private function funcs()
{
@@ -229,8 +229,8 @@ class EvalMath
/**
* Convert infix to postfix notation
*
- * @param string $expr Expression
- * @return string Output
+ * @param string $expr Expression
+ * @return boolean|array Output
*/
private function nfx($expr)
{
@@ -367,6 +367,7 @@ class EvalMath
}
$output[] = $op;
}
+
return $output;
}
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 0aa2c39de91..a34861e17d6 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -779,7 +779,7 @@ class FormTicket
* @param string $morecss More CSS
* @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
* @param Translate $outputlangs Output language
- * @return void
+ * @return string|void String of HTML component
*/
public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)
{
@@ -985,7 +985,6 @@ class FormTicket
}
$sql = substr($sql, 0, -2);
$sql .= ")";
- } else {
}
$sql .= $this->db->order('ctc.pos', 'ASC');
diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php
index 79cf9137a99..7198f532358 100644
--- a/htdocs/core/class/openid.class.php
+++ b/htdocs/core/class/openid.class.php
@@ -178,7 +178,7 @@ class SimpleOpenID
/**
* SetOpenIDServer
*
- * @return void
+ * @return array
*/
public function GetError()
{
@@ -225,7 +225,7 @@ class SimpleOpenID
* splitResponse
*
* @param string $response Server
- * @return void
+ * @return array
*/
public function splitResponse($response)
{
diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php
index 0c62be0a85a..30b3ea76975 100644
--- a/htdocs/core/db/DoliDB.class.php
+++ b/htdocs/core/db/DoliDB.class.php
@@ -75,7 +75,7 @@ abstract class DoliDB implements Database
/**
- * Return the DB prefix found into prefix_db (if it was set manually by doing $db->prefix_db=...).
+ * Return the DB prefix found into prefix_db (if it was set manually by doing $dbhandler->prefix_db=...).
* Otherwise return MAIN_DB_PREFIX (common use).
*
* @return string The DB prefix
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index ff5283e2bb8..eac6e0261ee 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -907,7 +907,7 @@ class pdf_azur extends ModelePDFPropales
* @param Propal $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
- * @return void
+ * @return int
*/
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 8e25a227ad7..ff90b500969 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -744,7 +744,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @param Object $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
- * @return void
+ * @return int
*/
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index 99212988488..59192bc5ca5 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -145,13 +145,12 @@ if ($result) {
$establishmentstatic->label = $obj->label;
$establishmentstatic->status = $obj->status;
-
print '
';
print '| '.$establishmentstatic->getNomUrl(1).' | ';
- print ''.$obj->label.' | ';
- print ''.$obj->address.' | ';
- print ''.$obj->zip.' | ';
- print ''.$obj->town.' | ';
+ print ''.dol_escape_htmltag($obj->label).' | ';
+ print ''.dol_escape_htmltag($obj->address).' | ';
+ print ''.dol_escape_htmltag($obj->zip).' | ';
+ print ''.dol_escape_htmltag($obj->town).' | ';
print '';
print $establishmentstatic->getLibStatut(5);
print ' | ';
@@ -160,7 +159,7 @@ if ($result) {
$i++;
}
} else {
- print '
| '.$langs->trans("None").' |
';
+ print '
| '.$langs->trans("None").' |
';
}
print '';
diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang
index 966f2399a13..592009b8697 100644
--- a/htdocs/langs/en_US/hrm.lang
+++ b/htdocs/langs/en_US/hrm.lang
@@ -86,7 +86,7 @@ SaveAddSkill = Skill(s) added
SaveLevelSkill = Skill(s) level saved
DeleteSkill = Skill removed
SkillsExtraFields=Attributs supplémentaires (Compétences)
-JobsExtraFields=Attributs supplémentaires (Emplois)
+JobsExtraFields=Attributs supplémentaires (Job profile)
EvaluationsExtraFields=Attributs supplémentaires (Evaluations)
NeedBusinessTravels=Need business travels
NoDescription=No description
\ No newline at end of file
diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php
index 6a18057afd5..8cbb3949cd5 100644
--- a/htdocs/projet/class/api_projects.class.php
+++ b/htdocs/projet/class/api_projects.class.php
@@ -29,7 +29,6 @@
*/
class Projects extends DolibarrApi
{
-
/**
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
@@ -267,10 +266,9 @@ class Projects extends DolibarrApi
*
* @param int $id Id of project
* @param int $userid Id of user (0 = connected user)
+ * @return array
*
* @url GET {id}/roles
- *
- * @return int
*/
public function getRoles($id, $userid = 0)
{
@@ -301,6 +299,7 @@ class Projects extends DolibarrApi
foreach ($this->project->roles as $line) {
array_push($result, $this->_cleanObjectDatas($line));
}
+
return $result;
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 57235d491da..79ea13dcd40 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -1480,7 +1480,7 @@ class Project extends CommonObject
* @param int $list 0=Return array, 1=Return string list
* @param int $socid 0=No filter on third party, id of third party
* @param string $filter additionnal filter on project (statut, ref, ...)
- * @return array or string Array of projects id, or string with projects id separated with "," if list is 1
+ * @return array|string Array of projects id, or string with projects id separated with "," if list is 1
*/
public function getProjectsAuthorizedForUser($user, $mode = 0, $list = 0, $socid = 0, $filter = '')
{
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 94ed0edaffd..3c8597cd862 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -88,6 +88,10 @@ $search_company = GETPOST('$search_company', 'alpha');
$search_company_alias = GETPOST('$search_company_alias', 'alpha');
$search_project_ref = GETPOST('$search_project_ref', 'alpha');
$search_project_label = GETPOST('$search_project_label', 'alpha');
+$search_timespent_starthour = GETPOSTINT("search_timespent_duration_starthour");
+$search_timespent_startmin = GETPOSTINT("search_timespent_duration_startmin");
+$search_timespent_endhour = GETPOSTINT("search_timespent_duration_endhour");
+$search_timespent_endmin = GETPOSTINT("search_timespent_duration_endmin");
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -196,6 +200,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_product_ref = '';
$toselect = array();
$search_array_options = array();
+ $search_timespent_starthour = '';
+ $search_timespent_startmin = '';
+ $search_timespent_endhour = '';
+ $search_timespent_endmin = '';
$action = '';
}
@@ -1337,6 +1345,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if ($search_date_endyear) {
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
+ if ($search_timespent_starthour) {
+ $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour);
+ }
+ if ($search_timespent_startmin) {
+ $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin);
+ }
+ if ($search_timespent_endhour) {
+ $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour);
+ }
+ if ($search_timespent_endmin) {
+ $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin);
+ }
/*
// Add $param from extra fields
@@ -1609,6 +1629,20 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
$sql .= " AND t.task_date <= '".$db->idate($search_date_end)."'";
}
+ if (!empty($arrayfields['t.task_duration']['checked'])) {
+ if ($search_timespent_starthour || $search_timespent_startmin) {
+ $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds
+ $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds
+ $sql .= " AND t.task_duration >= " . $timespent_duration_start;
+ }
+
+ if ($search_timespent_endhour || $search_timespent_endmin) {
+ $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds
+ $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds
+ $sql .= " AND t.task_duration <= " . $timespent_duration_end;
+ }
+ }
+
$sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year);
// Add where from hooks
@@ -1877,7 +1911,26 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
}
// Duration
if (!empty($arrayfields['t.task_duration']['checked'])) {
- print '
| ';
+ // Duration - Time spent
+ print '
';
+
+ $durationtouse_start = 0;
+ if ($search_timespent_starthour || $search_timespent_startmin) {
+ $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60);
+ }
+ print ' '.$langs->trans('from').' ';
+ $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text');
+ print ' ';
+
+ $durationtouse_end = 0;
+ if ($search_timespent_endhour || $search_timespent_endmin) {
+ $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60);
+ }
+ print ''.$langs->trans('at').' ';
+ $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text');
+ print ' ';
+
+ print ' | ';
}
// Product
if (!empty($arrayfields['t.fk_product']['checked'])) {
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index cd69b2c6420..ece50e0c6dd 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -2369,7 +2369,7 @@ class Ticket extends CommonObject
/**
* Add new message on a ticket (private/public area).
- * Can also send it be email if GETPOST('send_email', 'int') is set. For such email, header and footer is added.
+ * Can also send it by email if GETPOST('send_email', 'int') is set. For such email, header and footer is added.
*
* @param User $user User for action
* @param string $action Action string
@@ -2438,8 +2438,13 @@ class Ticket extends CommonObject
* Send emails to assigned users (public area notification)
*/
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) {
+ // Retrieve internal contact datas
+ $internal_contacts = $object->getInfosTicketInternalContact();
+
$assigned_user_dont_have_email = '';
+
$sendto = array();
+
if ($this->fk_user_assign > 0) {
$assigned_user = new User($this->db);
$assigned_user->fetch($this->fk_user_assign);
@@ -2449,6 +2454,21 @@ class Ticket extends CommonObject
$assigned_user_dont_have_email = $assigned_user->getFullName($langs);
}
}
+
+ // Build array to display recipient list
+ foreach ($internal_contacts as $key => $info_sendto) {
+ // Avoid duplicate notifications
+ if ($info_sendto['id'] == $user->id) {
+ continue;
+ }
+
+ if ($info_sendto['email'] != '') {
+ if (!empty($info_sendto['email'])) {
+ $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">";
+ }
+ }
+ }
+
if (empty($sendto)) {
if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) {
$sendto[] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL;
@@ -2545,7 +2565,7 @@ class Ticket extends CommonObject
if ($info_sendto['email'] != '') {
if (!empty($info_sendto['email'])) {
- $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
+ $sendto[] = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'])." <".$info_sendto['email'].">";
}
// Contact type
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 5c0f3f15b45..a4d4c7acfe6 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -3489,7 +3489,7 @@ class User extends CommonObject
*
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
* @param string $filter SQL filter on users. This parameter must not come from user intput.
- * @return array Array of users $this->users. Note: $this->parentof is also set.
+ * @return array|int Array of users $this->users. Note: $this->parentof is also set.
*/
public function get_full_tree($deleteafterid = 0, $filter = '')
{
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 849b08bc7f6..71339991172 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -180,9 +180,9 @@ class UserGroup extends CommonObject
/**
* Return array of groups objects for a particular user
*
- * @param int $userid User id to search
- * @param boolean $load_members Load all members of the group
- * @return array Array of groups objects
+ * @param int $userid User id to search
+ * @param boolean $load_members Load all members of the group
+ * @return array|int Array of groups objects
*/
public function listGroupsForUser($userid, $load_members = true)
{
@@ -544,7 +544,7 @@ class UserGroup extends CommonObject
* Charge dans l'objet group, la liste des permissions auquels le groupe a droit
*
* @param string $moduletag Name of module we want permissions ('' means all)
- * @return int <0 if KO, >0 if OK
+ * @return int <0 if KO, >=0 if OK
*/
public function getrights($moduletag = '')
{
@@ -552,12 +552,12 @@ class UserGroup extends CommonObject
if ($moduletag && isset($this->_tab_loaded[$moduletag]) && $this->_tab_loaded[$moduletag]) {
// Rights for this module are already loaded, so we leave
- return;
+ return 0;
}
if (!empty($this->all_permissions_are_loaded)) {
// We already loaded all rights for this group, so we leave
- return;
+ return 0;
}
/*