From afdc176f472aa67e667ca481f694c0a5006393ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Oct 2017 08:52:00 +0200 Subject: [PATCH] Fix scrutinizer --- htdocs/adherents/class/subscription.class.php | 2 +- htdocs/api/class/api_documents.class.php | 12 ++++++----- htdocs/blockedlog/class/blockedlog.class.php | 20 +++++++++---------- .../core/class/emailsenderprofile.class.php | 2 ++ htdocs/core/lib/files.lib.php | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index bdb43dd41d3..397be6ee8da 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -216,7 +216,7 @@ class Subscription extends CommonObject $result=$member->fetch($this->fk_adherent); $result=$member->update_end_date($user); - if (is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined) + if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined) { $result=$accountline->delete($user); // Return false if refused because line is conciliated if ($result > 0) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 397910a6e2f..b47584eea99 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -130,18 +130,20 @@ class Documents extends DolibarrApi } /** - * Return the list of documents of an element + * Return the list of documents of a dedicated element (from its ID or Ref) * - * @param string $modulepart Name of module or area concerned ('facture', 'project', 'member', ...) - * @param int $id ID of element + * @param string $modulepart Name of module or area concerned ('facture', 'project', 'member', ...) + * @param int $id ID of element * @param string $ref Ref of element - * @return array Array of documents with path + * @param string $sortfield Sort criteria ('','fullname','relativename','name','date','size') + * @param string $sortorder Sort order ('asc' or 'desc') + * @return array Array of documents with path * * @throws RestException * * @url GET list */ - function getDocumentsListByElement($modulepart, $id=0, $ref='') + function getDocumentsListByElement($modulepart, $id=0, $ref='', $sortfield='', $sortorder='') { global $conf; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 8a1508b7a04..4bce16fb796 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -21,13 +21,15 @@ class BlockedLog { - /** * Id of the log * @var int */ public $id; + public $error = ''; + public $errors = array(); + /** * Unique fingerprint of the log * @var string @@ -78,7 +80,7 @@ class BlockedLog public $object_data = null; - public $error = 0; + /** * Constructor @@ -126,7 +128,7 @@ class BlockedLog /** * try to retrieve user author - */ + */ public function getUser() { global $langs, $cachedUser; @@ -188,8 +190,6 @@ class BlockedLog $this->object_data->amounts = $object->amounts; } - - } /** @@ -231,7 +231,7 @@ class BlockedLog $this->action = $obj->action; $this->element = $obj->element; - $this->fk_object = trim($obj->fk_object); + $this->fk_object = $obj->fk_object; $this->date_object = $this->db->jdate($obj->date_object); $this->ref_object = $obj->ref_object; @@ -432,10 +432,10 @@ class BlockedLog /** * return log object for a element. * - * @param string $element element to search - * @param int $fk_object id of object to search - * @param int $limit max number of element, 0 for all - * @param string $order sort of query + * @param string $element element to search + * @param int $fk_object id of object to search + * @param int $limit max number of element, 0 for all + * @param string $order sort of query * @return array array of object log */ public function getLog($element, $fk_object, $limit = 0, $order = -1) { diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 66e37744cc7..f779e949dc3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -273,6 +273,8 @@ class EmailSenderProfile extends CommonObject $result = ''; $companylink = ''; + $label=$this->label; + $url=''; //$url = dol_buildpath('/monmodule/emailsenderprofile_card.php',1).'?id='.$this->id; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 44a404c6c67..2f59c7e388c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -47,7 +47,7 @@ function dol_basename($pathfile) * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, * but must not contains the start and end '/'. Filter is checked into basename only. * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath. - * @param string $sortcriteria Sort criteria ("","fullname","relativename","name","date","size") + * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @param int $nohook Disable all hooks