From f45f1f6cfd787179c8acb590a7954ad452a1d00d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2024 15:00:08 +0100 Subject: [PATCH 01/22] Fix separator block for modulebuilder --- htdocs/modulebuilder/template/class/api_mymodule.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index e29e1a08911ff..7ff746c21fb13 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -54,7 +54,7 @@ public function __construct() $this->myobject = new MyObject($this->db); } - /*begin methods CRUD*/ + /* BEGIN MODULEBUILDER API MYOBJECT */ /** * Get properties of a myobject object @@ -336,7 +336,9 @@ private function _validate($data) return $myobject; } - /*end methods CRUD*/ + /* END MODULEBUILDER API MYOBJECT */ + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** From fb16af02b4940661f3e7de3e164663b22eba427a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 11:00:19 +0100 Subject: [PATCH 02/22] Clean code. Move member type API in good file. --- htdocs/adherents/class/api_members.class.php | 323 ++++++++++++++++- .../class/api_memberstypes.class.php | 343 ------------------ .../template/class/api_mymodule.class.php | 15 +- 3 files changed, 319 insertions(+), 362 deletions(-) delete mode 100644 htdocs/adherents/class/api_memberstypes.class.php diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index d551f6b5af9dd..7603a19b3c289 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -24,6 +24,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; /** * API class for members @@ -452,18 +453,63 @@ protected function _cleanObjectDatas($object) $object = parent::_cleanObjectDatas($object); // Remove the subscriptions because they are handled as a subresource. - unset($object->subscriptions); - unset($object->fk_incoterms); - unset($object->label_incoterms); - unset($object->location_incoterms); - unset($object->fk_delivery_address); - unset($object->shipping_method_id); - - unset($object->total_ht); - unset($object->total_ttc); - unset($object->total_tva); - unset($object->total_localtax1); - unset($object->total_localtax2); + if ($object instanceof Adherent) { + unset($object->subscriptions); + unset($object->fk_incoterms); + unset($object->label_incoterms); + unset($object->location_incoterms); + unset($object->fk_delivery_address); + unset($object->shipping_method_id); + + unset($object->total_ht); + unset($object->total_ttc); + unset($object->total_tva); + unset($object->total_localtax1); + unset($object->total_localtax2); + } + + if ($object instanceof AdherentType) { + unset($object->array_options); + unset($object->linkedObjectsIds); + unset($object->context); + unset($object->canvas); + unset($object->fk_project); + unset($object->contact); + unset($object->contact_id); + unset($object->thirdparty); + unset($object->user); + unset($object->origin); + unset($object->origin_id); + unset($object->ref_ext); + unset($object->country); + unset($object->country_id); + unset($object->country_code); + unset($object->barcode_type); + unset($object->barcode_type_code); + unset($object->barcode_type_label); + unset($object->barcode_type_coder); + unset($object->mode_reglement_id); + unset($object->cond_reglement_id); + unset($object->cond_reglement); + unset($object->fk_delivery_address); + unset($object->shipping_method_id); + unset($object->model_pdf); + unset($object->fk_account); + unset($object->note_public); + unset($object->note_private); + unset($object->fk_incoterms); + unset($object->label_incoterms); + unset($object->location_incoterms); + unset($object->name); + unset($object->lastname); + unset($object->firstname); + unset($object->civility_id); + unset($object->total_ht); + unset($object->total_tva); + unset($object->total_localtax1); + unset($object->total_localtax2); + unset($object->total_ttc); + } return $object; } @@ -565,4 +611,257 @@ public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $ return $result; } + + + + + /** + * Get properties of a member type object + * + * Return an array with member type information + * + * @param int $id ID of member type + * @return Object Object with cleaned properties + * + * @url GET /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + */ + public function getType($id) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + $membertype = new AdherentType($this->db); + $result = $membertype->fetch($id); + if (!$result) { + throw new RestException(404, 'member type not found'); + } + + if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + return $this->_cleanObjectDatas($membertype); + } + + /** + * List members types + * + * Get a list of members types + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.libelle:like:'SO-%') and (t.subscription:=:'1')" + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @return array Array of member type objects + * + * @url GET /types/ + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 503 Error when retrieving Member list + */ + public function indexType($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') + { + $obj_ret = array(); + + if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { + throw new RestException(403); + } + + $sql = "SELECT t.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_type_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields + $sql .= ' WHERE t.entity IN ('.getEntity('member_type').')'; + + // Add sql filters + if ($sqlfilters) { + $errormessage = ''; + $sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage); + if ($errormessage) { + throw new RestException(503, 'Error when validating parameter sqlfilters -> '.$errormessage); + } + } + + $sql .= $this->db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit + 1, $offset); + } + + $result = $this->db->query($sql); + if ($result) { + $i = 0; + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + while ($i < $min) { + $obj = $this->db->fetch_object($result); + $membertype = new AdherentType($this->db); + if ($membertype->fetch($obj->rowid)) { + $obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($membertype), $properties); + } + $i++; + } + } else { + throw new RestException(503, 'Error when retrieve member type list : '.$this->db->lasterror()); + } + + return $obj_ret; + } + + /** + * Create member type object + * + * @param array $request_data Request data + * @return int ID of member type + * + * @url POST /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 500 Error when creating Member Type + */ + public function postType($request_data = null) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { + throw new RestException(403); + } + // Check mandatory fields + $result = $this->_validateType($request_data); + + $membertype = new AdherentType($this->db); + foreach ($request_data as $field => $value) { + if ($field === 'caller') { + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller + $membertype->context['caller'] = $request_data['caller']; + continue; + } + + $membertype->$field = $value; + } + if ($membertype->create(DolibarrApiAccess::$user) < 0) { + throw new RestException(500, 'Error creating member type', array_merge(array($membertype->error), $membertype->errors)); + } + return $membertype->id; + } + + /** + * Update member type + * + * @param int $id ID of member type to update + * @param array $request_data Datas + * @return Object Updated object + * + * @url PUT /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 500 Error when updating Member Type + */ + public function putType($id, $request_data = null) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { + throw new RestException(403); + } + + $membertype = new AdherentType($this->db); + $result = $membertype->fetch($id); + if (!$result) { + throw new RestException(404, 'member type not found'); + } + + if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + foreach ($request_data as $field => $value) { + if ($field == 'id') { + continue; + } + if ($field === 'caller') { + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller + $membertype->context['caller'] = $request_data['caller']; + continue; + } + + // Process the status separately because it must be updated using + // the validate(), resiliate() and exclude() methods of the class AdherentType. + $membertype->$field = $value; + } + + // If there is no error, update() returns the number of affected rows + // so if the update is a no op, the return value is zero. + if ($membertype->update(DolibarrApiAccess::$user) >= 0) { + return $this->get($id); + } else { + throw new RestException(500, 'Error when updating member type: '.$membertype->error); + } + } + + /** + * Delete member type + * + * @param int $id member type ID + * @return array + * + * @url GET /types/{id} + * + * @throws RestException 403 Access denied + * @throws RestException 404 No Member Type found + * @throws RestException 500 Error when deleting Member Type + */ + public function deleteType($id) + { + if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { + throw new RestException(403); + } + $membertype = new AdherentType($this->db); + $result = $membertype->fetch($id); + if (!$result) { + throw new RestException(404, 'member type not found'); + } + + if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $res = $membertype->delete(DolibarrApiAccess::$user); + if ($res < 0) { + throw new RestException(500, "Can't delete, error occurs"); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Member type deleted' + ) + ); + } + + /** + * Validate fields before creating an object + * + * @param array|null $data Data to validate + * @return array + * + * @throws RestException + */ + private function _validateType($data) + { + $membertype = array(); + foreach (MembersTypes::$FIELDS as $field) { + if (!isset($data[$field])) { + throw new RestException(400, "$field field missing"); + } + $membertype[$field] = $data[$field]; + } + return $membertype; + } } diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php deleted file mode 100644 index c3d0e374746cc..0000000000000 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ /dev/null @@ -1,343 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -use Luracast\Restler\RestException; - -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; - -/** - * API class for members types - * - * @access protected - * @class DolibarrApiAccess {@requires user,external} - */ -class MembersTypes extends DolibarrApi -{ - /** - * @var array $FIELDS Mandatory fields, checked when create and update object - */ - public static $FIELDS = array( - 'label', - ); - - /** - * Constructor - */ - public function __construct() - { - global $db, $conf; - $this->db = $db; - } - - /** - * Get properties of a member type object - * - * Return an array with member type information - * - * @param int $id ID of member type - * @return Object Object with cleaned properties - * - * @throws RestException 403 Access denied - * @throws RestException 404 No Member Type found - */ - public function get($id) - { - if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { - throw new RestException(403); - } - - $membertype = new AdherentType($this->db); - $result = $membertype->fetch($id); - if (!$result) { - throw new RestException(404, 'member type not found'); - } - - if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - return $this->_cleanObjectDatas($membertype); - } - - /** - * List members types - * - * Get a list of members types - * - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit for list - * @param int $page Page number - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.libelle:like:'SO-%') and (t.subscription:=:'1')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names - * @return array Array of member type objects - * - * @throws RestException 403 Access denied - * @throws RestException 404 No Member Type found - * @throws RestException 503 Error when retrieving Member list - */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') - { - global $db, $conf; - - $obj_ret = array(); - - if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) { - throw new RestException(403); - } - - $sql = "SELECT t.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type AS t LEFT JOIN ".MAIN_DB_PREFIX."adherent_type_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields - $sql .= ' WHERE t.entity IN ('.getEntity('member_type').')'; - - // Add sql filters - if ($sqlfilters) { - $errormessage = ''; - $sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage); - if ($errormessage) { - throw new RestException(503, 'Error when validating parameter sqlfilters -> '.$errormessage); - } - } - - $sql .= $this->db->order($sortfield, $sortorder); - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - - $sql .= $this->db->plimit($limit + 1, $offset); - } - - $result = $this->db->query($sql); - if ($result) { - $i = 0; - $num = $this->db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - while ($i < $min) { - $obj = $this->db->fetch_object($result); - $membertype = new AdherentType($this->db); - if ($membertype->fetch($obj->rowid)) { - $obj_ret[] = $this->_filterObjectProperties($this->_cleanObjectDatas($membertype), $properties); - } - $i++; - } - } else { - throw new RestException(503, 'Error when retrieve member type list : '.$this->db->lasterror()); - } - - return $obj_ret; - } - - /** - * Create member type object - * - * @param array $request_data Request data - * @return int ID of member type - * - * @throws RestException 403 Access denied - * @throws RestException 500 Error when creating Member Type - */ - public function post($request_data = null) - { - if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { - throw new RestException(403); - } - // Check mandatory fields - $result = $this->_validate($request_data); - - $membertype = new AdherentType($this->db); - foreach ($request_data as $field => $value) { - if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller - $membertype->context['caller'] = $request_data['caller']; - continue; - } - - $membertype->$field = $value; - } - if ($membertype->create(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, 'Error creating member type', array_merge(array($membertype->error), $membertype->errors)); - } - return $membertype->id; - } - - /** - * Update member type - * - * @param int $id ID of member type to update - * @param array $request_data Datas - * @return Object Updated object - * - * @throws RestException 403 Access denied - * @throws RestException 404 No Member Type found - * @throws RestException 500 Error when updating Member Type - */ - public function put($id, $request_data = null) - { - if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { - throw new RestException(403); - } - - $membertype = new AdherentType($this->db); - $result = $membertype->fetch($id); - if (!$result) { - throw new RestException(404, 'member type not found'); - } - - if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - foreach ($request_data as $field => $value) { - if ($field == 'id') { - continue; - } - if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller - $membertype->context['caller'] = $request_data['caller']; - continue; - } - - // Process the status separately because it must be updated using - // the validate(), resiliate() and exclude() methods of the class AdherentType. - $membertype->$field = $value; - } - - // If there is no error, update() returns the number of affected rows - // so if the update is a no op, the return value is zero. - if ($membertype->update(DolibarrApiAccess::$user) >= 0) { - return $this->get($id); - } else { - throw new RestException(500, 'Error when updating member type: '.$membertype->error); - } - } - - /** - * Delete member type - * - * @param int $id member type ID - * @return array - * - * @throws RestException 403 Access denied - * @throws RestException 404 No Member Type found - * @throws RestException 500 Error when deleting Member Type - */ - public function delete($id) - { - if (!DolibarrApiAccess::$user->hasRight('adherent', 'configurer')) { - throw new RestException(403); - } - $membertype = new AdherentType($this->db); - $result = $membertype->fetch($id); - if (!$result) { - throw new RestException(404, 'member type not found'); - } - - if (!DolibarrApi::_checkAccessToResource('member', $membertype->id, 'adherent_type')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - $res = $membertype->delete(DolibarrApiAccess::$user); - if ($res < 0) { - throw new RestException(500, "Can't delete, error occurs"); - } - - return array( - 'success' => array( - 'code' => 200, - 'message' => 'Member type deleted' - ) - ); - } - - /** - * Validate fields before creating an object - * - * @param array|null $data Data to validate - * @return array - * - * @throws RestException - */ - private function _validate($data) - { - $membertype = array(); - foreach (MembersTypes::$FIELDS as $field) { - if (!isset($data[$field])) { - throw new RestException(400, "$field field missing"); - } - $membertype[$field] = $data[$field]; - } - return $membertype; - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore - /** - * Clean sensible object datas - * - * @param Object $object Object to clean - * @return Object Object with cleaned properties - */ - protected function _cleanObjectDatas($object) - { - // phpcs:enable - $object = parent::_cleanObjectDatas($object); - - unset($object->array_options); - unset($object->linkedObjectsIds); - unset($object->context); - unset($object->canvas); - unset($object->fk_project); - unset($object->contact); - unset($object->contact_id); - unset($object->thirdparty); - unset($object->user); - unset($object->origin); - unset($object->origin_id); - unset($object->ref_ext); - unset($object->country); - unset($object->country_id); - unset($object->country_code); - unset($object->barcode_type); - unset($object->barcode_type_code); - unset($object->barcode_type_label); - unset($object->barcode_type_coder); - unset($object->mode_reglement_id); - unset($object->cond_reglement_id); - unset($object->cond_reglement); - unset($object->fk_delivery_address); - unset($object->shipping_method_id); - unset($object->model_pdf); - unset($object->fk_account); - unset($object->note_public); - unset($object->note_private); - unset($object->fk_incoterms); - unset($object->label_incoterms); - unset($object->location_incoterms); - unset($object->name); - unset($object->lastname); - unset($object->firstname); - unset($object->civility_id); - unset($object->total_ht); - unset($object->total_tva); - unset($object->total_localtax1); - unset($object->total_localtax2); - unset($object->total_ttc); - - return $object; - } -} diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 7ff746c21fb13..d716869cfccc6 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -54,6 +54,7 @@ public function __construct() $this->myobject = new MyObject($this->db); } + /* BEGIN MODULEBUILDER API MYOBJECT */ /** @@ -64,7 +65,7 @@ public function __construct() * @param int $id ID of myobject * @return Object Object with cleaned properties * - * @url GET mymodule/myobjects/{id} + * @url GET myobjects/{id} * * @throws RestException 403 Not allowed * @throws RestException 404 Not found @@ -103,7 +104,7 @@ public function get($id) * @throws RestException 403 Not allowed * @throws RestException 503 System error * - * @url GET /mymodule/myobjects/ + * @url GET /myobjects/ */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '') { @@ -191,7 +192,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, * @throws RestException 403 Not allowed * @throws RestException 500 System error * - * @url POST mymodule/myobjects/ + * @url POST myobjects/ */ public function post($request_data = null) { @@ -200,7 +201,7 @@ public function post($request_data = null) } // Check mandatory fields - $result = $this->_validate($request_data); + $result = $this->_validateMyObject($request_data); foreach ($request_data as $field => $value) { if ($field === 'caller') { @@ -232,7 +233,7 @@ public function post($request_data = null) * @throws RestException 404 Not found * @throws RestException 500 System error * - * @url PUT mymodule/myobjects/{id} + * @url PUT myobjects/{id} */ public function put($id, $request_data = null) { @@ -282,7 +283,7 @@ public function put($id, $request_data = null) * @throws RestException 409 Nothing to do * @throws RestException 500 System error * - * @url DELETE mymodule/myobjects/{id} + * @url DELETE myobjects/{id} */ public function delete($id) { @@ -321,7 +322,7 @@ public function delete($id) * * @throws RestException */ - private function _validate($data) + private function _validateMyObject($data) { $myobject = array(); foreach ($this->myobject->fields as $field => $propfield) { From 3583c4aeea317aac23d58cd02d1e1dc4e6d3c1d6 Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 8 Mar 2024 12:09:32 +0100 Subject: [PATCH 03/22] NEW updated resource list for new fields (#28705) * Added address, zip & town * Added state & country * Added phone, email, max_users & url * Added link formatting. Cleaned code. * Updated EN & FR localization * Added country select list * Cleaned code --- htdocs/langs/en_US/resource.lang | 1 + htdocs/langs/fr_FR/resource.lang | 1 + htdocs/resource/list.php | 297 +++++++++++++++++++++++++++++-- 3 files changed, 282 insertions(+), 17 deletions(-) diff --git a/htdocs/langs/en_US/resource.lang b/htdocs/langs/en_US/resource.lang index 252537f002291..8f117e93bc900 100644 --- a/htdocs/langs/en_US/resource.lang +++ b/htdocs/langs/en_US/resource.lang @@ -39,3 +39,4 @@ ErrorResourcesAlreadyInUse=Some resources are in use ErrorResourceUseInEvent=%s used in %s event MaxUsers=Maximum users (places, seats, etc.) +MaxUsersLabel=Maximum users diff --git a/htdocs/langs/fr_FR/resource.lang b/htdocs/langs/fr_FR/resource.lang index 044f23f33ebce..47ab778195312 100644 --- a/htdocs/langs/fr_FR/resource.lang +++ b/htdocs/langs/fr_FR/resource.lang @@ -39,3 +39,4 @@ ErrorResourcesAlreadyInUse=Certaines ressources sont utilisées ErrorResourceUseInEvent=%s utilisé dans l'événement %s MaxUsers=Utilisateurs maximum (places, sièges, etc.) +MaxUsersLabel=Utilisateurs maximum diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 0f149263baa74..33f21aa75bb96 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -61,8 +61,17 @@ if (!is_array($search_array_options)) { $search_array_options = array(); } -$search_ref = GETPOST("search_ref", 'alpha'); -$search_type = GETPOST("search_type", 'alpha'); +$search_ref = GETPOST("search_ref", 'alpha'); +$search_type = GETPOST("search_type", 'alpha'); +$search_address = GETPOST("search_address", 'alpha'); +$search_zip = GETPOST("search_zip", 'alpha'); +$search_town = GETPOST("search_town", 'alpha'); +$search_state = GETPOST("search_state", 'alpha'); +$search_country = GETPOST("search_country", 'alpha'); +$search_phone = GETPOST("search_phone", 'alpha'); +$search_email = GETPOST("search_email", 'alpha'); +$search_max_users = GETPOST("search_max_users", 'alpha'); +$search_url = GETPOST("search_url", 'alpha'); $filter = array(); @@ -87,14 +96,61 @@ $pagenext = $page + 1; $arrayfields = array( - 't.ref' => array( - 'label' => $langs->trans("Ref"), - 'checked' => 1 - ), - 'ty.label' => array( - 'label' => $langs->trans("ResourceType"), - 'checked' => 1 - ), + 't.ref' => array( + 'label' => $langs->trans("Ref"), + 'checked' => 1, + 'position' => 1 + ), + 'ty.label' => array( + 'label' => $langs->trans("Type"), + 'checked' => 1, + 'position' => 2 + ), + 't.address' => array( + 'label' => $langs->trans("Address"), + 'checked' => 0, + 'position' => 3 + ), + 't.zip' => array( + 'label' => $langs->trans("Zip"), + 'checked' => 0, + 'position' => 4 + ), + 't.town' => array( + 'label' => $langs->trans("Town"), + 'checked' => 1, + 'position' => 5 + ), + 'st.nom' => array( + 'label' => $langs->trans("State"), + 'checked' => 0, + 'position' => 6 + ), + 'co.label' => array( + 'label' => $langs->trans("Country"), + 'checked' => 1, + 'position' => 7 + ), + 't.phone' => array( + 'label' => $langs->trans("Phone"), + 'checked' => 0, + 'position' => 8 + ), + 't.email' => array( + 'label' => $langs->trans("Email"), + 'checked' => 0, + 'position' => 9 + ), + 't.max_users' => array( + 'label' => $langs->trans("MaxUsersLabel"), + 'checked' => 1, + 'position' => 10 + ), + 't.url' => array( + 'label' => $langs->trans("URL"), + 'checked' => 0, + 'position' => 11 + ), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -108,6 +164,15 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers $search_ref = ""; $search_type = ""; + $search_address = ""; + $search_zip = ""; + $search_town = ""; + $search_state = ""; + $search_country = ""; + $search_phone = ""; + $search_email = ""; + $search_max_users = ""; + $search_url = ""; $toselect = array(); $search_array_options = array(); } @@ -175,7 +240,9 @@ $sql .= " t.fk_code_type_resource,"; $sql .= " t.tms as date_modification,"; $sql .= " t.datec as date_creation, "; -$sql .= " ty.label as type_label "; +$sql .= " ty.label as type_label, "; +$sql .= " st.nom as state_label, "; +$sql .= " co.label as country_label "; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -191,6 +258,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX."resource as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_resource as ty ON ty.code=t.fk_code_type_resource"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as st ON st.rowid=t.fk_state"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid=t.fk_country"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } @@ -207,6 +276,33 @@ if ($search_type) { $sql .= natural_search('ty.label', $search_type); } +if ($search_address) { + $sql .= natural_search('t.address', $search_address); +} +if ($search_zip) { + $sql .= natural_search('t.zip', $search_zip); +} +if ($search_town) { + $sql .= natural_search('t.town', $search_town); +} +if ($search_state) { + $sql .= natural_search('st.nom', $search_state); +} +if ($search_country && $search_country != '-1') { + $sql .= " AND t.fk_country IN (".$db->sanitize($search_country).')'; +} +if ($search_phone) { + $sql .= natural_search('t.phone', $search_phone); +} +if ($search_email) { + $sql .= natural_search('t.email', $search_email); +} +if ($search_max_users) { + $sql .= natural_search('t.max_users', $search_max_users, 1); +} +if ($search_url) { + $sql .= natural_search('t.url', $search_url); +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -277,6 +373,33 @@ if ($search_type != '') { $param .= '&search_type='.urlencode($search_type); } +if ($search_address != '') { + $param .= '&search_address='.urlencode($search_address); +} +if ($search_zip != '') { + $param .= '&search_zip='.urlencode($search_zip); +} +if ($search_town != '') { + $param .= '&search_town='.urlencode($search_town); +} +if ($search_state != '') { + $param .= '&search_state='.urlencode($search_state); +} +if ($search_country != '') { + $param .= '&search_country='.urlencode($search_country); +} +if ($search_phone != '') { + $param .= '&search_phone='.urlencode($search_phone); +} +if ($search_email != '') { + $param .= '&search_email='.urlencode($search_email); +} +if ($search_max_users != '') { + $param .= '&search_max_users='.urlencode($search_max_users); +} +if ($search_url != '') { + $param .= '&search_url='.urlencode($search_url); +} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -337,6 +460,51 @@ print ''; print ''; } +if (!empty($arrayfields['t.address']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['t.zip']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['t.town']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['st.nom']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['co.label']['checked'])) { + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); + print ''; +} +if (!empty($arrayfields['t.phone']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['t.email']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['t.max_users']['checked'])) { + print ''; + print ''; + print ''; +} +if (!empty($arrayfields['t.url']['checked'])) { + print ''; + print ''; + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -361,6 +529,33 @@ if (!empty($arrayfields['ty.label']['checked'])) { print_liste_field_titre($arrayfields['ty.label']['label'], $_SERVER["PHP_SELF"], "ty.label", "", $param, "", $sortfield, $sortorder); } +if (!empty($arrayfields['t.address']['checked'])) { + print_liste_field_titre($arrayfields['t.address']['label'], $_SERVER["PHP_SELF"], "t.address", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.zip']['checked'])) { + print_liste_field_titre($arrayfields['t.zip']['label'], $_SERVER["PHP_SELF"], "t.zip", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.town']['checked'])) { + print_liste_field_titre($arrayfields['t.town']['label'], $_SERVER["PHP_SELF"], "t.town", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['st.nom']['checked'])) { + print_liste_field_titre($arrayfields['st.nom']['label'], $_SERVER["PHP_SELF"], "st.nom", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['co.label']['checked'])) { + print_liste_field_titre($arrayfields['co.label']['label'], $_SERVER["PHP_SELF"], "co.label", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.phone']['checked'])) { + print_liste_field_titre($arrayfields['t.phone']['label'], $_SERVER["PHP_SELF"], "t.phone", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.email']['checked'])) { + print_liste_field_titre($arrayfields['t.email']['label'], $_SERVER["PHP_SELF"], "t.email", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.max_users']['checked'])) { + print_liste_field_titre($arrayfields['t.max_users']['label'], $_SERVER["PHP_SELF"], "t.max_users", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.url']['checked'])) { + print_liste_field_titre($arrayfields['t.url']['label'], $_SERVER["PHP_SELF"], "t.url", "", $param, "", $sortfield, $sortorder); +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Action column @@ -381,22 +576,90 @@ $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; $objectstatic->type_label = $obj->type_label; + $objectstatic->address = $obj->address; + $objectstatic->zip = $obj->zip; + $objectstatic->town = $obj->town; + $objectstatic->state = $obj->state_label; + $objectstatic->country = $obj->country_label; + $objectstatic->phone = $obj->phone; + $objectstatic->email = $obj->email; + $objectstatic->max_users = $obj->max_users; + $objectstatic->url = $obj->url; print ''; if (!empty($arrayfields['t.ref']['checked'])) { - print ''; - print $objectstatic->getNomUrl(5); - print ''; + print ''.$objectstatic->getNomUrl(5).''; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['ty.label']['checked'])) { - print ''; - print $objectstatic->type_label; - print ''; + print ''.$objectstatic->type_label.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.address']['checked'])) { + print ''.$objectstatic->address.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.zip']['checked'])) { + print ''.$objectstatic->zip.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.town']['checked'])) { + print ''.$objectstatic->town.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['st.nom']['checked'])) { + print ''.$objectstatic->state.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['co.label']['checked'])) { + print ''.$objectstatic->country.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.phone']['checked'])) { + print ''.dol_print_phone($objectstatic->phone, '', 0, 0, 'AC_TEL', " ", 'phone').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.email']['checked'])) { + print ''.dol_print_email($objectstatic->email, 0, 0, 1, 0, 0, 1).''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.max_users']['checked'])) { + print ''.$objectstatic->max_users.''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.url']['checked'])) { + print ''.dol_print_url($objectstatic->url, '_blank', 32, 1).''; if (!$i) { $totalarray['nbfield']++; } From 231703e5d1e435bb3077e1a63372b32390c7f1a2 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 8 Mar 2024 12:09:49 +0100 Subject: [PATCH 04/22] qual: phpstan for htdocs/loan/class/paymentloan.class.php (#28704) htdocs/loan/class/paymentloan.class.php 155 Property PaymentLoan::$num_payment (string) does not accept int. htdocs/loan/class/paymentloan.class.php 317 Property PaymentLoan::$num_payment (string) does not accept int. --- htdocs/loan/class/paymentloan.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 3ec3fda1f0e4b..f095f480a04bd 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -155,7 +155,7 @@ public function create($user) $this->fk_typepayment = (int) $this->fk_typepayment; } if (isset($this->num_payment)) { - $this->num_payment = (int) $this->num_payment; + $this->num_payment = trim($this->num_payment); } if (isset($this->note_private)) { $this->note_private = trim($this->note_private); @@ -317,7 +317,7 @@ public function update($user = null, $notrigger = 0) $this->fk_typepayment = (int) $this->fk_typepayment; } if (isset($this->num_payment)) { - $this->num_payment = (int) $this->num_payment; + $this->num_payment = trim($this->num_payment); } if (isset($this->note_private)) { $this->note = trim($this->note_private); From cc5366249af1731ad3c32f4052abfe2e8a0b4ff5 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Fri, 8 Mar 2024 12:10:09 +0100 Subject: [PATCH 05/22] qual: phpdoc for htdocs/core/db/mysqli.class.php (#28703) PHPDoc update to reflect what the code does today. This update however doesn't solve this PHPStan warning: htdocs/core/db/mysqli.class.php 243 Return type (mysqli|null) of method DoliDBMysqli::connect() should be compatible with return type (resource) of method Database::connect() --- htdocs/core/db/mysqli.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index f3c0c3cce62ff..d07b4261ce5ca 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -232,12 +232,12 @@ public function select_db($database) /** * Connect to server * - * @param string $host Database server host - * @param string $login Login - * @param string $passwd Password - * @param string $name Name of database (not used for mysql, used for pgsql) - * @param integer $port Port of database server - * @return mysqli|null Database access object + * @param string $host Database server host + * @param string $login Login + * @param string $passwd Password + * @param string $name Name of database (not used for mysql, used for pgsql) + * @param integer $port Port of database server + * @return mysqli|mysqliDoli|false Database access object * @see close() */ public function connect($host, $login, $passwd, $name, $port = 0) From 6cce456b8c97baab14b6f1e6febb21d04f7e5502 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 12:18:22 +0100 Subject: [PATCH 06/22] Qual: Add fixers for price(ARG2), and urlencode((string)...) (#28701) # Qual: Add fixers for price(ARG2), and urlencode((string)...) Register the fixers used to fix phan messages by adjusting arguments and casts. --- dev/tools/phan/config_fixer.php | 4 +- dev/tools/phan/plugins/PriceFormFixer.php | 138 ++++++++++++++++++ .../phan/plugins/UrlEncodeStringifyFixer.php | 106 ++++++++++++++ 3 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 dev/tools/phan/plugins/PriceFormFixer.php create mode 100644 dev/tools/phan/plugins/UrlEncodeStringifyFixer.php diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index e13e371b8dfb0..a9daacfc676eb 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -1,6 +1,8 @@ */ diff --git a/dev/tools/phan/plugins/PriceFormFixer.php b/dev/tools/phan/plugins/PriceFormFixer.php new file mode 100644 index 0000000000000..1d384d2243bf7 --- /dev/null +++ b/dev/tools/phan/plugins/PriceFormFixer.php @@ -0,0 +1,138 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $line = $instance->getLine(); + // print flags\TYPE_NULL; + $expected_name = 'price'; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) < 2) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $stringValue = null; + foreach ([1] as $argIdx) { + $arg = $arguments[$argIdx * 2]; // Pair number to skip "TOKEN" (,) + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof StringLiteral + ) { + // Get the string value of the StringLiteral + $stringValue = $arg->expression->getStringContentsText(); + print "String is '$stringValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $stringValue = ''; // Fake empty + } else { + print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($stringValue !== '') { + print "Not replacing \$form which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + // Reached end of switch case without "continue" -> replace + $replacement = 0; + + print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL; + + // Determine replacement + $replacement = '0'; + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Remove deprecated module name + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgumentProbablyReal', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/UrlEncodeStringifyFixer.php b/dev/tools/phan/plugins/UrlEncodeStringifyFixer.php new file mode 100644 index 0000000000000..52084b1b72104 --- /dev/null +++ b/dev/tools/phan/plugins/UrlEncodeStringifyFixer.php @@ -0,0 +1,106 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $line = $instance->getLine(); + // print flags\TYPE_NULL; + $expected_name = 'urlencode'; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) < 1) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $arg = $arguments[0]; + + // Reached end of switch case without "continue" -> replace + $replacement = 0; + + print "Fixture elem on $line - $actual_name() - $instance".PHP_EOL; + + // Determine replacement + $replacement = '0'; + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Remove deprecated module name + $edits[] = new FileEdit($arg_start_pos, $arg_start_pos, "(string) ("); + $edits[] = new FileEdit($arg_end_pos, $arg_end_pos, ")"); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgumentInternal', + $fix + ); +}); From 7fd606b33647c769cf837abdbfc21b2510d349d5 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 12:34:25 +0100 Subject: [PATCH 07/22] Qual: Ignore/workaround SuspiciousParamOrder detection (#28688) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) * Qual: Ignore/workaround SuspiciousParamOrder detction # Qual: Ignore/workaround SuspiciousParamOrder detction Ignore the false positive SuspiciousParamOrder or workaround (rename vars) --- htdocs/accountancy/class/lettering.class.php | 2 +- htdocs/accountancy/customer/lines.php | 3 +- htdocs/accountancy/customer/list.php | 35 +-- htdocs/accountancy/expensereport/lines.php | 5 +- htdocs/accountancy/expensereport/list.php | 3 +- htdocs/accountancy/supplier/lines.php | 3 +- htdocs/accountancy/supplier/list.php | 35 +-- htdocs/adherents/card.php | 15 +- htdocs/adherents/list.php | 104 ++++----- htdocs/adherents/subscription.php | 3 +- htdocs/admin/mails_templates.php | 1 + htdocs/admin/tools/listevents.php | 9 +- htdocs/categories/viewcat.php | 14 +- htdocs/comm/action/card.php | 1 + htdocs/comm/action/rapport/index.php | 3 +- htdocs/comm/mailing/cibles.php | 1 + htdocs/commande/list.php | 137 ++++++------ htdocs/commande/list_det.php | 107 +++++----- htdocs/compta/bank/bankentries_list.php | 63 +++--- htdocs/compta/facture/card.php | 9 +- .../compta/facture/invoicetemplate_list.php | 55 ++--- htdocs/compta/facture/list.php | 164 +++++++------- htdocs/compta/paiement/cheque/list.php | 25 +-- htdocs/compta/paiement/list.php | 33 +-- htdocs/compta/prelevement/card.php | 3 +- htdocs/compta/prelevement/fiche-rejet.php | 1 + htdocs/compta/sociales/list.php | 42 ++-- htdocs/compta/tva/list.php | 31 +-- htdocs/compta/tva/payments.php | 2 +- htdocs/core/login/functions_ldap.php | 1 + .../core/modules/bank/doc/pdf_ban.modules.php | 1 + .../bank/doc/pdf_sepamandate.modules.php | 13 +- .../modules/cheque/doc/pdf_blochet.class.php | 7 +- .../commande/doc/pdf_einstein.modules.php | 13 +- .../commande/doc/pdf_eratosthene.modules.php | 20 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 11 +- .../expedition/doc/pdf_rouget.modules.php | 11 +- .../doc/pdf_standard.modules.php | 7 +- .../modules/facture/doc/pdf_crabe.modules.php | 3 + .../facture/doc/pdf_sponge.modules.php | 4 + .../fichinter/doc/pdf_soleil.modules.php | 7 +- .../modules/hrm/doc/pdf_standard.modules.php | 9 +- .../movement/doc/pdf_standard.modules.php | 23 +- .../modules/mrp/doc/pdf_vinci.modules.php | 8 +- .../product/doc/pdf_standard.modules.php | 7 +- .../project/doc/pdf_baleine.modules.php | 11 +- .../project/doc/pdf_beluga.modules.php | 201 +++++++++--------- .../project/doc/pdf_timespent.modules.php | 11 +- .../modules/propale/doc/pdf_azur.modules.php | 17 +- .../modules/propale/doc/pdf_cyan.modules.php | 22 +- .../modules/rapport/pdf_paiement.class.php | 13 +- .../reception/doc/pdf_squille.modules.php | 9 +- .../stock/doc/pdf_standard.modules.php | 31 +-- .../stocktransfer/doc/pdf_eagle.modules.php | 1 + .../doc/pdf_eagle_proforma.modules.php | 18 +- .../doc/pdf_canelle.modules.php | 11 +- .../supplier_order/doc/pdf_cornas.modules.php | 22 +- .../doc/pdf_muscadet.modules.php | 15 +- .../doc/pdf_standard.modules.php | 11 +- .../doc/pdf_aurore.modules.php | 13 +- .../doc/pdf_zenith.modules.php | 22 +- htdocs/core/tpl/objectline_create.tpl.php | 90 ++++---- htdocs/don/list.php | 22 +- htdocs/don/paiement/list.php | 31 +-- htdocs/expedition/list.php | 67 +++--- htdocs/expensereport/payment/list.php | 35 +-- htdocs/fichinter/list.php | 57 ++--- htdocs/fourn/facture/card.php | 1 + htdocs/fourn/facture/list-rec.php | 55 ++--- htdocs/fourn/facture/list.php | 125 +++++------ htdocs/fourn/paiement/list.php | 31 +-- htdocs/holiday/view_log.php | 19 +- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/checkMargins.php | 1 + htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 2 +- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/price.php | 6 +- htdocs/product/stats/commande.php | 1 + htdocs/product/stats/commande_fournisseur.php | 1 + htdocs/product/stats/contrat.php | 3 +- htdocs/product/stats/facture.php | 5 +- htdocs/product/stats/facture_fournisseur.php | 1 + htdocs/product/stats/facturerec.php | 3 +- htdocs/product/stats/mo.php | 3 +- htdocs/product/stats/propal.php | 1 + htdocs/product/stats/supplier_proposal.php | 1 + .../stock/stats/commande_fournisseur.php | 3 +- htdocs/product/stock/stats/expedition.php | 3 +- htdocs/product/stock/stats/mo.php | 9 +- htdocs/product/stock/stats/reception.php | 3 +- htdocs/public/webportal/tpl/menu.tpl.php | 5 +- htdocs/reception/list.php | 1 + ...tandard_recruitmentjobposition.modules.php | 14 +- htdocs/salaries/list.php | 31 +-- htdocs/societe/notify/card.php | 6 +- htdocs/societe/price.php | 14 +- htdocs/user/notify/card.php | 4 +- 100 files changed, 1140 insertions(+), 1006 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 07329030e4b14..6f669e4833df4 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -289,7 +289,7 @@ public function updateLettering($ids = array(), $notrigger = 0) { $error = 0; - // Generate a string with n char A where n is ACCOUNTING_LETTERING_NBLETTERS (So 'AA', 'AAA', ...) + // Generate a string with n char A where n is ACCOUNTING_LETTERING_NBLETTERS (So 'AA', 'AAA', ...) @phan-suppress-next-line PhanParamSuspiciousOrder $lettre = str_pad("", getDolGlobalInt('ACCOUNTING_LETTERING_NBLETTERS', 3), "A"); $sql = "SELECT DISTINCT ab2.lettering_code"; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 74753c659773d..2aaed4ba01494 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -175,7 +175,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("CustomersVentilation").' - '.$langs->trans("Dispatched"), $help_url); @@ -386,6 +386,7 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneCustomer").'
'; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 6ef21c0f21e93..22047f60fe561 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -230,7 +230,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("CustomersVentilation"), $help_url); @@ -445,8 +445,8 @@ } $arrayofmassactions = array( - 'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") - ,'set_default_account'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") + 'ventil' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") + ,'set_default_account' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); @@ -467,10 +467,11 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); if ($massaction == 'set_default_account') { - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'set_default_account', 'label' => $langs->trans("AccountancyCode"), 'value' => $formaccounting->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone')); @@ -599,26 +600,26 @@ $facture_static_det->desc = $objp->description; $accountingAccountArray = array( - 'dom'=>$objp->aarowid, - 'intra'=>$objp->aarowid_intra, - 'export'=>$objp->aarowid_export, - 'thirdparty' =>$objp->aarowid_thirdparty); + 'dom' => $objp->aarowid, + 'intra' => $objp->aarowid_intra, + 'export' => $objp->aarowid_export, + 'thirdparty' => $objp->aarowid_thirdparty); $code_sell_p_notset = ''; $code_sell_t_notset = ''; $suggestedid = 0; - $return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); - if (!is_array($return) && $return<0) { + $return = $accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer'); + if (!is_array($return) && $return < 0) { setEventMessage($accountingAccount->error, 'errors'); } else { - $suggestedid=$return['suggestedid']; - $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; - $suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor']; - $code_sell_l=$return['code_l']; - $code_sell_p=$return['code_p']; - $code_sell_t=$return['code_t']; + $suggestedid = $return['suggestedid']; + $suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor']; + $suggestedaccountingaccountbydefaultfor = $return['suggestedaccountingaccountbydefaultfor']; + $code_sell_l = $return['code_l']; + $code_sell_p = $return['code_p']; + $code_sell_t = $return['code_t']; } //var_dump($return); @@ -780,7 +781,7 @@ if (!empty($toselect)) { $ischecked = 0; if (in_array($objp->rowid."_".$i, $toselect)) { - $ischecked=1; + $ischecked = 1; } } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 2320620fec774..11602a58f1fbd 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -165,7 +165,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("ExpenseReportsVentilation").' - '.$langs->trans("Dispatched"), $help_url); @@ -308,6 +308,7 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneExpenseReport").'
'; @@ -438,7 +439,7 @@ $i++; } if ($num_lines == 0) { - $colspan=10; + $colspan = 10; if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) { $colspan++; } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 8f996c42412e2..73d9dd96cb130 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -221,7 +221,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("ExpenseReportsVentilation"), $help_url); @@ -376,6 +376,7 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ExpenseReportLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilTodoExpenseReport").'

'; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 496a32b982525..09c7aca7af754 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -180,7 +180,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("SuppliersVentilation").' - '.$langs->trans("Dispatched"), $help_url); @@ -394,6 +394,7 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
'; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index db087830144c3..cf495bf632a02 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -232,7 +232,7 @@ $form = new Form($db); $formother = new FormOther($db); -$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; +$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double#Liaisons_comptables'; llxHeader('', $langs->trans("SuppliersVentilation"), $help_url); @@ -452,8 +452,8 @@ } $arrayofmassactions = array( - 'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") - ,'set_default_account'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") + 'ventil' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") + ,'set_default_account' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount") //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); @@ -474,10 +474,11 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); if ($massaction == 'set_default_account') { - $formquestion[]=array('type' => 'other', + $formquestion[] = array('type' => 'other', 'name' => 'set_default_account', 'label' => $langs->trans("AccountancyCode"), 'value' => $formaccounting->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone')); @@ -611,26 +612,26 @@ $facturefourn_static_det->desc = $objp->description; $accountingAccountArray = array( - 'dom'=>$objp->aarowid, - 'intra'=>$objp->aarowid_intra, - 'export'=>$objp->aarowid_export, - 'thirdparty' =>$objp->aarowid_thirdparty); + 'dom' => $objp->aarowid, + 'intra' => $objp->aarowid_intra, + 'export' => $objp->aarowid_export, + 'thirdparty' => $objp->aarowid_thirdparty); $code_buy_p_notset = ''; $code_buy_t_notset = ''; $suggestedid = 0; - $return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier'); - if (!is_array($return) && $return<0) { + $return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier'); + if (!is_array($return) && $return < 0) { setEventMessage($accountingAccount->error, 'errors'); } else { - $suggestedid=$return['suggestedid']; - $suggestedaccountingaccountfor=$return['suggestedaccountingaccountfor']; - $suggestedaccountingaccountbydefaultfor=$return['suggestedaccountingaccountbydefaultfor']; - $code_buy_l=$return['code_l']; - $code_buy_p=$return['code_p']; - $code_buy_t=$return['code_t']; + $suggestedid = $return['suggestedid']; + $suggestedaccountingaccountfor = $return['suggestedaccountingaccountfor']; + $suggestedaccountingaccountbydefaultfor = $return['suggestedaccountingaccountbydefaultfor']; + $code_buy_l = $return['code_l']; + $code_buy_p = $return['code_p']; + $code_buy_t = $return['code_t']; } //var_dump($return); @@ -783,7 +784,7 @@ if (!empty($toselect)) { $ischecked = 0; if (in_array($objp->rowid."_".$i, $toselect)) { - $ischecked=1; + $ischecked = 1; } } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 98b92264cebe4..a75d635847790 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -130,7 +130,7 @@ * Actions */ -$parameters = array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas, 'confirm'=>$confirm); +$parameters = array('id' => $id, 'rowid' => $id, 'objcanvas' => $objcanvas, 'confirm' => $confirm); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -1044,7 +1044,7 @@ function initfieldrequired() { // Gender print ''.$langs->trans("Gender").''; print ''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother")); + $arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother")); print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', '', 1); print ''; @@ -1275,7 +1275,7 @@ function initfieldrequired() { // Gender print ''.$langs->trans("Gender").''; print ''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother")); + $arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother")); print $form->selectarray('gender', $arraygender, GETPOSTISSET('gender') ? GETPOST('gender', 'alphanohtml') : $object->gender, 1, 0, 0, '', 0, 0, 0, '', '', 1); print ''; @@ -1480,7 +1480,7 @@ function initfieldrequired() { ); if (isModEnabled('societe') && $object->socid > 0) { $object->fetch_thirdparty(); - $formquestion[] = array('label' => $langs->trans("UserWillBe"), 'type' => 'radio', 'name' => 'internalorexternal', 'default'=>'external', 'values' => array('external'=>$langs->trans("External").' - '.$langs->trans("LinkedToDolibarrThirdParty").' '.$object->thirdparty->getNomUrl(1, '', 0, 1), 'internal'=>$langs->trans("Internal"))); + $formquestion[] = array('label' => $langs->trans("UserWillBe"), 'type' => 'radio', 'name' => 'internalorexternal', 'default' => 'external', 'values' => array('external' => $langs->trans("External").' - '.$langs->trans("LinkedToDolibarrThirdParty").' '.$object->thirdparty->getNomUrl(1, '', 0, 1), 'internal' => $langs->trans("Internal"))); } $text = ''; if (isModEnabled('societe') && $object->socid <= 0) { @@ -1563,6 +1563,7 @@ function initfieldrequired() { $helpcontent .= "
"; $helpcontent .= ''.$langs->trans("Content").':
'; $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help'); // Create form popup @@ -1571,10 +1572,10 @@ function initfieldrequired() { $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (getDolGlobalString('ADHERENT_DEFAULT_SENDINFOBYMAIL') ? true : false)); } if (isModEnabled('mailman') && getDolGlobalString('ADHERENT_USE_MAILMAN')) { - $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value'=>''); + $formquestion[] = array('type' => 'other', 'label' => $langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value' => ''); } if (isModEnabled('mailman') && getDolGlobalString('ADHERENT_USE_SPIP')) { - $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value'=>''); + $formquestion[] = array('type' => 'other', 'label' => $langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value' => ''); } print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220); } @@ -1626,6 +1627,7 @@ function initfieldrequired() { $helpcontent .= "
"; $helpcontent .= ''.$langs->trans("Content").':
'; $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help'); // Create an array @@ -1686,6 +1688,7 @@ function initfieldrequired() { $helpcontent .= "
"; $helpcontent .= ''.$langs->trans("Content").':
'; $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help'); // Create an array diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 9e193f1052cd9..7ce26e570c718 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -132,49 +132,49 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'd.ref'=>'Ref', - 'd.login'=>'Login', - 'd.lastname'=>'Lastname', - 'd.firstname'=>'Firstname', - 'd.societe'=>"Company", - 'd.email'=>'EMail', - 'd.address'=>'Address', - 'd.zip'=>'Zip', - 'd.town'=>'Town', - 'd.phone'=>"Phone", - 'd.phone_perso'=>"PhonePerso", - 'd.phone_mobile'=>"PhoneMobile", - 'd.note_public'=>'NotePublic', - 'd.note_private'=>'NotePrivate', + 'd.ref' => 'Ref', + 'd.login' => 'Login', + 'd.lastname' => 'Lastname', + 'd.firstname' => 'Firstname', + 'd.societe' => "Company", + 'd.email' => 'EMail', + 'd.address' => 'Address', + 'd.zip' => 'Zip', + 'd.town' => 'Town', + 'd.phone' => "Phone", + 'd.phone_perso' => "PhonePerso", + 'd.phone_mobile' => "PhoneMobile", + 'd.note_public' => 'NotePublic', + 'd.note_private' => 'NotePrivate', ); $arrayfields = array( - 'd.ref'=>array('label'=>"Ref", 'checked'=>1), - 'd.civility'=>array('label'=>"Civility", 'checked'=>0), - 'd.lastname'=>array('label'=>"Lastname", 'checked'=>1), - 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), - 'd.gender'=>array('label'=>"Gender", 'checked'=>0), - 'd.company'=>array('label'=>"Company", 'checked'=>1, 'position'=>70), - 'd.login'=>array('label'=>"Login", 'checked'=>1), - 'd.morphy'=>array('label'=>"MemberNature", 'checked'=>1), - 't.libelle'=>array('label'=>"Type", 'checked'=>1, 'position'=>55), - 'd.address'=>array('label'=>"Address", 'checked'=>0), - 'd.zip'=>array('label'=>"Zip", 'checked'=>0), - 'd.town'=>array('label'=>"Town", 'checked'=>0), - 'd.phone'=>array('label'=>"Phone", 'checked'=>0), - 'd.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), - 'd.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>0), - 'd.email'=>array('label'=>"Email", 'checked'=>1), - 'state.nom'=>array('label'=>"State", 'checked'=>0, 'position'=>90), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>95), + 'd.ref' => array('label' => "Ref", 'checked' => 1), + 'd.civility' => array('label' => "Civility", 'checked' => 0), + 'd.lastname' => array('label' => "Lastname", 'checked' => 1), + 'd.firstname' => array('label' => "Firstname", 'checked' => 1), + 'd.gender' => array('label' => "Gender", 'checked' => 0), + 'd.company' => array('label' => "Company", 'checked' => 1, 'position' => 70), + 'd.login' => array('label' => "Login", 'checked' => 1), + 'd.morphy' => array('label' => "MemberNature", 'checked' => 1), + 't.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 55), + 'd.address' => array('label' => "Address", 'checked' => 0), + 'd.zip' => array('label' => "Zip", 'checked' => 0), + 'd.town' => array('label' => "Town", 'checked' => 0), + 'd.phone' => array('label' => "Phone", 'checked' => 0), + 'd.phone_perso' => array('label' => "PhonePerso", 'checked' => 0), + 'd.phone_mobile' => array('label' => "PhoneMobile", 'checked' => 0), + 'd.email' => array('label' => "Email", 'checked' => 1), + 'state.nom' => array('label' => "State", 'checked' => 0, 'position' => 90), + 'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 95), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ - 'd.datefin'=>array('label'=>"EndSubscription"), - 'd.datec'=>array('label'=>"DateCreation"), - 'd.birth'=>array('label'=>"Birthday"), - 'd.tms'=>array('label'=>"DateModificationShort"), - 'd.statut'=>array('label'=>"Status"), - 'd.import_key'=>array('label'=>"ImportId"), + 'd.datefin' => array('label' => "EndSubscription"), + 'd.datec' => array('label' => "DateCreation"), + 'd.birth' => array('label' => "Birthday"), + 'd.tms' => array('label' => "DateModificationShort"), + 'd.statut' => array('label' => "Status"), + 'd.import_key' => array('label' => "ImportId"), ); // Extra fields @@ -195,8 +195,8 @@ $visible = (int) dol_eval($val['visible'], 1); $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], - 'checked' =>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -221,7 +221,7 @@ $massaction = ''; } -$parameters = array('socid'=>isset($socid) ? $socid : null); +$parameters = array('socid' => isset($socid) ? $socid : null); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -762,8 +762,8 @@ $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); if ($user->hasRight('adherent', 'creer')) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create'); @@ -893,7 +893,7 @@ // Gender if (!empty($arrayfields['d.gender']['checked'])) { print ''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother")); + $arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother")); print $form->selectarray('search_gender', $arraygender, $search_gender, 1); print ''; } @@ -913,7 +913,7 @@ // Nature if (!empty($arrayfields['d.morphy']['checked'])) { print ''; - $arraymorphy = array('mor'=>$langs->trans("Moral"), 'phy'=>$langs->trans("Physical")); + $arraymorphy = array('mor' => $langs->trans("Moral"), 'phy' => $langs->trans("Physical")); print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); print ''; } @@ -925,6 +925,7 @@ if (!empty($arrayfields['t.libelle']['checked'])) { print ''; $listetype = $membertypestatic->liste_array(); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray("search_type", $listetype, $search_type, 1, 0, 0, '', 0, 32); print ''; } @@ -989,7 +990,7 @@ if (!empty($arrayfields['d.datefin']['checked'])) { print ''; //$selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); - $selectarray = array('-1'=>'', 'waitingsubscription'=>$langs->trans("WaitingSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + $selectarray = array('-1' => '', 'waitingsubscription' => $langs->trans("WaitingSubscription"), 'uptodate' => $langs->trans("UpToDate"), 'outofdate' => $langs->trans("OutOfDate")); print $form->selectarray('search_filter', $selectarray, $search_filter); print ''; } @@ -998,7 +999,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1046,8 +1047,9 @@ Adherent::STATUS_DRAFT => $langs->trans("Draft"), Adherent::STATUS_VALIDATED => $langs->trans("Validated"), Adherent::STATUS_RESILIATED => $langs->trans("MemberStatusResiliatedShort"), - Adherent::STATUS_EXCLUDED =>$langs->trans("MemberStatusExcludedShort") + Adherent::STATUS_EXCLUDED => $langs->trans("MemberStatusExcludedShort") ); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -3, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print ''; } @@ -1156,7 +1158,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'totalarray'=>&$totalarray, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'totalarray' => &$totalarray, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1465,7 +1467,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1551,7 +1553,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql' => $sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 9da83c5faf300..512189bef85cf 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1097,7 +1097,7 @@ if (!getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS') || getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS') != 'defaultforfoundationcountry') { print '. '.$langs->trans("NoVatOnSubscription", 0).''; } - if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product')|| isModEnabled('service'))) { + if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled('product') || isModEnabled('service'))) { $prodtmp = new Product($db); $result = $prodtmp->fetch(getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS')); if ($result < 0) { @@ -1201,6 +1201,7 @@ $langs->load("errors"); $helpcontent .= ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).''."\n"; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->textwithpicto($tmp, $helpcontent, 1, 'help', '', 0, 2, 'helpemailtosend'); } print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index af09ef6d283f9..830a129b74a97 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -948,6 +948,7 @@ print ''; } elseif ($value == 'type_template') { print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100 maxwidth125', 1, '', 0, 1); print ''; } elseif (!in_array($value, array('content', 'content_lines'))) { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index b56acffee1760..b1b1242ebcc57 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -123,10 +123,10 @@ // Add prefix session $arrayfields = array( 'e.prefix_session' => array( - 'label'=>'UserAgent', - 'checked'=>(!getDolGlobalString('AUDIT_ENABLE_PREFIX_SESSION') ? 0 : 1), - 'enabled'=>(!getDolGlobalString('AUDIT_ENABLE_PREFIX_SESSION') ? 0 : 1), - 'position'=>110 + 'label' => 'UserAgent', + 'checked' => (!getDolGlobalString('AUDIT_ENABLE_PREFIX_SESSION') ? 0 : 1), + 'enabled' => (!getDolGlobalString('AUDIT_ENABLE_PREFIX_SESSION') ? 0 : 1), + 'position' => 110 ) ); @@ -325,6 +325,7 @@ print '
'; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup', 0, '', '', $limit); if ($action == 'purge') { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index d95e2c17619b1..efcd10ddbb98b 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -409,7 +409,7 @@ // Define data (format for treeview) $data = array(); - $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); + $data[] = array('rowid' => 0, 'fk_menu' => -1, 'title' => "racine", 'mainmenu' => '', 'leftmenu' => '', 'fk_mainmenu' => '', 'fk_leftmenu' => ''); foreach ($fulltree as $key => $val) { $categstatic->id = $val['id']; $categstatic->ref = $val['label']; @@ -539,6 +539,7 @@ $nbtotalofrecords = ''; $newcardbutton = dolGetButtonTitle($langs->trans("AddProduct"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&categories[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ProductsAndServices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'products', 0, $newcardbutton, '', $limit); @@ -626,6 +627,7 @@ $nbtotalofrecords = ''; $newcardbutton = dolGetButtonTitle($langs->trans("AddThirdParty"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&client=3&custcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); print ''."\n"; @@ -690,7 +692,7 @@ print '
'; print ''; print ''; @@ -711,6 +713,7 @@ $nbtotalofrecords = ''; $newcardbutton = dolGetButtonTitle($langs->trans("AddSupplier"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create&fournisseur=1&suppcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Suppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit); print '
'; print $langs->trans("AddSupplierIntoCategory").'  '; - $filter ='(s.fournisseur:=:1)'; + $filter = '(s.fournisseur:=:1)'; print $form->select_company('', 'elemid', $filter); print '
'."\n"; @@ -798,6 +801,7 @@ $nbtotalofrecords = ''; $newcardbutton = dolGetButtonTitle($langs->trans("AddMember"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create&memcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('adherent', 'creer')); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit); print '
'."\n"; @@ -884,6 +888,7 @@ $nbtotalofrecords = ''; $newcardbutton = dolGetButtonTitle($langs->trans("AddContact"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create&contcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->societe->creer); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit); $objsoc = new Societe($db); @@ -977,6 +982,7 @@ $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Account"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit); print '
'."\n"; @@ -1065,6 +1071,7 @@ $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Project"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'project', 0, $newcardbutton, '', $limit); print '
'."\n"; @@ -1152,6 +1159,7 @@ $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Users"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'user', 0, '', '', $limit); print '
'."\n"; @@ -1216,6 +1224,7 @@ $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit); print '
'."\n"; @@ -1302,6 +1311,7 @@ $nbtotalofrecords = ''; $newcardbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Ticket"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'ticket', 0, $newcardbutton, '', $limit); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 08a7c49a44398..05229a9ab58d8 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -629,6 +629,7 @@ $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOSTINT("limitmonth") : 1, GETPOSTISSET("limitday") ? GETPOSTINT("limitday") : 1, GETPOSTISSET("limityear") && GETPOSTINT("limityear") < 2100 ? GETPOSTINT("limityear") : 2100, $tzforfullday ? $tzforfullday : 'tzuserrel'); // Set date of end of event $deltatime = num_between_day($object->datep, $datep); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $datef = dol_time_plus_duree($datef, $deltatime, 'd'); while ($datep <= $repeateventlimitdate && !$error) { diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 88e030f74311d..5bf0b91974b27 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -130,6 +130,7 @@ print ''; print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("EventReports"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit, 0, 0, 1); $moreforfilter = ''; @@ -177,7 +178,7 @@ print ''; } @@ -1974,7 +1975,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['c.datec']['checked'])) { @@ -2037,20 +2038,20 @@ || !empty($arrayfields['total_margin_rate']['checked']) || !empty($arrayfields['total_mark_rate']['checked']) ) - ) { +) { $with_margin_info = true; } - $total_ht = 0; - $total_margin = 0; +$total_ht = 0; +$total_margin = 0; - // Loop on record - // -------------------------------------------------------------------- - $i = 0; - $savnbfield = $totalarray['nbfield']; - $totalarray = array(); - $totalarray['nbfield'] = 0; - $imaxinloop = ($limit ? min($num, $limit) : $num); +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$savnbfield = $totalarray['nbfield']; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -2580,7 +2581,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -2804,7 +2805,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 75237945ea4a2..3c0f25f74ace1 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -162,14 +162,14 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'c.ref'=>'Ref', - 'c.ref_client'=>'RefCustomerOrder', - 'cdet.description'=>'Description', - 's.nom'=>"ThirdParty", - 's.name_alias'=>"AliasNameShort", - 's.zip'=>"Zip", - 's.town'=>"Town", - 'c.note_public'=>'NotePublic', + 'c.ref' => 'Ref', + 'c.ref_client' => 'RefCustomerOrder', + 'cdet.description' => 'Description', + 's.nom' => "ThirdParty", + 's.name_alias' => "AliasNameShort", + 's.zip' => "Zip", + 's.town' => "Town", + 'c.note_public' => 'NotePublic', ); if (empty($user->socid)) { $fieldstosearchall["c.note_private"] = "NotePrivate"; @@ -178,51 +178,51 @@ $checkedtypetiers = 0; $arrayfields = array( // Détail commande - 'rowid'=> array('label'=>'TechnicalID', 'checked'=>1, 'position'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0)), - 'pr.ref'=> array('label'=>'ProductRef', 'checked'=>1, 'position'=>1), - 'pr.desc'=> array('label'=>'ProductDescription', 'checked'=>-1, 'position'=>1), - 'cdet.qty'=> array('label'=>'QtyOrdered', 'checked'=>1, 'position'=>1), - 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), - 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), - 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), - 's.zip'=>array('label'=>"Zip", 'checked'=>-1, 'position'=>40), - 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), - 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), - 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('delivery_note')), - 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), - 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), - 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), - 'cdet.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75), - 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80), - 'cdet.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85), - 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90), - 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95), - 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100), - 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105), - 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), - 'c.fk_warehouse'=>array('label'=>'Warehouse', 'checked'=>0, 'enabled'=>(!isModEnabled('stock') && !getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ? 0 : 1), 'position'=>110), - 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), + 'rowid' => array('label' => 'TechnicalID', 'checked' => 1, 'position' => 1, 'enabled' => (getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') ? 1 : 0)), + 'pr.ref' => array('label' => 'ProductRef', 'checked' => 1, 'position' => 1), + 'pr.desc' => array('label' => 'ProductDescription', 'checked' => -1, 'position' => 1), + 'cdet.qty' => array('label' => 'QtyOrdered', 'checked' => 1, 'position' => 1), + 'c.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5), + 'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => -1, 'position' => 10), + 'p.ref' => array('label' => "ProjectRef", 'checked' => -1, 'enabled' => (empty($conf->project->enabled) ? 0 : 1), 'position' => 20), + 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (empty($conf->project->enabled) ? 0 : 1), 'position' => 25), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1, 'position' => 31), + 's.town' => array('label' => "Town", 'checked' => -1, 'position' => 35), + 's.zip' => array('label' => "Zip", 'checked' => -1, 'position' => 40), + 'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 45), + 'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 50), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55), + 'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60), + 'c.date_delivery' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65), + 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled('delivery_note')), + 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67), + 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68), + 'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69), + 'cdet.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 75), + 'c.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 80), + 'cdet.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 85), + 'c.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 90), + 'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 95), + 'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 100), + 'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 105), + 'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (empty($conf->multicurrency->enabled) ? 0 : 1), 'position' => 110), + 'c.fk_warehouse' => array('label' => 'Warehouse', 'checked' => 0, 'enabled' => (!isModEnabled('stock') && !getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') ? 0 : 1), 'position' => 110), + 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 115), + 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 116), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), - 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), - 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), - 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), - 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position'=>135), - 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('delivery_note')), 'position'=>990), - 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), - 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), - 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) + 'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 120), + 'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 125), + 'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130), + 'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position' => 135), + 'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position' => 140), + 'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled('delivery_note')), 'position' => 990), + 'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995), + 'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999), + 'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000) ); // Extra fields @@ -255,7 +255,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -1202,7 +1202,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1271,6 +1271,7 @@ Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceledShort") ); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'maxwidth125', 1); print ''; } @@ -2025,7 +2026,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -2244,7 +2245,7 @@ $db->free($resql); - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 8a3c2c1c13e7f..2a3672b0cd917 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -150,21 +150,21 @@ $search_array_options = $extrafields->getOptionalsFromPost('banktransaction', '', 'search_'); $arrayfields = array( - 'b.rowid'=>array('label'=>$langs->trans("Ref"), 'checked'=>1,'position'=>10), - 'b.label'=>array('label'=>$langs->trans("Description"), 'checked'=>1,'position'=>20), - 'b.dateo'=>array('label'=>$langs->trans("DateOperationShort"), 'checked'=>1,'position'=>30), - 'b.datev'=>array('label'=>$langs->trans("DateValueShort"), 'checked'=>1,'position'=>40), - 'type'=>array('label'=>$langs->trans("Type"), 'checked'=>1,'position'=>50), - 'b.num_chq'=>array('label'=>$langs->trans("Numero"), 'checked'=>1,'position'=>60), - 'bu.label'=>array('label'=>$langs->trans("ThirdParty").'/'.$langs->trans("User"), 'checked'=>1, 'position'=>70), - 'ba.ref'=>array('label'=>$langs->trans("BankAccount"), 'checked'=>(($id > 0 || !empty($ref)) ? 0 : 1), 'position'=>80), - 'b.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1, 'position'=>90), - 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>100), - 'balancebefore'=>array('label'=>$langs->trans("BalanceBefore"), 'checked'=>0, 'position'=>110), - 'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>120), - 'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>130), - 'b.conciliated'=>array('label'=>$langs->trans("BankLineReconciled"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile' ? 1 : 0), 'position'=>140), - 'b.fk_bordereau'=>array('label'=>$langs->trans("ChequeNumber"), 'checked'=>0, 'position'=>150), + 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1,'position' => 10), + 'b.label' => array('label' => $langs->trans("Description"), 'checked' => 1,'position' => 20), + 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => 1,'position' => 30), + 'b.datev' => array('label' => $langs->trans("DateValueShort"), 'checked' => 1,'position' => 40), + 'type' => array('label' => $langs->trans("Type"), 'checked' => 1,'position' => 50), + 'b.num_chq' => array('label' => $langs->trans("Numero"), 'checked' => 1,'position' => 60), + 'bu.label' => array('label' => $langs->trans("ThirdParty").'/'.$langs->trans("User"), 'checked' => 1, 'position' => 70), + 'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => (($id > 0 || !empty($ref)) ? 0 : 1), 'position' => 80), + 'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 90), + 'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => 1, 'position' => 100), + 'balancebefore' => array('label' => $langs->trans("BalanceBefore"), 'checked' => 0, 'position' => 110), + 'balance' => array('label' => $langs->trans("Balance"), 'checked' => 1, 'position' => 120), + 'b.num_releve' => array('label' => $langs->trans("AccountStatement"), 'checked' => 1, 'position' => 130), + 'b.conciliated' => array('label' => $langs->trans("BankLineReconciled"), 'enabled' => $object->rappro, 'checked' => ($action == 'reconcile' ? 1 : 0), 'position' => 140), + 'b.fk_bordereau' => array('label' => $langs->trans("ChequeNumber"), 'checked' => 0, 'position' => 150), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -417,7 +417,7 @@ $companystatic = new Societe($db); $bankaccountstatic = new Account($db); -$userstatic= new User($db); +$userstatic = new User($db); $banktransferstatic = new BonPrelevement($db); $societestatic = new Societe($db); @@ -655,18 +655,18 @@ $sql .= " AND b.fk_bordereau = " . ((int) $search_fk_bordereau); } if ($search_thirdparty_user) { - $sql.= " AND (b.rowid IN "; - $sql.= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; - $sql.= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; - $sql.= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; - $sql.= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; - - $sql.= " OR b.rowid IN "; - $sql.= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; - $sql.= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; - $sql.= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; - $sql.= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); - $sql.= "))"; + $sql .= " AND (b.rowid IN "; + $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; + $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; + $sql .= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; + $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; + + $sql .= " OR b.rowid IN "; + $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; + $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; + $sql .= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; + $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); + $sql .= "))"; } if ($search_description) { $search_description_to_use = $search_description; @@ -1017,6 +1017,7 @@ $picto = ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit, 0, 0, 1); // We can add page now to param @@ -1263,7 +1264,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action edit/delete and select @@ -1827,8 +1828,8 @@ } // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook + $parameters = array('arrayfields' => $arrayfields, 'obj' => $objp, 'i' => $i, 'totalarray' => &$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook print $hookmanager->resPrint; // Action edit/delete and select diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 10b20b58b8528..7127c82443490 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3477,6 +3477,7 @@ print '
'; $tmp = ' '; $tmp = $tmp.''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); print '
'; //print ''.img_pdf().''; - $filearray = array('name'=>basename($file), 'fullname'=>$file, 'type'=>'file'); + $filearray = array('name' => basename($file), 'fullname' => $file, 'type' => 'file'); $out = ''; // Show file name with link to download diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index d1bde067b1e26..4096d3ae1613b 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -677,6 +677,7 @@ $massactionbutton = ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1); print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 742222ee4e618..ea017fbef3bff 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -154,14 +154,14 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'c.ref'=>'Ref', - 'c.ref_client'=>'RefCustomerOrder', - 'pd.description'=>'Description', - 's.nom'=>"ThirdParty", - 's.name_alias'=>"AliasNameShort", - 's.zip'=>"Zip", - 's.town'=>"Town", - 'c.note_public'=>'NotePublic', + 'c.ref' => 'Ref', + 'c.ref_client' => 'RefCustomerOrder', + 'pd.description' => 'Description', + 's.nom' => "ThirdParty", + 's.name_alias' => "AliasNameShort", + 's.zip' => "Zip", + 's.town' => "Town", + 'c.note_public' => 'NotePublic', ); if (empty($user->socid)) { $fieldstosearchall["c.note_private"] = "NotePrivate"; @@ -169,50 +169,50 @@ $checkedtypetiers = 0; $arrayfields = array( - 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5, 'searchall'=>1), - 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10, 'searchall'=>1), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>25), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30, 'searchall'=>1), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31, 'searchall'=>1), - 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), - 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35, 'searchall'=>1), - 's.zip'=>array('label'=>"Zip", 'checked'=>-1, 'position'=>40, 'searchall'=>1), - 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), - 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60, 'csslist'=>'nowraponall'), - 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65, 'csslist'=>'nowraponall'), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("delivery_note")), - 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), - 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), - 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), - 'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75), - 'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80), - 'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85), - 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>90), - 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>95), - 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>100), - 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>105), - 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110), - 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), + 'c.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5, 'searchall' => 1), + 'c.ref_client' => array('label' => "RefCustomerOrder", 'checked' => -1, 'position' => 10, 'searchall' => 1), + 'p.ref' => array('label' => "ProjectRef", 'checked' => -1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 20), + 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 25), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30, 'searchall' => 1), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => -1, 'position' => 31, 'searchall' => 1), + 's2.nom' => array('label' => 'ParentCompany', 'position' => 32, 'checked' => 0), + 's.town' => array('label' => "Town", 'checked' => -1, 'position' => 35, 'searchall' => 1), + 's.zip' => array('label' => "Zip", 'checked' => -1, 'position' => 40, 'searchall' => 1), + 'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 45), + 'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 50), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55), + 'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60, 'csslist' => 'nowraponall'), + 'c.date_delivery' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'), + 'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled("delivery_note")), + 'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67), + 'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68), + 'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69), + 'c.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 75), + 'c.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 80), + 'c.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 85), + 'c.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 90), + 'c.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 95), + 'c.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 100), + 'c.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 105), + 'c.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1), 'position' => 110), + 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 115), + 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 116), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), - 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), - 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), - 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), - 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135, 'searchall'=>1), - 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("delivery_note")), 'position'=>990), - 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), - 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), - 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) + 'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 120), + 'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 125), + 'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130), + 'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1), + 'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140), + 'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled("delivery_note")), 'position' => 990), + 'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995), + 'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999), + 'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000) ); -$parameters = array('fieldstosearchall'=>$fieldstosearchall); +$parameters = array('fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']; @@ -254,7 +254,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); +$parameters = array('socid' => $socid, 'arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -332,8 +332,8 @@ } $uploaddir = $conf->commande->multidir_output[$conf->entity]; $triggersendname = 'ORDER_SENTBYMAIL'; - $year=""; - $month=""; + $year = ""; + $month = ""; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; if ($massaction == 'confirm_createbills') { // Create bills from orders. @@ -348,7 +348,7 @@ $TFactThirdNbLines = array(); $nb_bills_created = 0; - $lastid= 0; + $lastid = 0; $lastref = ''; $db->begin(); @@ -1333,8 +1333,8 @@ // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); if ($permissiontovalidate) { $arrayofmassactions['prevalidate'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"); @@ -1367,8 +1367,8 @@ $url .= '&socid='.$socid; } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', ($contextpage == 'orderlist' || $contextpage == 'billableorders') && $permissiontoadd); @@ -1739,7 +1739,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1809,6 +1809,7 @@ Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"), Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceledShort") ); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -5, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); print '
'; print ''; print ''."\n"; @@ -4987,20 +4987,20 @@ function setRadioForTypeOfInvoice() { print ''; // Amount HT print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; } print ''; print ''; // Amount VAT print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print ''; + print ''; } print ''; @@ -5008,18 +5008,18 @@ function setRadioForTypeOfInvoice() { if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; } @@ -5082,10 +5082,10 @@ function js_recalculate_revenuestamp(){ print ''; // Amount TTC print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print ''; + print ''; } print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6155dfd9c8a30..e897ebd198bc2 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2614,14 +2614,14 @@ } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'total_mark_rate'; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 7912337feebba..33ec278f6465d 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -640,17 +640,17 @@ if (isModEnabled('multicurrency') && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; - print ''; + print ''; print ''; // Multicurrency Amount VAT print ''; - print ''; + print ''; print ''; // Multicurrency Amount TTC print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 34b08386bca85..535d07b84ddbc 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -97,7 +97,7 @@ /* * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -314,7 +314,7 @@ print ''; // Amount -print ''; +print ''; $disable_delete = 0; // Bank account @@ -563,7 +563,7 @@ // Status print ''; - $parameters = array('fk_paiement'=> (int) $object->id); + $parameters = array('fk_paiement' => (int) $object->id); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook print "\n"; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 8848d70c32539..9b42490727d18 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -113,7 +113,7 @@ print ''; print '
'; @@ -3535,6 +3536,7 @@ function setRadioForTypeOfInvoice() { print ''; print ''; @@ -3574,6 +3576,7 @@ function setRadioForTypeOfInvoice() { print '
'; $tmp = ' '; $tmp = $tmp.''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3, 'firstsituationonsmartphone'); print $desc; print '
'; @@ -3937,13 +3940,13 @@ function setRadioForTypeOfInvoice() { print ''; print ''; } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index d7191fa1590fd..4bbea2220336f 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -137,24 +137,24 @@ } $arrayfields = array( - 'f.titre'=>array('label'=>"Ref", 'checked'=>1), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), - 'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), - 'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>-1), - 'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1), - 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), - 'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0), - 'recurring'=>array('label'=>"RecurringInvoice", 'checked'=>1), - 'f.frequency'=>array('label'=>"Frequency", 'checked'=>1), - 'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1), - 'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1), - 'f.date_last_gen'=>array('label'=>"DateLastGenerationShort", 'checked'=>1), - 'f.date_when'=>array('label'=>"NextDateToExecutionShort", 'checked'=>1), - 'f.fk_user_author'=>array('label'=>"UserCreation", 'checked'=>0, 'position'=>500), - 'f.fk_user_modif'=>array('label'=>"UserModification", 'checked'=>0, 'position'=>505), - 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>520), - 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>525), - 'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 'f.titre' => array('label' => "Ref", 'checked' => 1), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1), + 'f.total_ht' => array('label' => "AmountHT", 'checked' => 1), + 'f.total_tva' => array('label' => "AmountVAT", 'checked' => -1), + 'f.total_ttc' => array('label' => "AmountTTC", 'checked' => 1), + 'f.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 0), + 'f.fk_cond_reglement' => array('label' => "PaymentTerm", 'checked' => 0), + 'recurring' => array('label' => "RecurringInvoice", 'checked' => 1), + 'f.frequency' => array('label' => "Frequency", 'checked' => 1), + 'f.unit_frequency' => array('label' => "FrequencyUnit", 'checked' => 1), + 'f.nb_gen_done' => array('label' => "NbOfGenerationDoneShort", 'checked' => 1), + 'f.date_last_gen' => array('label' => "DateLastGenerationShort", 'checked' => 1), + 'f.date_when' => array('label' => "NextDateToExecutionShort", 'checked' => 1), + 'f.fk_user_author' => array('label' => "UserCreation", 'checked' => 0, 'position' => 500), + 'f.fk_user_modif' => array('label' => "UserModification", 'checked' => 0, 'position' => 505), + 'f.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 520), + 'f.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 525), + 'status' => array('label' => "Status", 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -530,7 +530,7 @@ //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); +$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend' => $langs->trans("SendByMail"), 'builddoc' => $langs->trans("PDFMerge"))); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields @@ -681,7 +681,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // User creation @@ -708,10 +708,11 @@ if (!empty($arrayfields['status']['checked'])) { print ''; } @@ -946,9 +947,9 @@ if (!empty($arrayfields['f.unit_frequency']['checked'])) { print ''; @@ -1034,7 +1035,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Status @@ -1088,7 +1089,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7c2f594906a5e..6155dfd9c8a30 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -188,15 +188,15 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'f.ref'=>'Ref', - 'f.ref_client'=>'RefCustomer', - 'f.note_public'=>'NotePublic', - 's.nom'=>"ThirdParty", - 's.code_client'=>"CustomerCodeShort", - 's.name_alias'=>"AliasNameShort", - 's.zip'=>"Zip", - 's.town'=>"Town", - 'pd.description'=>'Description', + 'f.ref' => 'Ref', + 'f.ref_client' => 'RefCustomer', + 'f.note_public' => 'NotePublic', + 's.nom' => "ThirdParty", + 's.code_client' => "CustomerCodeShort", + 's.name_alias' => "AliasNameShort", + 's.zip' => "Zip", + 's.town' => "Town", + 'pd.description' => 'Description', ); if (empty($user->socid)) { $fieldstosearchall["f.note_private"] = "NotePrivate"; @@ -204,63 +204,63 @@ $checkedtypetiers = 0; $arrayfields = array( - 'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), - 'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1, 'position'=>10), - 'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15), - 'f.datef'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20), - 'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22), - 'f.subtype'=>array('label'=>"InvoiceSubtype", 'checked'=>0, 'position'=>17), - 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25), - 'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30), - 'p.ref'=>array('label'=>"ProjectRef", 'langs'=>'projects', 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>40), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), - 's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>-1, 'position'=>52), - 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), - 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), - 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60), - 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>70), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75), - 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80), - 'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85), - 'f.module_source'=>array('label'=>"POSModule", 'langs'=>'cashdesk', 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>"(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'position'=>90), - 'f.pos_source'=>array('label'=>"POSTerminal", 'langs'=>'cashdesk', 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>"(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'position'=>91), - 'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95), - 'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100), - 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110), - 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj == "1"), 'position'=>120), - 'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130), - 'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140), - 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow - 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>280), - 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>285), - 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>290), - 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>291), - 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>292), - 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>295), - 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled('multicurrency') ? 0 : 1), 'position'=>296), // Not enabled by default because slow + 'f.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 5), + 'f.ref_client' => array('label' => "RefCustomer", 'checked' => -1, 'position' => 10), + 'f.type' => array('label' => "Type", 'checked' => 0, 'position' => 15), + 'f.datef' => array('label' => "DateInvoice", 'checked' => 1, 'position' => 20), + 'f.date_valid' => array('label' => "DateValidation", 'checked' => 0, 'position' => 22), + 'f.subtype' => array('label' => "InvoiceSubtype", 'checked' => 0, 'position' => 17), + 'f.date_lim_reglement' => array('label' => "DateDue", 'checked' => 1, 'position' => 25), + 'f.date_closing' => array('label' => "DateClosing", 'checked' => 0, 'position' => 30), + 'p.ref' => array('label' => "ProjectRef", 'langs' => 'projects', 'checked' => 1, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 40), + 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'enabled' => (!isModEnabled('project') ? 0 : 1), 'position' => 41), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 50), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => 1, 'position' => 51), + 's.code_client' => array('label' => "CustomerCodeShort", 'checked' => -1, 'position' => 52), + 's2.nom' => array('label' => 'ParentCompany', 'position' => 32, 'checked' => 0), + 's.town' => array('label' => "Town", 'checked' => -1, 'position' => 55), + 's.zip' => array('label' => "Zip", 'checked' => 1, 'position' => 60), + 'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 65), + 'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 70), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 75), + 'f.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 1, 'position' => 80), + 'f.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => 1, 'position' => 85), + 'f.module_source' => array('label' => "POSModule", 'langs' => 'cashdesk', 'checked' => ($contextpage == 'poslist' ? 1 : 0), 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'position' => 90), + 'f.pos_source' => array('label' => "POSTerminal", 'langs' => 'cashdesk', 'checked' => ($contextpage == 'poslist' ? 1 : 0), 'enabled' => "(isModEnabled('cashdesk') || isModEnabled('takepos') || getDolGlobalInt('INVOICE_SHOW_POS'))", 'position' => 91), + 'f.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 95), + 'f.total_tva' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 100), + 'f.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax1_assuj == "1"), 'position' => 110), + 'f.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => 0, 'enabled' => ($mysoc->localtax2_assuj == "1"), 'position' => 120), + 'f.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 130), + 'dynamount_payed' => array('label' => "Received", 'checked' => 0, 'position' => 140), + 'rtp' => array('label' => "Rest", 'checked' => 0, 'position' => 150), // Not enabled by default because slow + 'f.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 280), + 'f.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 285), + 'f.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 290), + 'f.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 291), + 'f.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 292), + 'multicurrency_dynamount_payed' => array('label' => 'MulticurrencyAlreadyPaid', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 295), + 'multicurrency_rtp' => array('label' => 'MulticurrencyRemainderToPay', 'checked' => 0, 'enabled' => (!isModEnabled('multicurrency') ? 0 : 1), 'position' => 296), // Not enabled by default because slow 'total_pa' => array('label' => ((getDolGlobalString('MARGIN_TYPE') == '1') ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARGIN_RATES') ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight('margins', 'liretous') || !getDolGlobalString('DISPLAY_MARK_RATES') ? 0 : 1)), - 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), - 'f.tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502), - 'u.login'=>array('label'=>"UserAuthor", 'checked'=>1, 'position'=>504), - 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>506), + 'f.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), + 'f.tms' => array('type' => 'timestamp', 'label' => 'DateModificationShort', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 502), + 'u.login' => array('label' => "UserAuthor", 'checked' => 1, 'position' => 504), + 'sale_representative' => array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 506), //'f.fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>506), //'f.fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>508), //'f.fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>510), //'f.fk_user_closing' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>512), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>520, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>521, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), - 'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>530, 'enabled'=>'1'), - 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), + 'f.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'position' => 520, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position' => 521, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), + 'f.fk_fac_rec_source' => array('label' => 'GeneratedFromTemplate', 'checked' => 0, 'position' => 530, 'enabled' => '1'), + 'f.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), ); if (getDolGlobalString("INVOICE_USE_SITUATION") && getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { - $arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86); + $arrayfields['f.retained_warranty'] = array('label' => $langs->trans("RetainedWarranty"), 'checked' => 0, 'position' => 86); } // Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields) foreach ($object->fields as $key => $val) { @@ -280,10 +280,10 @@ } if ($newkey) { $arrayfields[$newkey] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), - 'position'=>$val['position'], + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'position' => $val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); } @@ -319,7 +319,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); +$parameters = array('socid' => $socid, 'arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -438,7 +438,7 @@ $remaintopay = price2num($facture->total_ttc - $totalpay); // hook to finalize the remaining amount, considering e.g. cash discount agreements - $parameters = array('remaintopay'=>$remaintopay); + $parameters = array('remaintopay' => $remaintopay); $reshook = $hookmanager->executeHooks('finalizeAmountOfInvoice', $parameters, $facture, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { if (!empty($remain = $hookmanager->resArray['remaintopay'])) { @@ -515,7 +515,7 @@ $objecttmp->resteapayer = price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); // hook to finalize the remaining amount, considering e.g. cash discount agreements - $parameters = array('remaintopay'=>$objecttmp->resteapayer); + $parameters = array('remaintopay' => $objecttmp->resteapayer); $reshook = $hookmanager->executeHooks('finalizeAmountOfInvoice', $parameters, $objecttmp, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { if (!empty($remaintopay = $hookmanager->resArray['remaintopay'])) { @@ -1194,10 +1194,10 @@ $param .= $hookmanager->resPrint; $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'presend' => img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight('facture', 'paiement')) { @@ -1227,8 +1227,8 @@ $url .= '&socid='.$socid; } $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->hasRight("facture", "creer")); } @@ -1266,7 +1266,7 @@ // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), array('type' => 'date', 'name' => 'datepaiment', 'label' => $langs->trans("Date"), 'datenow' => 1), array('type' => 'other', 'name' => 'paiementid', 'label' => $langs->trans("PaymentMode"), 'value' => $form->select_types_paiements(GETPOST('search_paymentmode'), 'paiementid', '', 0, 0, 1, 0, 1, '', 1)), - array('type' => 'other', 'name' => 'bankid', 'label' => $langs->trans("BankAccount"), 'value'=>$form->select_comptes('', 'bankid', 0, '', 0, '', 0, '', 1)), + array('type' => 'other', 'name' => 'bankid', 'label' => $langs->trans("BankAccount"), 'value' => $form->select_comptes('', 'bankid', 0, '', 0, '', 0, '', 1)), //array('type' => 'other', 'name' => 'invoicesid', 'label' => '', 'value'=>''), ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('MakePaymentAndClassifyPayed'), $langs->trans('EnterPaymentReceivedFromCustomer'), 'makepayment_confirm', $formquestion, 1, 0, 200, 500, 1); @@ -1374,15 +1374,16 @@ if (!empty($arrayfields['f.type']['checked'])) { print ''; } @@ -1611,7 +1612,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1648,7 +1649,8 @@ // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { print ''; } @@ -1850,7 +1852,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => $totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { @@ -1902,8 +1904,8 @@ $totalarray['val'] = array(); $totalarray['val']['f.total_ht'] = 0; $totalarray['val']['f.total_tva'] = 0; - $totalarray['val']['f.total_localtax1']=0; - $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_localtax1'] = 0; + $totalarray['val']['f.total_localtax1'] = 0; $totalarray['val']['f.total_ttc'] = 0; $totalarray['val']['totalam'] = 0; $totalarray['val']['rtp'] = 0; @@ -2041,7 +2043,7 @@ } } - $arraydata = array('alreadypaid' => $paiement, 'thirdparty' => $companystatic->getNomUrl(1, '', 12), 'userauthor'=>$userstatic->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected)); + $arraydata = array('alreadypaid' => $paiement, 'thirdparty' => $companystatic->getNomUrl(1, '', 12), 'userauthor' => $userstatic->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected)); print $facturestatic->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { print ''; @@ -2636,7 +2638,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -2755,7 +2757,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index c7150a8050487..284dbefcc5454 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -90,13 +90,13 @@ } $arrayfields = array( - 'bc.ref' => array('label'=>"Ref", 'checked'=>1, 'position'=>10), - 'bc.type' => array('label'=>"Type", 'checked'=>1, 'position'=>20), - 'bc.date_bordereau' => array('label'=>"DateCreation", 'checked'=>1, 'position'=>30), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>40), - 'bc.nbcheque' => array('label'=>"NbOfCheques", 'checked'=>1, 'position'=>50), - 'bc.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>60), - 'bc.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>70) + 'bc.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 10), + 'bc.type' => array('label' => "Type", 'checked' => 1, 'position' => 20), + 'bc.date_bordereau' => array('label' => "DateCreation", 'checked' => 1, 'position' => 30), + 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 40), + 'bc.nbcheque' => array('label' => "NbOfCheques", 'checked' => 1, 'position' => 50), + 'bc.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 60), + 'bc.statut' => array('label' => "Status", 'checked' => 1, 'position' => 70) ); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -108,7 +108,7 @@ * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -253,8 +253,8 @@ $url .= '&socid='.$socid; } $newcardbutton = ''; - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('banque', 'cheque')); @@ -271,6 +271,7 @@ print ''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; @@ -346,7 +347,7 @@ } // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); + $parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -400,7 +401,7 @@ } // Hook fields - $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index c5c478e46723c..b59aff4bfc9e3 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -92,22 +92,22 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'p.ref'=>"RefPayment", - 's.nom'=>"ThirdParty", - 'p.num_paiement'=>"Numero", - 'p.amount'=>"Amount", + 'p.ref' => "RefPayment", + 's.nom' => "ThirdParty", + 'p.num_paiement' => "Numero", + 'p.amount' => "Amount", ); $arrayfields = array( - 'p.ref' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), - 'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), - 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), - 'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("bank"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), - 'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), - 'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), - 'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))), + 'p.ref' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10), + 'p.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30), + 'c.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 40), + 'transaction' => array('label' => "BankTransactionLine", 'checked' => 1, 'position' => 50, 'enabled' => (isModEnabled("bank"))), + 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 60, 'enabled' => (isModEnabled("bank"))), + 'p.num_paiement' => array('label' => "Numero", 'checked' => 1, 'position' => 70, 'tooltip' => "ChequeOrTransferNumber"), + 'p.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 80), + 'p.statut' => array('label' => "Status", 'checked' => 1, 'position' => 90, 'enabled' => (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))), ); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -130,7 +130,7 @@ * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -386,6 +386,7 @@ print ''; print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1); if ($search_all) { @@ -491,7 +492,7 @@ } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -559,7 +560,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index a63f457062feb..24e37a3790461 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -460,7 +460,7 @@ if ($salaryBonPl) { $sql = "SELECT pl.rowid, pl.statut, pl.amount, pl.fk_user,"; $sql .= " u.rowid as socid, u.login as name"; - $sql .=" FROM llx_prelevement_lignes as pl"; + $sql .= " FROM llx_prelevement_lignes as pl"; $sql .= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql .= ", ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id); @@ -527,6 +527,7 @@ if (!empty($sortorder)) { print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index aafc6f1783325..febb51cdc1df2 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -240,6 +240,7 @@ if ($resql) { $num = $db->num_rows($resql); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Rejects"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); print"\n\n"; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 10cc824c9cdd4..ea5fe2d3ca9b8 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -97,20 +97,20 @@ $filtre = GETPOSTINT("filtre"); $arrayfields = array( - 'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10), - 'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20), - 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), - 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), - 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled('project'))), - 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), - 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), - 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), - 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), + 'cs.rowid' => array('label' => "Ref", 'checked' => 1, 'position' => 10), + 'cs.libelle' => array('label' => "Label", 'checked' => 1, 'position' => 20), + 'cs.fk_type' => array('label' => "Type", 'checked' => 1, 'position' => 30), + 'cs.date_ech' => array('label' => "Date", 'checked' => 1, 'position' => 40), + 'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50), + 'p.ref' => array('label' => "ProjectRef", 'checked' => 1, 'position' => 60, 'enabled' => (isModEnabled('project'))), + 'cs.fk_user' => array('label' => "Employee", 'checked' => 1, 'position' => 70), + 'cs.fk_mode_reglement' => array('checked' => -1, 'position' => 80, 'label' => "DefaultPaymentMode"), + 'cs.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 100), + 'cs.paye' => array('label' => "Status", 'checked' => 1, 'position' => 110), ); if (isModEnabled("bank")) { - $arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount"); + $arrayfields['cs.fk_account'] = array('checked' => -1, 'position' => 90, 'label' => "DefaultBankAccount"); } $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -134,7 +134,7 @@ * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -384,8 +384,8 @@ $url = DOL_URL_ROOT.'/compta/sociales/card.php?action=create'; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('MenuNewSocialContribution'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); @@ -411,6 +411,7 @@ print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1); if (empty($mysoc->country_id) && empty($mysoc->country_code)) { @@ -537,13 +538,14 @@ // Filter: Status if (!empty($arrayfields['cs.paye']['checked'])) { print '
'; } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -618,7 +620,7 @@ } // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -634,7 +636,7 @@ $savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; -$totalarray['val'] = array('totalttcfield'=>0); +$totalarray['val'] = array('totalttcfield' => 0); $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); @@ -659,7 +661,7 @@ print '
'; } // Output Kanban - print $chargesociale_static->getKanbanView('', array('project'=> $projectstatic, 'selected' => in_array($chargesociale_static->id, $arrayofselected))); + print $chargesociale_static->getKanbanView('', array('project' => $projectstatic, 'selected' => in_array($chargesociale_static->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; @@ -860,7 +862,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index d67ac1d12f3f5..573c3d5028949 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -82,16 +82,16 @@ } $arrayfields = array( - 't.rowid' =>array('checked'=>1, 'position'=>10, 'label'=>"Ref",), - 't.label' =>array('checked'=>1, 'position'=>20, 'label'=>"Label"), - 't.datev' =>array('checked'=>1, 'position'=>30, 'label'=>"PeriodEndDate"), - 't.fk_typepayment' =>array('checked'=>1, 'position'=>50, 'label'=>"DefaultPaymentMode"), - 't.amount' =>array('checked'=>1, 'position'=>90, 'label'=>"Amount"), - 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), + 't.rowid' => array('checked' => 1, 'position' => 10, 'label' => "Ref",), + 't.label' => array('checked' => 1, 'position' => 20, 'label' => "Label"), + 't.datev' => array('checked' => 1, 'position' => 30, 'label' => "PeriodEndDate"), + 't.fk_typepayment' => array('checked' => 1, 'position' => 50, 'label' => "DefaultPaymentMode"), + 't.amount' => array('checked' => 1, 'position' => 90, 'label' => "Amount"), + 't.status' => array('checked' => 1, 'position' => 90, 'label' => "Status"), ); if (isModEnabled("bank")) { - $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); + $arrayfields['t.fk_account'] = array('checked' => 1, 'position' => 60, 'label' => "DefaultBankAccount"); } $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -115,7 +115,7 @@ * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -171,8 +171,8 @@ // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye as status, t.fk_typepayment as type, t.fk_account,'; -$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; -$sql.= ' t.num_payment, pst.code as payment_code,'; +$sql .= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; +$sql .= ' t.num_payment, pst.code as payment_code,'; $sql .= ' SUM(ptva.amount) as alreadypayed'; $sqlfields = $sql; // $sql fields to remove for count total @@ -360,8 +360,8 @@ $url .= '&socid='.$socid; } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewVATPayment'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); @@ -486,6 +486,7 @@ if (!empty($arrayfields['t.status']['checked'])) { print ''; } @@ -494,7 +495,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -552,7 +553,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -770,7 +771,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 83f044af16f7f..fbcb057a85925 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -146,7 +146,7 @@ setEventMessages($db->lasterror, null, 'errors'); } -// @phan-suppress-next-line PhanPluginSuspiciousParamPosition +// @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $num, 'title_accountancy', 0, '', '', $limit); if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index c2d8db146f6ed..593f050d4c70e 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -106,6 +106,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if (empty($dolibarr_main_auth_ldap_filter)) { $userSearchFilter = "(".$ldapuserattr."=".$usertotest.")"; } else { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $userSearchFilter = str_replace('%1%', $usertotest, $dolibarr_main_auth_ldap_filter); } diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 067e4801d24ab..7f8ae3c09b5ec 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -180,6 +180,7 @@ public function write_file($object, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 08feae6096dda..5cc2c4602db36 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -100,11 +100,11 @@ public function __construct($db) // Define column position $this->posxref = $this->marge_gauche; - $this->update_main_doc_field=1; + $this->update_main_doc_field = 1; - $this->heightforinfotot=50; + $this->heightforinfotot = 50; - $this->xPosSignArea=120; + $this->xPosSignArea = 120; $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') > 0 ? getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT') : 5); @@ -175,7 +175,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -206,6 +206,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -443,7 +444,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -453,7 +454,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 7268933be1b84..037eb35b5b7b6 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -157,7 +157,7 @@ public function write_file($object, $_dir, $number, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -190,6 +190,7 @@ public function write_file($object, $_dir, $number, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $nboflines = count($this->lines); @@ -226,7 +227,7 @@ public function write_file($object, $_dir, $number, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -236,7 +237,7 @@ public function write_file($object, $_dir, $number, $outputlangs) dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); $outputlangs->charset_output = $sav_charset_output; return 1; // No error diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index a810b92a8d3e1..547b3c07d57ed 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -240,7 +240,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -552,15 +552,15 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -637,7 +637,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -647,7 +647,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1483,6 +1483,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 82cc9b1a16ae8..911c2854206b2 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -280,7 +280,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -699,9 +699,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -761,15 +761,15 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); // Add line if (getDolGlobalInt('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } @@ -845,7 +845,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -855,7 +855,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1672,6 +1672,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } @@ -1898,6 +1899,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 885b61da80602..95c106013cf82 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1383,7 +1383,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { - // @phan-suppress-next-line PhanPluginSuspiciousParamOrder + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index e24379572205e..52878e4de2131 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -183,7 +183,7 @@ public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hided $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -227,6 +227,7 @@ public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hided $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -315,10 +316,10 @@ public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hided // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -374,7 +375,7 @@ public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hided $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -384,7 +385,7 @@ public function write_file(&$object, $outputlangs, $srctemplatepath = '', $hided dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; } else { diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 7f1cd448e2e3e..7e1675e40c964 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -253,7 +253,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -298,6 +298,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -549,10 +550,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY - 1, $this->page_largeur - $this->marge_droite, $nexY - 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // Detect if some page were added automatically and output _tableau for past pages @@ -617,7 +618,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -627,7 +628,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index afdc64bf80cbd..692a1c2430194 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -227,7 +227,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -267,6 +267,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -522,7 +523,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -532,7 +533,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f1e0d0c26ad84..f2f05ed7f847c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -367,6 +367,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->setSignature($cert, $certprivate, $this->emetteur->name, '', 2, $info); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount @@ -2123,6 +2124,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -2130,6 +2132,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection); // Show shipping address diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 438123738d439..59266ff83a3be 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -392,6 +392,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->setSignature($cert, $certprivate, $this->emetteur->name, '', 2, $info); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount @@ -2374,6 +2375,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox - 2, 2, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -2381,6 +2383,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox - 2, 4, $carac_client, 0, $ltrdirection); // Show shipping address @@ -2660,6 +2663,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 8aa4fb74b4c82..8c2b45055fc5f 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -175,7 +175,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -216,6 +216,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -414,7 +415,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -424,7 +425,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; } else { diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php index bc1d33b87ccd1..b2bc3a79b7abb 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php @@ -185,7 +185,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks // Set nblines with the new command lines content after hook @@ -227,6 +227,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -251,7 +252,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, '', 12, $tab_top); - $tab_top +=4; + $tab_top += 4; $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxnotes + 1, $tab_top + 1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); @@ -425,7 +426,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -435,7 +436,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index cfaffb265a2a9..8b5fd2e39bd1f 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -374,7 +374,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -411,6 +411,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -611,10 +612,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -666,9 +667,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $nexY += 5; $curY = $nexY; - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(220, 26, 26))); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(220, 26, 26))); $pdf->line($this->marge_gauche, $curY - 1, $this->page_largeur - $this->marge_droite, $curY - 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); $pdf->SetFont('', 'B', $default_font_size - 1); $pdf->SetTextColor(0, 0, 120); @@ -750,7 +751,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -760,7 +761,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -821,10 +822,10 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ // Output Rect //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(220, 26, 26))); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(220, 26, 26))); $pdf->SetDrawColor(220, 26, 26); $pdf->line($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite, $tab_top); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); $pdf->SetDrawColor(128, 128, 128); $pdf->SetTextColor(0, 0, 120); @@ -892,9 +893,9 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ } $pdf->SetDrawColor(220, 26, 26); - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(220, 26, 26))); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(220, 26, 26))); $pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index c718af284739a..cc5bc784df03b 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -203,7 +203,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -243,6 +243,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Does we have at least one line with discount $this->atleastonediscount @@ -627,7 +628,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -637,7 +638,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1466,6 +1467,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index eba1ee529e0b7..acd48af037d88 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -166,7 +166,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -206,6 +206,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -571,7 +572,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -581,7 +582,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 639252bd960cd..498143880a37b 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -183,7 +183,7 @@ public function write_file($object, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -234,6 +234,7 @@ public function write_file($object, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -410,10 +411,10 @@ public function write_file($object, $outputlangs) // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -476,7 +477,7 @@ public function write_file($object, $outputlangs) // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -486,7 +487,7 @@ public function write_file($object, $outputlangs) dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 021e855e41747..6102bbaf379a3 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -214,7 +214,7 @@ public function write_file($object, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -267,6 +267,7 @@ public function write_file($object, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -316,106 +317,106 @@ public function write_file($object, $outputlangs) $nexY = $tab_top + $heightoftitleline + 1; $listofreferent = array( - 'propal'=>array( - 'name'=>"Proposals", - 'title'=>"ListProposalsAssociatedProject", - 'class'=>'Propal', - 'table'=>'propal', - 'datefieldname'=>'datep', - 'test'=> isModEnabled('propal') && $user->hasRight('propal', 'lire'), - 'lang'=>'propal'), - 'order'=>array( - 'name'=>"CustomersOrders", - 'title'=>"ListOrdersAssociatedProject", - 'class'=>'Commande', - 'table'=>'commande', - 'datefieldname'=>'date_commande', - 'test'=> isModEnabled('order') && $user->hasRight('commande', 'lire'), - 'lang'=>'orders'), - 'invoice'=>array( - 'name'=>"CustomersInvoices", - 'title'=>"ListInvoicesAssociatedProject", - 'class'=>'Facture', - 'margin'=>'add', - 'table'=>'facture', - 'datefieldname'=>'datef', - 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), - 'lang'=>'bills'), - 'invoice_predefined'=>array( - 'name'=>"PredefinedInvoices", - 'title'=>"ListPredefinedInvoicesAssociatedProject", - 'class'=>'FactureRec', - 'table'=>'facture_rec', - 'datefieldname'=>'datec', - 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), - 'lang'=>'bills'), - 'order_supplier'=>array( - 'name'=>"SuppliersOrders", - 'title'=>"ListSupplierOrdersAssociatedProject", - 'class'=>'CommandeFournisseur', - 'table'=>'commande_fournisseur', - 'datefieldname'=>'date_commande', - 'test'=>(isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')), - 'lang'=>'orders'), - 'invoice_supplier'=>array( - 'name'=>"BillsSuppliers", - 'title'=>"ListSupplierInvoicesAssociatedProject", - 'class'=>'FactureFournisseur', - 'margin'=>'minus', - 'table'=>'facture_fourn', - 'datefieldname'=>'datef', - 'test'=>(isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')), - 'lang'=>'bills'), - 'contract'=>array( - 'name'=>"Contracts", - 'title'=>"ListContractAssociatedProject", - 'class'=>'Contrat', - 'table'=>'contrat', - 'datefieldname'=>'date_contrat', - 'test'=> isModEnabled('contract') && $user->hasRight('contrat', 'lire'), - 'lang'=>'contract'), - 'intervention'=>array( - 'name'=>"Interventions", - 'title'=>"ListFichinterAssociatedProject", - 'class'=>'Fichinter', - 'table'=>'fichinter', - 'datefieldname'=>'date_valid', - 'disableamount'=>1, - 'test'=>isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), - 'lang'=>'interventions'), - 'trip'=>array( - 'name'=>"TripsAndExpenses", - 'title'=>"ListExpenseReportsAssociatedProject", - 'class'=>'Deplacement', - 'table'=>'deplacement', - 'datefieldname'=>'dated', - 'margin'=>'minus', - 'disableamount'=>1, - 'test'=>isModEnabled('deplacement') && $user->hasRight('deplacement', 'lire'), - 'lang'=>'trip'), - 'expensereport'=>array( - 'name'=>"ExpensesReports", - 'title'=>"ListExpenseReportsAssociatedProject", - 'class'=>'ExpenseReport', - 'table'=>'expensereport', - 'datefieldname'=>'dated', - 'margin'=>'minus', - 'disableamount'=>1, - 'test'=>isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'), - 'lang'=>'trip'), - 'agenda'=>array( - 'name'=>"Agenda", - 'title'=>"ListActionsAssociatedProject", - 'class'=>'ActionComm', - 'table'=>'actioncomm', - 'datefieldname'=>'datep', - 'disableamount'=>1, - 'test'=> isModEnabled('agenda') && $user->hasRight('agenda', 'allactions', 'read'), - 'lang'=>'agenda') + 'propal' => array( + 'name' => "Proposals", + 'title' => "ListProposalsAssociatedProject", + 'class' => 'Propal', + 'table' => 'propal', + 'datefieldname' => 'datep', + 'test' => isModEnabled('propal') && $user->hasRight('propal', 'lire'), + 'lang' => 'propal'), + 'order' => array( + 'name' => "CustomersOrders", + 'title' => "ListOrdersAssociatedProject", + 'class' => 'Commande', + 'table' => 'commande', + 'datefieldname' => 'date_commande', + 'test' => isModEnabled('order') && $user->hasRight('commande', 'lire'), + 'lang' => 'orders'), + 'invoice' => array( + 'name' => "CustomersInvoices", + 'title' => "ListInvoicesAssociatedProject", + 'class' => 'Facture', + 'margin' => 'add', + 'table' => 'facture', + 'datefieldname' => 'datef', + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire'), + 'lang' => 'bills'), + 'invoice_predefined' => array( + 'name' => "PredefinedInvoices", + 'title' => "ListPredefinedInvoicesAssociatedProject", + 'class' => 'FactureRec', + 'table' => 'facture_rec', + 'datefieldname' => 'datec', + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire'), + 'lang' => 'bills'), + 'order_supplier' => array( + 'name' => "SuppliersOrders", + 'title' => "ListSupplierOrdersAssociatedProject", + 'class' => 'CommandeFournisseur', + 'table' => 'commande_fournisseur', + 'datefieldname' => 'date_commande', + 'test' => (isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')), + 'lang' => 'orders'), + 'invoice_supplier' => array( + 'name' => "BillsSuppliers", + 'title' => "ListSupplierInvoicesAssociatedProject", + 'class' => 'FactureFournisseur', + 'margin' => 'minus', + 'table' => 'facture_fourn', + 'datefieldname' => 'datef', + 'test' => (isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')), + 'lang' => 'bills'), + 'contract' => array( + 'name' => "Contracts", + 'title' => "ListContractAssociatedProject", + 'class' => 'Contrat', + 'table' => 'contrat', + 'datefieldname' => 'date_contrat', + 'test' => isModEnabled('contract') && $user->hasRight('contrat', 'lire'), + 'lang' => 'contract'), + 'intervention' => array( + 'name' => "Interventions", + 'title' => "ListFichinterAssociatedProject", + 'class' => 'Fichinter', + 'table' => 'fichinter', + 'datefieldname' => 'date_valid', + 'disableamount' => 1, + 'test' => isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), + 'lang' => 'interventions'), + 'trip' => array( + 'name' => "TripsAndExpenses", + 'title' => "ListExpenseReportsAssociatedProject", + 'class' => 'Deplacement', + 'table' => 'deplacement', + 'datefieldname' => 'dated', + 'margin' => 'minus', + 'disableamount' => 1, + 'test' => isModEnabled('deplacement') && $user->hasRight('deplacement', 'lire'), + 'lang' => 'trip'), + 'expensereport' => array( + 'name' => "ExpensesReports", + 'title' => "ListExpenseReportsAssociatedProject", + 'class' => 'ExpenseReport', + 'table' => 'expensereport', + 'datefieldname' => 'dated', + 'margin' => 'minus', + 'disableamount' => 1, + 'test' => isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire'), + 'lang' => 'trip'), + 'agenda' => array( + 'name' => "Agenda", + 'title' => "ListActionsAssociatedProject", + 'class' => 'ActionComm', + 'table' => 'actioncomm', + 'datefieldname' => 'datep', + 'disableamount' => 1, + 'test' => isModEnabled('agenda') && $user->hasRight('agenda', 'allactions', 'read'), + 'lang' => 'agenda') ); $hookmanager->initHooks(array('completeListOfReferent')); - $hookmanager->executeHooks('completeListOfReferent', ['listofreferent'=>$listofreferent], $object, $action); + $hookmanager->executeHooks('completeListOfReferent', ['listofreferent' => $listofreferent], $object, $action); if (!empty($hookmanager->resArray)) { $listofreferent = array_merge($listofreferent, $hookmanager->resArray); } @@ -708,7 +709,7 @@ public function write_file($object, $outputlangs) // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -718,7 +719,7 @@ public function write_file($object, $outputlangs) dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 855579aa10f19..7d3b887dfd863 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -178,7 +178,7 @@ public function write_file($object, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -229,6 +229,7 @@ public function write_file($object, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -408,10 +409,10 @@ public function write_file($object, $outputlangs) // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -474,7 +475,7 @@ public function write_file($object, $outputlangs) // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -484,7 +485,7 @@ public function write_file($object, $outputlangs) dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c061fa61c19b5..ec04f0001a83e 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -294,7 +294,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -335,6 +335,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount @@ -664,7 +665,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = $posYAfterImage; @@ -673,10 +674,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -827,7 +828,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede //Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -837,7 +838,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -911,7 +912,7 @@ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("DateDeliveryPlanned").':'; $pdf->MultiCell(80, 4, $titre, 0, 'L'); - $pdf->SetFont('', '', $default_font_size -$diffsizetitle); + $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); $dlp = dol_print_date($object->delivery_date, $displaydate, false, $outputlangs, true); $pdf->MultiCell(80, 4, $dlp, 0, 'L'); @@ -1694,6 +1695,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -1701,6 +1703,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7814fdebeb7ca..184d95c45dab7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -276,7 +276,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -317,6 +317,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount @@ -711,9 +712,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -784,7 +785,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = max($nexY, $posYAfterImage); @@ -793,10 +794,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -940,7 +941,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede //Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -950,7 +951,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1771,6 +1772,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -1778,6 +1780,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } @@ -2036,6 +2039,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 8bb3ad2444d63..13dc9da2488b6 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -175,7 +175,7 @@ public function write_file($_dir, $month, $year, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$this, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $this, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $this, $action); // Note that $action and $this may have been modified by some hooks @@ -337,6 +337,7 @@ public function write_file($_dir, $month, $year, $outputlangs) $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetAutoPageBreak(1, 0); @@ -365,7 +366,7 @@ public function write_file($_dir, $month, $year, $outputlangs) $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$this, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $this, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -375,7 +376,7 @@ public function write_file($_dir, $month, $year, $outputlangs) dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; } @@ -495,7 +496,7 @@ public function Body(&$pdf, $page, $lines, $outputlangs) if ($yp > $this->tab_height - 15) { $pdf->SetFillColor(255, 255, 255); $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); - $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash' => 1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetFont('', 'B', $default_font_size - 1); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); @@ -556,7 +557,7 @@ public function Body(&$pdf, $page, $lines, $outputlangs) if ((($this->doc_type == 'client' && getDolGlobalString('PAYMENTS_REPORT_GROUP_BY_MOD')) || ($this->doc_type == 'fourn' && getDolGlobalString('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'))) && ($mod != $lines[$j + 1][2])) { $pdf->SetFillColor(245, 245, 245); $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); - $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash' => 1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'I', $default_font_size - 1); @@ -580,7 +581,7 @@ public function Body(&$pdf, $page, $lines, $outputlangs) $total += $total_page; $pdf->SetFillColor(255, 255, 255); $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); - $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1)); + $pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash' => 1)); $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'B'); diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index e104ceeb61c54..e79a5b70d5a2b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -233,7 +233,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -275,6 +275,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -548,10 +549,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY - 1, $this->page_largeur - $this->marge_droite, $nexY - 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // Detect if some page were added automatically and output _tableau for past pages @@ -610,7 +611,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index bd06a5c1bd5a5..09247f96fd386 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -176,7 +176,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -216,6 +216,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -397,10 +398,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -453,9 +454,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $curY = $nexY; if ($nblines > 0) { - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200))); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); $pdf->line($this->marge_gauche, $curY - 1, $this->page_largeur - $this->marge_droite, $curY - 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); $pdf->SetFont('', 'B', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -547,7 +548,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -557,7 +558,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -617,35 +618,35 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter - $pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200))); + $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); $pdf->SetDrawColor(200, 200, 200); $pdf->line($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite, $tab_top); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); $pdf->SetDrawColor(128, 128, 128); $pdf->SetTextColor(0, 0, 0); if (empty($hidetop)) { - $pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11); // line takes a position y in 2nd parameter and 4th parameter + $pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); // line takes a position y in 2nd parameter and 4th parameter $pdf->SetXY($this->posxdesc - 1, $tab_top + 1); $pdf->MultiCell($this->wref, 3, $outputlangs->transnoentities("Ref"), '', 'L'); } - $pdf->line($this->posxlabel-1, $tab_top, $this->posxlabel-1, $tab_top + $tab_height); + $pdf->line($this->posxlabel - 1, $tab_top, $this->posxlabel - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxlabel - 1, $tab_top + 1); $pdf->MultiCell($this->posxqty - $this->posxlabel - 1, 2, $outputlangs->transnoentities("Label"), '', 'C'); } - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); + $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty - 1, $tab_top + 1); $pdf->MultiCell($this->posxup - $this->posxqty - 1, 2, $outputlangs->transnoentities("Units"), '', 'C'); } - $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); + $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxup - 1, $tab_top + 1); $pdf->MultiCell($this->posxunit - $this->posxup - 1, 2, $outputlangs->transnoentities("AverageUnitPricePMPShort"), '', 'C'); @@ -657,7 +658,7 @@ protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $ $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '', 'C'); } - $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); + $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1); $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("SellPriceMin"), '', 'C'); diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 725abb6a34b20..8f14233e3200e 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -323,6 +323,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 1ffd3b4157782..bc1442e56b400 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -255,7 +255,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -292,6 +292,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right /// Does we have at least one line with discount $this->atleastonediscount @@ -662,9 +663,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -727,10 +728,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } @@ -796,7 +797,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -806,7 +807,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1650,6 +1651,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index bbb3109d2e6ca..7ff56fc4a2c85 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -220,7 +220,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -267,6 +267,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Set $this->atleastonediscount if you have at least one discount @@ -503,10 +504,10 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -578,7 +579,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -588,7 +589,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 02583e9fc22e8..dfe2679983bf1 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -255,7 +255,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -295,6 +295,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Does we have at least one line with discount $this->atleastonediscount @@ -638,9 +639,9 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -711,7 +712,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = $posYAfterImage; @@ -720,10 +721,10 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // Detect if some page were added automatically and output _tableau for past pages @@ -796,7 +797,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -806,7 +807,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1424,6 +1425,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -1431,6 +1433,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } @@ -1639,6 +1642,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index c8ff202600229..8b735fd88e32f 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -266,7 +266,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -307,6 +307,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Positionne $this->atleastonediscount si on a au moins une remise @@ -588,7 +589,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = $posYAfterImage; @@ -597,10 +598,10 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -675,7 +676,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -685,7 +686,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1338,6 +1339,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -1345,6 +1347,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 2fcd927b72c3c..b1b6e28514f24 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -223,7 +223,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -263,6 +263,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -383,10 +384,10 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -456,7 +457,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -466,7 +467,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { 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 be2c6e389376f..c9a8dc177701b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -258,7 +258,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -297,6 +297,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Positionne $this->atleastonediscount si on a au moins une remise @@ -575,7 +576,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = $posYAfterImage; @@ -584,10 +585,10 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } $nexY += 2; // Add space between lines @@ -665,7 +666,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede //Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -675,7 +676,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index f42c862bb9e26..1c77541020bdc 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -254,7 +254,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -294,6 +294,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $pdf->SetCompression(false); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // Does we have at least one line with discount $this->atleastonediscount @@ -637,9 +638,9 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -710,7 +711,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } - $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate'=>$vatrate, 'vatcode'=>$vatcode, 'amount'=> $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); + $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')] = array('vatrate' => $vatrate, 'vatcode' => $vatcode, 'amount' => $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] + $tvaligne); if ($posYAfterImage > $posYAfterDescription) { $nexY = $posYAfterImage; @@ -719,10 +720,10 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80))); + $pdf->SetLineStyle(array('dash' => '1,1', 'color' => array(80, 80, 80))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY); - $pdf->SetLineStyle(array('dash'=>0)); + $pdf->SetLineStyle(array('dash' => 0)); } // Detect if some page were added automatically and output _tableau for past pages @@ -795,7 +796,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -805,7 +806,7 @@ public function write_file($object, $outputlangs = null, $srctemplatepath = '', dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1413,6 +1414,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection); $posy = $pdf->getY(); @@ -1420,6 +1422,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) // Show recipient information $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx + 2, $posy); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection); } @@ -1610,6 +1613,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f2412524f12e8..8fb61bdb4e08e 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -290,7 +290,7 @@ // $senderissupplier=2 is the same as 1 but disables test on minimum qty, disable autofill qty with minimum and autofill unit price if ($senderissupplier != 2) { $ajaxoptions = array( - 'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key + 'update' => array('qty' => 'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo) ); @@ -344,6 +344,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // @FIXME Not working yet $tmpbacktopagejsfields = 'addproduct:id,search_id'; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print dolButtonToOpenUrlInDialogPopup('addproduct', $langs->transnoentitiesnoconv('AddProduct'), $newbutton, $url, '', '', $tmpbacktopagejsfields); } else { print ''; @@ -355,6 +356,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { // @FIXME Not working yet $tmpbacktopagejsfields = 'addproduct:id,search_id'; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print dolButtonToOpenUrlInDialogPopup('addproduct', $langs->transnoentitiesnoconv('AddService'), $newbutton, $url, '', '', $tmpbacktopagejsfields); } else { print ''; @@ -382,14 +384,14 @@ } if (is_object($hookmanager) && empty($senderissupplier)) { - $parameters = array('fk_parent_line'=>GETPOSTINT('fk_parent_line')); + $parameters = array('fk_parent_line' => GETPOSTINT('fk_parent_line')); $reshook = $hookmanager->executeHooks('formCreateProductOptions', $parameters, $object, $action); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; } } if (is_object($hookmanager) && !empty($senderissupplier)) { - $parameters = array('htmlname'=>'addproduct'); + $parameters = array('htmlname' => 'addproduct'); $reshook = $hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; @@ -441,7 +443,7 @@ if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') { // We must have same test in printObjectLines $coldisplay++; ?> - '; $coldisplay++; @@ -475,7 +477,7 @@ - @@ -510,21 +512,21 @@ $coldisplay++; ?> - %'; - $coldisplay++; - } - if (getDolGlobalString('DISPLAY_MARK_RATES')) { - echo ''; - $coldisplay++; - } + %'; + $coldisplay++; + } + if (getDolGlobalString('DISPLAY_MARK_RATES')) { + echo ''; + $coldisplay++; + } } } $coldisplay += $colspan; @@ -536,15 +538,15 @@ element == 'contrat')) && $dateSelector && GETPOST('type') != '0') { // We show date field if required - print ''."\n"; + print ''."\n"; if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) { print ''; } - print ''; - print ''."\n"; + print ''; + print ''; + print ''."\n"; } @@ -778,7 +780,7 @@ function checkFreeLine(e, npRate) } } }); - /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() @@ -890,18 +892,18 @@ function(data) { console.log("stringforvatrateselection="+stringforvatrateselection+" -> value of option label for this key="+$('#tva_tx option[value="'+stringforvatrateselection+'"]').val()); $('#tva_tx option[value="'+stringforvatrateselection+'"]').prop('selected', true); - + var proddesc = data.desc_trans; - + var proddesc = data.desc; - + console.log("objectline_create.tpl Load description into text area : "+proddesc); - + if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") { var editor = CKEDITOR.instances['dp_desc']; @@ -909,25 +911,25 @@ function(data) { editor.setData(proddesc); } } - + jQuery('#dp_desc').text(proddesc); + - + if (getDolGlobalString('PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES')) { ?> jQuery.each(data.array_options, function( key, value ) { jQuery('div[class*="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); }); - + }, 'json' ); } - hasRight('margins', 'creer')) { @@ -1036,7 +1038,7 @@ function(data) { }, 'json'); - diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 6a40d1bbe97b6..13ffaf1551179 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -84,10 +84,10 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'd.rowid'=>'Id', - 'd.ref'=>'Ref', - 'd.lastname'=>'Lastname', - 'd.firstname'=>'Firstname', + 'd.rowid' => 'Id', + 'd.ref' => 'Ref', + 'd.lastname' => 'Lastname', + 'd.firstname' => 'Firstname', ); // Security check @@ -288,13 +288,14 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); if ($user->hasRight('don', 'creer')) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create'); } +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($search_all) { @@ -350,11 +351,12 @@ print ''; print ''; if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 2762f271fa2f3..4e25ab9082332 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -81,21 +81,21 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'pd.rowid'=>"RefPayment", - 's.nom'=>"ThirdParty", - 'pd.num_paiement'=>"Numero", - 'pd.amount'=>"Amount", + 'pd.rowid' => "RefPayment", + 's.nom' => "ThirdParty", + 'pd.num_paiement' => "Numero", + 'pd.amount' => "Amount", ); $arrayfields = array( - 'pd.rowid' => array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), - 'pd.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), - 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), - 'c.code' => array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'pd.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>70, 'enabled'=>(isModEnabled("bank"))), - 'pd.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), + 'pd.rowid' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10), + 'pd.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30), + 'c.code' => array('label' => "Type", 'checked' => 1, 'position' => 40), + 'pd.num_paiement' => array('label' => "Numero", 'checked' => 1, 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"), + 'transaction' => array('label' => "BankTransactionLine", 'checked' => 1, 'position' => 60, 'enabled' => (isModEnabled("bank"))), + 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 70, 'enabled' => (isModEnabled("bank"))), + 'pd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 80), ); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -116,7 +116,7 @@ * Actions */ -$parameters = array('socid'=>$paiementid); +$parameters = array('socid' => $paiementid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -316,6 +316,7 @@ print ''; print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("DonationPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1); if ($search_all) { @@ -412,7 +413,7 @@ } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -477,7 +478,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index c68cef6ebb68a..37e1c6a4e17cd 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -108,11 +108,11 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'e.ref'=>"Ref", - 's.nom'=>"ThirdParty", - 'e.note_public'=>'NotePublic', + 'e.ref' => "Ref", + 's.nom' => "ThirdParty", + 'e.note_public' => 'NotePublic', //'e.fk_shipping_method'=>'SendingMethod', // TODO fix this, does not work - 'e.tracking_number'=>"TrackingNumber", + 'e.tracking_number' => "TrackingNumber", ); if (empty($user->socid)) { $fieldstosearchall["e.note_private"] = "NotePrivate"; @@ -120,24 +120,24 @@ $checkedtypetiers = 0; $arrayfields = array( - 'e.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>1), - 'e.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1, 'position'=>2), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>3), - 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1, 'position'=>4), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1, 'position'=>5), - 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>6), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>7), - 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers, 'position'=>8), - 'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1, 'position'=>9), - 'e.fk_shipping_method'=>array('label'=>$langs->trans('SendingMethod'), 'checked'=>1, 'position'=>10), - 'e.tracking_number'=>array('label'=>$langs->trans("TrackingNumber"), 'checked'=>1, 'position'=>11), - 'e.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0, 'position'=>12), - 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'position'=>1010, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'position'=>1020, 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), - 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1100, 'enabled'=>'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"') + 'e.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1, 'position' => 1), + 'e.ref_customer' => array('label' => $langs->trans("RefCustomer"), 'checked' => 1, 'position' => 2), + 's.nom' => array('label' => $langs->trans("ThirdParty"), 'checked' => 1, 'position' => 3), + 's.town' => array('label' => $langs->trans("Town"), 'checked' => 1, 'position' => 4), + 's.zip' => array('label' => $langs->trans("Zip"), 'checked' => 1, 'position' => 5), + 'state.nom' => array('label' => $langs->trans("StateShort"), 'checked' => 0, 'position' => 6), + 'country.code_iso' => array('label' => $langs->trans("Country"), 'checked' => 0, 'position' => 7), + 'typent.code' => array('label' => $langs->trans("ThirdPartyType"), 'checked' => $checkedtypetiers, 'position' => 8), + 'e.date_delivery' => array('label' => $langs->trans("DateDeliveryPlanned"), 'checked' => 1, 'position' => 9), + 'e.fk_shipping_method' => array('label' => $langs->trans('SendingMethod'), 'checked' => 1, 'position' => 10), + 'e.tracking_number' => array('label' => $langs->trans("TrackingNumber"), 'checked' => 1, 'position' => 11), + 'e.weight' => array('label' => $langs->trans("Weight"), 'checked' => 0, 'position' => 12), + 'e.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), + 'e.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 500), + 'e.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1, 'position' => 1000), + 'l.ref' => array('label' => $langs->trans("DeliveryRef"), 'checked' => 1, 'position' => 1010, 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), + 'l.date_delivery' => array('label' => $langs->trans("DateReceived"), 'position' => 1020, 'checked' => 1, 'enabled' => (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), + 'e.billed' => array('label' => $langs->trans("Billed"), 'checked' => 1, 'position' => 1100, 'enabled' => 'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"') ); // Extra fields @@ -168,7 +168,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -215,7 +215,7 @@ // If massaction is close if ($massaction == 'classifyclose') { - $error=0; + $error = 0; $selectids = GETPOST('toselect', 'array'); foreach ($selectids as $selectid) { // $object->fetch($selectid); @@ -600,8 +600,8 @@ // if (!empty($socid)) $url .= '&socid='.$socid; // $newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url, '', $user->rights->expedition->creer); $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2', '', $user->hasRight('expedition', 'creer')); @@ -617,6 +617,7 @@ print ''; print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendShippingRef"; @@ -799,7 +800,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -815,7 +816,7 @@ // Status if (!empty($arrayfields['e.fk_statut']['checked'])) { print ''; } // Status billed @@ -903,7 +904,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, '$totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, '$totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['e.datec']['checked'])) { @@ -946,7 +947,7 @@ $shipment->id = $obj->rowid; $shipment->ref = $obj->ref; - $shipment->shipping_method_id=$obj->fk_shipping_method; + $shipment->shipping_method_id = $obj->fk_shipping_method; $companystatic->id = $obj->socid; $companystatic->ref = $obj->name; @@ -1093,7 +1094,7 @@ } if (!empty($arrayfields['e.fk_shipping_method']['checked'])) { // Get code using getLabelFromKey - $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); + $code = $langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); print ''; } @@ -714,7 +715,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { @@ -921,7 +922,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1033,7 +1034,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6c097c907d888..c6b9c6457e592 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2434,6 +2434,7 @@ function setRadioForTypeOfInvoice() { '; $tmp = $tmp.''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); print '
'; $tmp = $tmp.''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3, 'depositonsmartphone'); print $desc; print ''; $incoterm_id = GETPOST('incoterm_id'); - $incoterm_location = GETPOST('location_incoterms'); + $location_incoterms = GETPOST('location_incoterms'); if (empty($incoterm_id)) { $incoterm_id = (!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms); - $incoterm_location = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); + $location_incoterms = (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : $soc->location_incoterms); } print img_picto('', 'incoterm', 'class="pictofixedwidth"'); - print $form->select_incoterms($incoterm_id, $incoterm_location); + print $form->select_incoterms($incoterm_id, $location_incoterms); print '
'; $liststatus = array( - 0=>$langs->trans("Draft"), - 1=>$langs->trans("Active"), - -1=>$langs->trans("Disabled"), + 0 => $langs->trans("Draft"), + 1 => $langs->trans("Active"), + -1 => $langs->trans("Disabled"), ); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -2, 0, 0, '', 0, 0, 0, '', 'width100 onrightofpage'); print ''; if ($objp->frequency > 1) { - $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); } else { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); } print($objp->frequency > 0 ? $dur[$objp->unit_frequency] : ''); print ''; $listtype = array( - Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), - Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + Facture::TYPE_STANDARD => $langs->trans("InvoiceStandard"), + Facture::TYPE_DEPOSIT => $langs->trans("InvoiceDeposit"), + Facture::TYPE_CREDIT_NOTE => $langs->trans("InvoiceAvoir"), + Facture::TYPE_REPLACEMENT => $langs->trans("InvoiceReplacement"), ); if (getDolGlobalString('INVOICE_USE_SITUATION')) { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); } //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); print ''; - $liststatus = array('0'=>$langs->trans("BillShortStatusDraft"), '0,1'=>$langs->trans("BillShortStatusDraft").'+'.$langs->trans("BillShortStatusNotPaid"), '1'=>$langs->trans("BillShortStatusNotPaid"), '1,2'=>$langs->trans("BillShortStatusNotPaid").'+'.$langs->trans("BillShortStatusPaid"), '2'=>$langs->trans("BillShortStatusPaid"), '3'=>$langs->trans("BillShortStatusCanceled")); + $liststatus = array('0' => $langs->trans("BillShortStatusDraft"), '0,1' => $langs->trans("BillShortStatusDraft").'+'.$langs->trans("BillShortStatusNotPaid"), '1' => $langs->trans("BillShortStatusNotPaid"), '1,2' => $langs->trans("BillShortStatusNotPaid").'+'.$langs->trans("BillShortStatusPaid"), '2' => $langs->trans("BillShortStatusPaid"), '3' => $langs->trans("BillShortStatusCanceled")); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); print ''; - $liststatus = array('0'=>$langs->trans("Unpaid"), '1'=>$langs->trans("Paid")); + $liststatus = array('0' => $langs->trans("Unpaid"), '1' => $langs->trans("Paid")); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage', 1); print '
'; $liststatus = array('0' => $langs->trans("Unpaid"), '1' => $langs->trans("Paid")); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print '"> "> - + - + "> %%
'; - $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); - $date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); + print ''; + $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); + $date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); - $prefillDates = false; + $prefillDates = false; if (getDolGlobalString('MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE') && !empty($object->lines)) { for ($i = count($object->lines) - 1; $i >= 0; $i--) { @@ -576,7 +578,7 @@ echo ' '.$langs->trans('FillWithLastServiceDates').''; } - print ''; - print '
'; $liststatus = array( - Don::STATUS_DRAFT=>$langs->trans("DonationStatusPromiseNotValidated"), - Don::STATUS_VALIDATED=>$langs->trans("DonationStatusPromiseValidated"), - Don::STATUS_PAID=>$langs->trans("DonationStatusPaid"), - Don::STATUS_CANCELED=>$langs->trans("Canceled") + Don::STATUS_DRAFT => $langs->trans("DonationStatusPromiseNotValidated"), + Don::STATUS_VALIDATED => $langs->trans("DonationStatusPromiseValidated"), + Don::STATUS_PAID => $langs->trans("DonationStatusPaid"), + Don::STATUS_CANCELED => $langs->trans("Canceled") ); +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage'); print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('StatusSendingDraftShort'), '1'=>$langs->trans('StatusSendingValidatedShort'), '2'=>$langs->trans('StatusSendingProcessedShort')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); + print $form->selectarray('search_status', array('0' => $langs->trans('StatusSendingDraftShort'), '1' => $langs->trans('StatusSendingValidatedShort'), '2' => $langs->trans('StatusSendingProcessedShort')), $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print ''; if ($shipment->shipping_method_id > 0) { print $langs->trans("SendingMethod".strtoupper($code)); @@ -1138,7 +1139,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1208,7 +1209,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'totalarray' => $totalarray, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'totalarray' => $totalarray, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 1dc7e453e5fb8..d0c10e49a56c0 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -95,20 +95,20 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'pndf.rowid'=>"RefPayment", - 'u.login'=>"User", - 'pndf.num_payment'=>"Numero", - 'pndf.amount'=>"Amount", + 'pndf.rowid' => "RefPayment", + 'u.login' => "User", + 'pndf.num_payment' => "Numero", + 'pndf.amount' => "Amount", ); $arrayfields = array( - 'pndf.rowid' =>array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), - 'pndf.datep' =>array('label'=>"Date", 'checked'=>1, 'position'=>20), - 'u.login' =>array('label'=>"User", 'checked'=>1, 'position'=>30), - 'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'pndf.num_payment' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("bank"))), - 'pndf.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70), + 'pndf.rowid' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10), + 'pndf.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20), + 'u.login' => array('label' => "User", 'checked' => 1, 'position' => 30), + 'c.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 40), + 'pndf.num_payment' => array('label' => "Numero", 'checked' => 1, 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"), + 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 60, 'enable' => (isModEnabled("bank"))), + 'pndf.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -138,7 +138,7 @@ $childids = $user->getAllChildIds(1); -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -203,7 +203,7 @@ $sql .= " AND pndf.datep >= '" . $db->idate($search_date_start) . "'"; } if ($search_date_end) { - $sql .=" AND pndf.datep <= '" . $db->idate($search_date_end) . "'"; + $sql .= " AND pndf.datep <= '" . $db->idate($search_date_end) . "'"; } if ($search_user) { @@ -324,9 +324,10 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('ExpenseReportPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'expensereport', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($search_all) { @@ -425,7 +426,7 @@ } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -481,7 +482,7 @@ } // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d554bcb49270c..20ac051bb84d0 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -113,11 +113,11 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'f.ref'=>'Ref', - 's.nom'=>"ThirdParty", - 'f.description'=>'Description', - 'f.note_public'=>'NotePublic', - 'fd.description'=>'DescriptionOfLine', + 'f.ref' => 'Ref', + 's.nom' => "ThirdParty", + 'f.description' => 'Description', + 'f.note_public' => 'NotePublic', + 'fd.description' => 'DescriptionOfLine', ); if (empty($user->socid)) { $fieldstosearchall["f.note_private"] = "NotePrivate"; @@ -128,20 +128,20 @@ // Definition of fields for list $arrayfields = array( - 'f.ref'=>array('label'=>'Ref', 'checked'=>1), - 'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1), - 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)), - 'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)), - 'f.description'=>array('label'=>'Description', 'checked'=>1), - 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), - 'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>500), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), - 'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000), - 'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>!getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), - 'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>!getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), - 'fd.duree'=>array('label'=>'DurationOfLine', 'type'=> 'duration', 'checked'=>1, 'enabled'=>!getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), //type duration is here because in database, column 'duree' is double + 'f.ref' => array('label' => 'Ref', 'checked' => 1), + 'f.ref_client' => array('label' => 'RefCustomer', 'checked' => 1), + 's.nom' => array('label' => 'ThirdParty', 'checked' => 1), + 'pr.ref' => array('label' => 'Project', 'checked' => 1, 'enabled' => (!isModEnabled('project') ? 0 : 1)), + 'c.ref' => array('label' => 'Contract', 'checked' => 1, 'enabled' => (empty($conf->contrat->enabled) ? 0 : 1)), + 'f.description' => array('label' => 'Description', 'checked' => 1), + 'f.datec' => array('label' => 'DateCreation', 'checked' => 0, 'position' => 500), + 'f.tms' => array('label' => 'DateModificationShort', 'checked' => 0, 'position' => 500), + 'f.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'position' => 510, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position' => 511, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), + 'f.fk_statut' => array('label' => 'Status', 'checked' => 1, 'position' => 1000), + 'fd.description' => array('label' => "DescriptionOfLine", 'checked' => 1, 'enabled' => !getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), + 'fd.date' => array('label' => 'DateOfLine', 'checked' => 1, 'enabled' => !getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), + 'fd.duree' => array('label' => 'DurationOfLine', 'type' => 'duration', 'checked' => 1, 'enabled' => !getDolGlobalString('FICHINTER_DISABLE_DETAILS') ? 1 : 0), //type duration is here because in database, column 'duree' is double ); '@phan-var-force array{label:string,type?:string,checked:int,position?:int,enabled?:int,langfile?:string,help:string} $arrayfields'; // Extra fields @@ -174,7 +174,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -486,8 +486,8 @@ // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>$langs->trans("SendByMail"), ); if (!empty($permissiontodelete)) { @@ -519,8 +519,8 @@ $url .= '&socid='.$socid; } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('ficheinter', 'creer')); @@ -612,7 +612,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { @@ -647,6 +647,7 @@ if (!getDolGlobalString('FICHINTER_CLASSIFY_BILLED')) { unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1, 0, 0, '', 'search_status width100 onrightofpage'); print '
'; print ''; } @@ -942,9 +943,9 @@ if (!empty($arrayfields['f.unit_frequency']['checked'])) { print ''; @@ -1030,7 +1031,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Status @@ -1085,7 +1086,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3aa79940b916d..901419f40132f 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -156,12 +156,12 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'f.ref'=>'Ref', - 'f.ref_supplier'=>'RefSupplier', - 'f.note_public'=>'NotePublic', - 's.nom'=>"ThirdParty", - 's.code_fournisseur'=>"SupplierCodeShort", - 'pd.description'=>'Description', + 'f.ref' => 'Ref', + 'f.ref_supplier' => 'RefSupplier', + 'f.note_public' => 'NotePublic', + 's.nom' => "ThirdParty", + 's.code_fournisseur' => "SupplierCodeShort", + 'pd.description' => 'Description', ); if (empty($user->socid)) { $fieldstosearchall["f.note_private"] = "NotePrivate"; @@ -169,42 +169,42 @@ $checkedtypetiers = 0; $arrayfields = array( - 'f.ref'=>array('label'=>"Ref", 'checked'=>1), - 'f.ref_supplier'=>array('label'=>"RefSupplier", 'checked'=>1), - 'f.type'=>array('label'=>"Type", 'checked'=>0), - 'f.subtype'=>array('label'=>"InvoiceSubtype", 'checked'=>0,), - 'f.label'=>array('label'=>"Label", 'checked'=>0), - 'f.datef'=>array('label'=>"DateInvoice", 'checked'=>1), - 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>0), - 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>41), - 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>42), - 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>43), - 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>44), - 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45), - 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>46), - 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>49), - 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>52), - 'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>50), - 'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>105), - 'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>110), - 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax1_assuj == "1", 'position'=>95), - 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>$mysoc->localtax2_assuj == "1", 'position'=>100), - 'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>115), - 'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0, 'position'=>116), - 'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>117), - 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'position'=>205, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'position'=>206, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'position'=>207, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'position'=>208, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'position'=>209, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'position'=>210, 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), - 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'position'=>211, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow - 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>500), - 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>501), - 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), - 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), - 'f.nb_docs'=>array('label'=>"Documents", 'checked'=>1, 'position'=>510), + 'f.ref' => array('label' => "Ref", 'checked' => 1), + 'f.ref_supplier' => array('label' => "RefSupplier", 'checked' => 1), + 'f.type' => array('label' => "Type", 'checked' => 0), + 'f.subtype' => array('label' => "InvoiceSubtype", 'checked' => 0,), + 'f.label' => array('label' => "Label", 'checked' => 0), + 'f.datef' => array('label' => "DateInvoice", 'checked' => 1), + 'f.date_lim_reglement' => array('label' => "DateDue", 'checked' => 1), + 'p.ref' => array('label' => "ProjectRef", 'checked' => 0), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 41), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => 0, 'position' => 42), + 's.town' => array('label' => "Town", 'checked' => -1, 'position' => 43), + 's.zip' => array('label' => "Zip", 'checked' => 1, 'position' => 44), + 'state.nom' => array('label' => "StateShort", 'checked' => 0, 'position' => 45), + 'country.code_iso' => array('label' => "Country", 'checked' => 0, 'position' => 46), + 'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 49), + 'f.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => 1, 'position' => 52), + 'f.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => 1, 'position' => 50), + 'f.total_ht' => array('label' => "AmountHT", 'checked' => 1, 'position' => 105), + 'f.total_vat' => array('label' => "AmountVAT", 'checked' => 0, 'position' => 110), + 'f.total_localtax1' => array('label' => $langs->transcountry("AmountLT1", $mysoc->country_code), 'checked' => 0, 'enabled' => $mysoc->localtax1_assuj == "1", 'position' => 95), + 'f.total_localtax2' => array('label' => $langs->transcountry("AmountLT2", $mysoc->country_code), 'checked' => 0, 'enabled' => $mysoc->localtax2_assuj == "1", 'position' => 100), + 'f.total_ttc' => array('label' => "AmountTTC", 'checked' => 0, 'position' => 115), + 'dynamount_payed' => array('label' => "Paid", 'checked' => 0, 'position' => 116), + 'rtp' => array('label' => "Rest", 'checked' => 0, 'position' => 117), + 'f.multicurrency_code' => array('label' => 'Currency', 'checked' => 0, 'position' => 205, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_tx' => array('label' => 'CurrencyRate', 'checked' => 0, 'position' => 206, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ht' => array('label' => 'MulticurrencyAmountHT', 'position' => 207, 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_vat' => array('label' => 'MulticurrencyAmountVAT', 'position' => 208, 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ttc' => array('label' => 'MulticurrencyAmountTTC', 'position' => 209, 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_dynamount_payed' => array('label' => 'MulticurrencyAlreadyPaid', 'position' => 210, 'checked' => 0, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_rtp' => array('label' => 'MulticurrencyRemainderToPay', 'checked' => 0, 'position' => 211, 'enabled' => (!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow + 'u.login' => array('label' => "Author", 'checked' => 1, 'position' => 500), + 'f.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 501), + 'f.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 502), + 'f.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000), + 'f.nb_docs' => array('label' => "Documents", 'checked' => 1, 'position' => 510), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -241,7 +241,7 @@ $massaction = ''; } -$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); +$parameters = array('socid' => $socid, 'arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -332,7 +332,7 @@ $objecttmp->resteapayer = price2num($objecttmp->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); // hook to finalize the remaining amount, considering e.g. cash discount agreements - $parameters = array('remaintopay'=>$objecttmp->resteapayer); + $parameters = array('remaintopay' => $objecttmp->resteapayer); $reshook = $hookmanager->executeHooks('finalizeAmountOfInvoice', $parameters, $objecttmp, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { // print $hookmanager->resPrint; @@ -947,8 +947,8 @@ // List of mass actions available $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); @@ -987,8 +987,8 @@ print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->hasRight("fournisseur", "facture", "creer") || $user->hasRight("supplier_invoice", "creer"))); @@ -1094,10 +1094,10 @@ if (!empty($arrayfields['f.type']['checked'])) { print ''; } - // Invoice Subtype +// Invoice Subtype if (!empty($arrayfields['f.subtype']['checked'])) { print ''; } @@ -1468,7 +1469,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { @@ -1503,11 +1504,11 @@ $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array(); -$totalarray['val']['f.total_ht']=0; -$totalarray['val']['f.total_vat']=0; -$totalarray['val']['f.total_localtax1']=0; -$totalarray['val']['f.total_localtax1']=0; -$totalarray['val']['f.total_ttc']=0; +$totalarray['val']['f.total_ht'] = 0; +$totalarray['val']['f.total_vat'] = 0; +$totalarray['val']['f.total_localtax1'] = 0; +$totalarray['val']['f.total_localtax1'] = 0; +$totalarray['val']['f.total_ttc'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); @@ -1987,7 +1988,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 28665f0a8c5e3..466f7beaeddb9 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -90,20 +90,20 @@ // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'p.ref'=>"RefPayment", - 's.nom'=>"ThirdParty", - 'p.num_paiement'=>"Numero", - 'p.amount'=>"Amount", + 'p.ref' => "RefPayment", + 's.nom' => "ThirdParty", + 'p.num_paiement' => "Numero", + 'p.amount' => "Amount", ); $arrayfields = array( - 'p.ref' =>array('label'=>"RefPayment", 'checked'=>1, 'position'=>10), - 'p.datep' =>array('label'=>"Date", 'checked'=>1, 'position'=>20), - 's.nom' =>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), - 'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'p.num_paiement' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("bank"))), - 'p.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70), + 'p.ref' => array('label' => "RefPayment", 'checked' => 1, 'position' => 10), + 'p.datep' => array('label' => "Date", 'checked' => 1, 'position' => 20), + 's.nom' => array('label' => "ThirdParty", 'checked' => 1, 'position' => 30), + 'c.libelle' => array('label' => "Type", 'checked' => 1, 'position' => 40), + 'p.num_paiement' => array('label' => "Numero", 'checked' => 1, 'position' => 50, 'tooltip' => "ChequeOrTransferNumber"), + 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 60, 'enable' => (isModEnabled("bank"))), + 'p.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -139,7 +139,7 @@ * Actions */ -$parameters = array('socid'=>$socid); +$parameters = array('socid' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -214,7 +214,7 @@ $sql .= " AND p.datep >= '" . $db->idate($search_date_start) . "'"; } if ($search_date_end) { - $sql .=" AND p.datep <= '" . $db->idate($search_date_end) . "'"; + $sql .= " AND p.datep <= '" . $db->idate($search_date_end) . "'"; } if ($search_company) { @@ -351,6 +351,7 @@ print ''; print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'supplier_invoice', 0, '', '', $limit, 0, 0, 1); if ($search_all) { @@ -458,7 +459,7 @@ } // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -517,7 +518,7 @@ } // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 589d1b0d82e18..16157d26be6d9 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -157,15 +157,15 @@ // Definition of fields for lists $arrayfields = array( - 'cpl.rowid'=>array('label'=>"ID", 'checked'=>1), - 'cpl.date_action'=>array('label'=>"Date", 'checked'=>1), - 'cpl.fk_user_action'=>array('label'=>"ActionByCP", 'checked'=>1), - 'cpl.fk_user_update'=>array('label'=>"UserUpdateCP", 'checked'=>1), - 'cpl.type_action'=>array('label'=>"Description", 'checked'=>1), - 'cpl.fk_type'=>array('label'=>"Type", 'checked'=>1), - 'cpl.prev_solde'=>array('label'=>"PrevSoldeCP", 'checked'=>1), - 'variation'=>array('label'=>"Variation", 'checked'=>1), - 'cpl.new_solde'=>array('label'=>"NewSoldeCP", 'checked'=>1), + 'cpl.rowid' => array('label' => "ID", 'checked' => 1), + 'cpl.date_action' => array('label' => "Date", 'checked' => 1), + 'cpl.fk_user_action' => array('label' => "ActionByCP", 'checked' => 1), + 'cpl.fk_user_update' => array('label' => "UserUpdateCP", 'checked' => 1), + 'cpl.type_action' => array('label' => "Description", 'checked' => 1), + 'cpl.fk_type' => array('label' => "Type", 'checked' => 1), + 'cpl.prev_solde' => array('label' => "PrevSoldeCP", 'checked' => 1), + 'variation' => array('label' => "Variation", 'checked' => 1), + 'cpl.new_solde' => array('label' => "NewSoldeCP", 'checked' => 1), ); @@ -286,6 +286,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->rights->holiday->write); +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1); print '
'.$langs->trans('LastUpdateCP').': '; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 5385c924a28cd..af35d75201f71 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -233,7 +233,7 @@ $num = $db->num_rows($result); print '
'; - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); if (getDolGlobalString('MARGIN_TYPE') == "1") { diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 730f5ea1479c4..de7822b6198f3 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -248,6 +248,7 @@ $num = $db->num_rows($result); print '
'; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); if (getDolGlobalString('MARGIN_TYPE') == "1") { diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 9561ddf2f280b..d30ef558ecf10 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -303,7 +303,7 @@ $num = $db->num_rows($result); print '
'; - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); if (getDolGlobalString('MARGIN_TYPE') == "1") { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index b66bee3b605e5..fb1604c6d9fb1 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -253,7 +253,7 @@ $num = $db->num_rows($result); print '
'; - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1); //var_dump($conf->global->MARGIN_TYPE); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index c2ec6485cf746..83b646baf29bd 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -199,7 +199,7 @@ if ($result) { $num = $db->num_rows($result); - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&socid=".$object->id, $sortfield, $sortorder, '', $num, $num, ''); $i = 0; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 5d9fe35343b2b..9a11c59abd187 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -214,7 +214,7 @@ $param .= '&limit='.$limit; } - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ActionsOnProduct"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1); // List of all actions diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 5b6acca46eab6..747604f0f706d 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1705,10 +1705,10 @@ function on_change() { $backbutton = ''.$langs->trans("Back").''; if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("DefaultPriceLog"), 0, $_SERVER["PHP_SELF"], '', '', '', $backbutton, 0, $num, 'title_accountancy.png'); } else { - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("PriceByCustomerLog"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $num, 'title_accountancy.png'); } @@ -2140,6 +2140,7 @@ function on_change() { $backbutton = ''.$langs->trans("Back").''; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $option, $sortfield, $sortorder, $backbutton, count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); if (count($prodcustprice->lines) > 0) { @@ -2259,6 +2260,7 @@ function on_change() { $option = '&search_soc='.$search_soc.'&id='.$object->id; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVER ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); print '
'; diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 0e7f8c297b574..315f39590d3a5 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -223,6 +223,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("CustomersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index b71ab30826b94..d377ae40e0a2c 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -223,6 +223,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 8223a3330223f..870e7f81fda6c 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -81,7 +81,7 @@ $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -191,6 +191,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Contrats"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index b0b5ba6ea8912..ad3e190e851e5 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -132,7 +132,7 @@ $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -297,6 +297,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { @@ -331,7 +332,7 @@ print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); // Hook fields - $parameters = array('param'=>$option, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $parameters = array('param' => $option, 'sortfield' => $sortfield, 'sortorder' => $sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "
\n"; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 7f68d34490d02..faf752b71e930 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -205,6 +205,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index 6ba186fb88613..f25c3076b63c5 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -97,7 +97,7 @@ $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -223,6 +223,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 998ca70a3dbc9..d6727842eadcd 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -92,7 +92,7 @@ $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -201,6 +201,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index becd2350fdd9f..7ac396da333bc 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -207,6 +207,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 704ec0457c4c0..5e162e0833985 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -206,6 +206,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 2d77dc8651254..174be7e448627 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -105,7 +105,7 @@ } $result = $object->fetch($id, $objectid, $batch); - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -283,6 +283,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index 75be59f5d1860..cc2a10c0592e6 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -105,7 +105,7 @@ } $result = $object->fetch($id, $objectid, $batch); - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -282,6 +282,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Shipments"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index 174dea1507cc1..e48d44127c0a2 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -98,7 +98,7 @@ } $result = $object->fetch($id, $objectid, $batch); - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -224,6 +224,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { @@ -261,7 +262,7 @@ $motmp = new Mo($db); - $total_consumed=$total_produced=0; + $total_consumed = $total_produced = 0; if ($num > 0) { while ($i < min($num, $limit)) { @@ -271,8 +272,8 @@ $motmp->ref = $objp->ref; $motmp->status = $objp->status; - $total_consumed+=$objp->nb_consumed; - $total_produced+=$objp->nb_produced; + $total_consumed += $objp->nb_consumed; + $total_produced += $objp->nb_produced; print ''; print ''; // Date End print ''; @@ -539,6 +539,7 @@ // Status print ''; @@ -546,7 +547,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -592,7 +593,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -784,7 +785,7 @@ // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -829,7 +830,7 @@ $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index d2bad348b370f..0e0031e6f9cf2 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -75,7 +75,7 @@ * Actions */ -$parameters = array('id'=>$socid); +$parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -286,7 +286,7 @@ print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone'); print ''; print ''; print ''; @@ -447,7 +447,7 @@ print ''; print ''; - // List of active notifications + // List of active notifications @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit); // Line with titles diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index fdafc97e55bf3..55d0091a80b0d 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -74,7 +74,7 @@ * Actions */ -$parameters = array('id'=>$socid); +$parameters = array('id' => $socid); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -467,6 +467,7 @@ $option = '&socid='.GETPOSTINT('socid').'&prodid='.GETPOSTINT('prodid'); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('PriceByCustomerLog'), $page, $_SERVER ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); if (count($prodcustprice->lines) > 0) { @@ -544,11 +545,11 @@ if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1, 1, '1'); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -569,6 +570,7 @@ print ''."\n"; + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVER['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, ''); print ''; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index d3588e83ff465..8112a2190165f 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -273,7 +273,7 @@ // List of active notifications //print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', ''); - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1); // Line with titles @@ -472,7 +472,7 @@ print ''; print ''; - // List of notifications done + // List of notifications done @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit); // Line with titles From afd49868d57022e69967401802eda8e8f2fea02a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 16:32:44 +0100 Subject: [PATCH 08/22] Fix bad route --- htdocs/adherents/class/api_members.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 5225ccb4e9303..000ecc26f2b07 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + /** * API class for members * @@ -723,7 +724,7 @@ public function indexType($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 1 * @param array $request_data Request data * @return int ID of member type * - * @url POST /types/{id} + * @url POST /types/ * * @throws RestException 403 Access denied * @throws RestException 500 Error when creating Member Type From 6df4a5eded603ef6ff51fae451b70eca7fe0acd4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 16:41:33 +0100 Subject: [PATCH 09/22] Use a better name for thirdparties site account --- ChangeLog | 2 +- htdocs/core/lib/company.lib.php | 3 -- .../societe/class/api_thirdparties.class.php | 46 +++++++++---------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a123336552e3..25688ef0ccb06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,7 +29,7 @@ The following changes may create regressions for some external modules, but were * Use of dol_eval with parameter $returnvalue=0 is deprecated. * The signature for all ->delete() method has been modified to match the modulebuilder template (so first paramis now always $user), except the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version. - +* Route for API /thirdparties/gateways has been renamed into /thirdparties/accounts ***** ChangeLog for 19.0.1 compared to 19.0.0 ***** diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7fca6289c95e6..7c7fc412669c4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -197,9 +197,6 @@ function societe_prepare_head(Societe $object) $title = $langs->trans("PaymentModes"); if (isModEnabled('stripe')) { - //$langs->load("stripe"); - //$title = $langs->trans("BankAccountsAndGateways"); - $servicestatus = 0; if (getDolGlobalString('STRIPE_LIVE') && !GETPOST('forcesandbox', 'alpha')) { $servicestatus = 1; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 0f88fefbd2cd6..612c9c7852cfc 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1371,7 +1371,7 @@ public function generateBankAccountDocument($id, $companybankid = null, $model = } /** - * Get a specific gateway attached to a thirdparty (by specifying the site key) + * Get a specific account attached to a thirdparty (by specifying the site key) * * @param int $id ID of thirdparty * @param string $site Site key @@ -1380,7 +1380,7 @@ public function generateBankAccountDocument($id, $companybankid = null, $model = * @throws RestException 401 Unauthorized: User does not have permission to read thirdparties * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * - * @url GET {id}/gateways/ + * @url GET {id}/accounts/ */ public function getSocieteAccounts($id, $site = null) { @@ -1404,7 +1404,7 @@ public function getSocieteAccounts($id, $site = null) $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, 'This thirdparty does not have any gateway attached or does not exist.'); + throw new RestException(404, 'This thirdparty does not have any account attached or does not exist.'); } $i = 0; @@ -1440,7 +1440,7 @@ public function getSocieteAccounts($id, $site = null) } /** - * Create and attach a new gateway to an existing thirdparty + * Create and attach a new account to an existing thirdparty * * Possible fields for request_data (request body) are specified in llx_societe_account table.
* See Table llx_societe_account wiki page for more information

@@ -1452,11 +1452,11 @@ public function getSocieteAccounts($id, $site = null) * @return array|mixed * * @throws RestException 401 Unauthorized: User does not have permission to read thirdparties - * @throws RestException 409 Conflict: A SocieteAccount entity (gateway) already exists for this company and site. + * @throws RestException 409 Conflict: An Account already exists for this company and site. * @throws RestException 422 Unprocessable Entity: You must pass the site attribute in your request data ! * @throws RestException 500 Internal Server Error: Error creating SocieteAccount account * - * @url POST {id}/gateways + * @url POST {id}/accounts */ public function createSocieteAccount($id, $request_data = null) { @@ -1501,10 +1501,10 @@ public function createSocieteAccount($id, $request_data = null) } /** - * Create and attach a new (or replace an existing) specific site gateway to a thirdparty + * Create and attach a new (or replace an existing) specific site account to a thirdparty * * You MUST pass all values to keep (otherwise, they will be deleted) !
- * If you just need to update specific fields prefer PATCH /thirdparties/{id}/gateways/{site} endpoint.

+ * If you just need to update specific fields prefer PATCH /thirdparties/{id}/accounts/{site} endpoint.

* When a SocieteAccount entity does not exist for the id and site * supplied, a new one will be created. In that case fk_soc and site members form * request body payload will be ignored and id and site query strings parameters @@ -1520,7 +1520,7 @@ public function createSocieteAccount($id, $request_data = null) * @throws RestException 422 Unprocessable Entity: You must pass the site attribute in your request data ! * @throws RestException 500 Internal Server Error: Error updating SocieteAccount entity * - * @url PUT {id}/gateways/{site} + * @url PUT {id}/accounts/{site} */ public function putSocieteAccount($id, $site, $request_data = null) { @@ -1564,7 +1564,7 @@ public function putSocieteAccount($id, $site, $request_data = null) $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) !== 0) { - throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) from $site to ".$request_data['site']." but another SocieteAccount entity already exists with this site key."); + throw new RestException(409, "You are trying to update this thirdparty Account for $site to ".$request_data['site']." but another Account already exists with this site key."); } } @@ -1601,7 +1601,7 @@ public function putSocieteAccount($id, $site, $request_data = null) } /** - * Update specified values of a specific gateway attached to a thirdparty + * Update specified values of a specific account attached to a thirdparty * * @param int $id Id of thirdparty * @param string $site Site key @@ -1614,7 +1614,7 @@ public function putSocieteAccount($id, $site, $request_data = null) * @throws RestException 409 Conflict: Another SocieteAccount entity already exists for this thirdparty with this site key. * @throws RestException 500 Internal Server Error: Error updating SocieteAccount entity * - * @url PATCH {id}/gateways/{site} + * @url PATCH {id}/accounts/{site} */ public function patchSocieteAccount($id, $site, $request_data = null) { @@ -1626,7 +1626,7 @@ public function patchSocieteAccount($id, $site, $request_data = null) $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, "This thirdparty does not have $site gateway attached or does not exist."); + throw new RestException(404, "This thirdparty does not have $site account attached or does not exist."); } else { // If the user tries to edit the site member, we check first if if (isset($request_data['site']) && $request_data['site'] !== $site) { @@ -1634,7 +1634,7 @@ public function patchSocieteAccount($id, $site, $request_data = null) $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) !== 0) { - throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) site member from ".$site." to ".$request_data['site']." but another SocieteAccount entity already exists for this thirdparty with this site key."); + throw new RestException(409, "You are trying to update this thirdparty Account for ".$site." to ".$request_data['site']." but another Account already exists for this thirdparty with this site key."); } } @@ -1663,17 +1663,17 @@ public function patchSocieteAccount($id, $site, $request_data = null) } /** - * Delete a specific site gateway attached to a thirdparty (by gateway id) + * Delete a specific site account attached to a thirdparty (by account id) * * @param int $id ID of thirdparty * @param int $site Site key * * @return void - * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties accounts * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * @throws RestException 500 Internal Server Error: Error deleting SocieteAccount entity * - * @url DELETE {id}/gateways/{site} + * @url DELETE {id}/accounts/{site} */ public function deleteSocieteAccount($id, $site) { @@ -1692,22 +1692,22 @@ public function deleteSocieteAccount($id, $site) $account->fetch($obj->rowid); if ($account->delete(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, "Error while deleting $site gateway attached to this third party"); + throw new RestException(500, "Error while deleting $site account attached to this third party"); } } } /** - * Delete all gateways attached to a thirdparty + * Delete all accounts attached to a thirdparty * * @param int $id ID of thirdparty * * @return void - * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws RestException 401 Unauthorized: User does not have permission to delete thirdparties accounts * @throws RestException 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty * @throws RestException 500 Internal Server Error: Error deleting SocieteAccount entity * - * @url DELETE {id}/gateways + * @url DELETE {id}/accounts */ public function deleteSocieteAccounts($id) { @@ -1725,7 +1725,7 @@ public function deleteSocieteAccounts($id) $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) == 0) { - throw new RestException(404, 'This third party does not have any gateway attached or does not exist.'); + throw new RestException(404, 'This third party does not have any account attached or does not exist.'); } else { $i = 0; @@ -1736,7 +1736,7 @@ public function deleteSocieteAccounts($id) $account->fetch($obj->rowid); if ($account->delete(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, 'Error while deleting gateways attached to this third party'); + throw new RestException(500, 'Error while deleting account attached to this third party'); } $i++; } From 7ab339e97f4034f6696ba0e18f25920b6193c6f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 17:52:34 +0100 Subject: [PATCH 10/22] Fix regression --- htdocs/comm/propal/class/propal.class.php | 2 -- htdocs/contact/list.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/societe/list.php | 6 +++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 39c01663d93ad..868a16ed304a6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -409,8 +409,6 @@ class Propal extends CommonObject */ public function __construct($db, $socid = 0, $propalid = 0) { - global $conf, $langs; - $this->db = $db; $this->socid = $socid; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 96e5814074239..8501ef2616500 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -101,7 +101,7 @@ $search_categ = GETPOSTINT("search_categ"); $search_categ_thirdparty = GETPOSTINT("search_categ_thirdparty"); $search_categ_supplier = GETPOSTINT("search_categ_supplier"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", "intcomma"); $search_type = GETPOST('search_type', 'alpha'); $search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7c7fc412669c4..7caa6533194f8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -998,7 +998,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); - $search_status = GETPOSTINT("search_status"); + $search_status = GETPOST("search_status", "intcomma"); if ($search_status == '') { $search_status = 1; // always display active customer first } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index ca5bcb5fdedc9..787cc14f77987 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -52,7 +52,7 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST("sref", "alpha") ? GETPOST("sref", "alpha") : GETPOST("search_ref", "alpha"); $search_label = GETPOST("snom", "alpha") ? GETPOST("snom", "alpha") : GETPOST("search_label", "alpha"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", "intcomma"); $search_category_list = array(); if (isModEnabled('category')) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 19e620f7b8a3b..099106056b869 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -120,7 +120,7 @@ $search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); $search_price_level = GETPOSTINT('search_price_level'); $search_staff = GETPOSTINT("search_staff"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", 'intcomma'); $search_type = GETPOST('search_type', 'alpha'); $search_level = GETPOST("search_level", "array:alpha"); $search_stcomm = GETPOST('search_stcomm', "array:int"); @@ -472,8 +472,8 @@ } } -if ($search_status == '') { - $search_status = 1; // always display active thirdparty first +if ($search_status == '' && empty($search_all)) { + $search_status = 1; // display active thirdparty only by default } From 4ca754205c008003805d4a35154abc25829c21cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:37:00 +0100 Subject: [PATCH 11/22] Fix serch_all --- htdocs/societe/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 099106056b869..c0baeb41882a8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -446,6 +446,8 @@ $search_level = ''; $search_parent_name = ''; $search_import_key = ''; + + $search_all = ''; $toselect = array(); $search_array_options = array(); } From 4f5c400870d0d0ecf39d908dc91c418ac3f8212a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:39:33 +0100 Subject: [PATCH 12/22] Fix missing search_all --- htdocs/modulebuilder/template/myobject_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 476a429d97278..d1bde9d79c58d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -249,6 +249,7 @@ $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } From a9cae438a60586b9a880f4b3964aa0f4c128701e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:43:57 +0100 Subject: [PATCH 13/22] Fix regression --- htdocs/product/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 28af89a6246d0..f2668099f9fd7 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; -$type = GETPOSTINT("type"); +$type = GETPOST("type", 'intcomma'); if ($type == '' && !$user->hasRight('produit', 'lire') && $user->hasRight('service', 'lire')) { $type = '1'; // Force global page on service page only } From 65899433fe1cd4e74e187e4ea90af90d030caff7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 19:47:05 +0100 Subject: [PATCH 14/22] Qual: remove $_GET use. --- htdocs/product/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index f2668099f9fd7..9abf9bd532689 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -69,15 +69,15 @@ $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = ''; -if (!isset($_GET["type"])) { +if (!GETPOSTISSET("type")) { $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 0) || !isModEnabled("service")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '0') || !isModEnabled("service")) { $transAreaType = $langs->trans("ProductsArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 1) || !isModEnabled("product")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '1') || !isModEnabled("product")) { $transAreaType = $langs->trans("ServicesArea"); $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } @@ -310,10 +310,10 @@ if ($num > 0) { $transRecordedType = $langs->trans("LastModifiedProductsAndServices", $max); - if (isset($_GET["type"]) && $_GET["type"] == 0) { + if (GETPOSTISSET("type") && GETPOST("type") == '0') { $transRecordedType = $langs->trans("LastRecordedProducts", $max); } - if (isset($_GET["type"]) && $_GET["type"] == 1) { + if (GETPOSTISSET("type") && GETPOST("type") == '1') { $transRecordedType = $langs->trans("LastRecordedServices", $max); } From 9a281ed2647544824699a4f3ef03b53c6168b418 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2024 21:21:27 +0100 Subject: [PATCH 15/22] Fix undefined property --- htdocs/adherents/class/api_members.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 000ecc26f2b07..889f1212547cb 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -432,7 +432,12 @@ public function delete($id) private function _validate($data) { $member = array(); - foreach (Members::$FIELDS as $field) { + + $mandatoryfields = array( + 'morphy', + 'typeid' + ); + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } @@ -857,7 +862,10 @@ public function deleteType($id) private function _validateType($data) { $membertype = array(); - foreach (MembersTypes::$FIELDS as $field) { + + $mandatoryfields = array('label'); + + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } From 826d72d04be5e1e8a4f5f96abeb2352af961c460 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:25:15 +0100 Subject: [PATCH 16/22] Qual: Reduce phan baseline (thanks to 'fixes') (#28715) # Qual: Reduce phan baseline (thanks to 'fixes') The number of phan exceptions has been reduced, the baseline is updated accordingly. --- dev/tools/phan/baseline.txt | 246 ++++-------------------------------- 1 file changed, 26 insertions(+), 220 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index dad508e8cf647..3ccb13ee59980 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,231 +9,100 @@ */ return [ // # Issue statistics: - // PhanPluginSuspiciousParamPosition : 160+ occurrences - // PhanPluginSuspiciousParamOrder : 130+ occurrences - // PhanParamSignatureMismatch : 45+ occurrences - // PhanPluginDuplicateIfStatements : 40+ occurrences - // PhanPluginDuplicateExpressionBinaryOp : 15+ occurrences + // PhanPluginSuspiciousParamPosition : 45+ occurrences + // PhanPluginDuplicateIfStatements : 30+ occurrences + // PhanParamSignatureMismatch : 25+ occurrences // PhanUndeclaredConstant : 15+ occurrences - // PhanUnreferencedUseNormal : 15+ occurrences - // PhanParamSuspiciousOrder : 10+ occurrences - // PhanPluginSuspiciousParamOrderInternal : 10+ occurrences + // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanTypeArraySuspiciousNull : 10+ occurrences - // PhanTypeInvalidUnaryOperandNumeric : 10+ occurrences - // PhanRedefineFunctionInternal : 9 occurrences - // PhanPluginUnsafeEval : 7 occurrences + // PhanTypeInvalidUnaryOperandNumeric : 8 occurrences // PhanPluginDuplicateIfCondition : 6 occurrences - // PhanUndeclaredTypeParameter : 6 occurrences + // PhanRedefineFunctionInternal : 6 occurrences + // PhanPluginUnsafeEval : 5 occurrences + // PhanParamSuspiciousOrder : 4 occurrences // PhanParamTooMany : 4 occurrences - // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanPluginInvalidPregRegexReplacement : 4 occurrences + // PhanPluginSuspiciousParamOrder : 4 occurrences // PhanUndeclaredFunctionInCallable : 4 occurrences - // PhanNoopArrayAccess : 2 occurrences - // PhanTypeMismatchForeach : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanAccessPropertyStaticAsNonStatic : 1 occurrence // PhanNoopArray : 1 occurrence + // PhanNoopArrayAccess : 1 occurrence // PhanNoopStringLiteral : 1 occurrence - // PhanParamTooFew : 1 occurrence - // PhanPowerOfZero : 1 occurrence - // PhanUnextractableAnnotationSuffix : 1 occurrence + // PhanPluginAlwaysReturnFunction : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ - 'htdocs/accountancy/admin/account.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/class/bookkeeping.class.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/accountancy/class/lettering.class.php' => ['PhanParamSuspiciousOrder'], - 'htdocs/accountancy/customer/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/customer/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/expensereport/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/expensereport/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/accountancy/journal/sellsjournal.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/accountancy/supplier/lines.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/accountancy/supplier/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/adherents/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/adherents/list.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/adherents/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/adherents/stats/geo.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/adherents/subscription.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/adherents/type.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/admin/agenda_extsites.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/dict.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/emailcollector_card.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/admin/mails_templates.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], 'htdocs/admin/receiptprinter.php' => ['PhanRedefineFunctionInternal'], - 'htdocs/admin/system/database.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/system/modules.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/tools/listevents.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/admin/translation.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/admin/triggers.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/api/class/api.class.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanUnreferencedUseNormal'], + 'htdocs/api/class/api_documents.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/bom/bom_list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/categories/class/api_categories.class.php' => ['PhanAccessMethodProtected'], - 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginSuspiciousParamOrder'], + 'htdocs/categories/viewcat.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/collab/index.php' => ['PhanParamTooMany'], - 'htdocs/comm/action/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], + 'htdocs/comm/action/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/comm/action/index.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeArraySuspiciousNull', 'PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/comm/action/pertype.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/comm/action/peruser.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/comm/action/rapport/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/comm/mailing/advtargetemailing.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/mailing/card.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/comm/mailing/cibles.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/mailing/info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/comm/propal/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/commande/list.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/commande/list_det.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/commande/list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/compta/accounting-files.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/bank/bankentries_list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/compta/bank/various_payment/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/compta/cashcontrol/class/cashcontrol.class.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/compta/deplacement/class/deplacementstats.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/facture/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/facture/class/facture.class.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/facture/list.php' => ['PhanPluginDuplicateIfCondition', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/facture/prelevement.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/paiement/cheque/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/paiement/class/paiement.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/compta/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/prelevement/card.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/compta/facture/list.php' => ['PhanPluginDuplicateIfCondition'], 'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'], 'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/prelevement/fiche-rejet.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/compta/sociales/document.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/sociales/info.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/sociales/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/compta/sociales/note.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/compta/tva/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/compta/tva/payments.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/actions_massactions.inc.php' => ['PhanParamTooFew', 'PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], + 'htdocs/core/actions_massactions.inc.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamOrder'], 'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/class/commonobject.class.php' => ['PhanPluginDuplicateIfCondition', 'PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/class/commonstickergenerator.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/class/dolreceiptprinter.class.php' => ['PhanUnreferencedUseNormal'], 'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'], 'htdocs/core/class/html.form.class.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], 'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'], 'htdocs/core/class/rssparser.class.php' => ['PhanPluginDuplicateIfStatements', 'PhanUndeclaredFunctionInCallable'], - 'htdocs/core/class/translate.class.php' => ['PhanTypeMismatchForeach'], - 'htdocs/core/class/utils.class.php' => ['PhanPluginSuspiciousParamPosition', 'PhanUnextractableAnnotationSuffix'], 'htdocs/core/db/mysqli.class.php' => ['PhanParamSignatureMismatch', 'PhanPluginDuplicateIfStatements'], 'htdocs/core/db/pgsql.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/db/sqlite3.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/lib/company.lib.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginDuplicateIfCondition','PhanDeprecatedFunctionInternal'], + 'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginDuplicateIfCondition'], 'htdocs/core/lib/ftp.lib.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginDuplicateIfCondition', 'PhanPluginInvalidPregRegexReplacement', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], - 'htdocs/core/lib/functions2.lib.php' => ['PhanParamSuspiciousOrder', 'PhanPluginUnsafeEval'], - 'htdocs/core/lib/json.lib.php' => ['PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], - 'htdocs/core/lib/modulebuilder.lib.php' => ['PhanPluginSuspiciousParamPosition'], + 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginDuplicateIfCondition', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'], 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/lib/usergroups.lib.php' => ['PhanNoopArrayAccess'], - 'htdocs/core/lib/website.lib.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/login/functions_ldap.php' => ['PhanPluginSuspiciousParamOrderInternal'], 'htdocs/core/menus/standard/auguria_menu.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], 'htdocs/core/menus/standard/eldy_menu.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], 'htdocs/core/menus/standard/empty.php' => ['PhanParamSuspiciousOrder', 'PhanPluginDuplicateIfStatements'], - 'htdocs/core/modules/bank/doc/pdf_ban.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/expensereport/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/hrm/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal', 'PhanTypeArraySuspiciousNull'], - 'htdocs/core/modules/oauth/generic_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/google_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/microsoft_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/stripelive_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/oauth/stripetest_oauthcallback.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/printing/printgcp.modules.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'], + 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'], 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginDuplicateIfCondition'], - 'htdocs/core/modules/stock/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanUndeclaredTypeParameter'], - 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder', 'PhanPluginDuplicateArrayKey'], + 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'], - 'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/debugbar/class/DataCollector/DolPhpCollector.php' => ['PhanPowerOfZero'], - 'htdocs/debugbar/class/DataCollector/DolQueryCollector.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/debugbar/class/DataCollector/DolibarrCollector.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/don/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/don/class/api_donations.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/don/class/don.class.php' => ['PhanParamTooMany', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/don/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/don/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], + 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/ecm/index_auto.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUnreferencedUseNormal'], - 'htdocs/eventorganization/class/conferenceorbooth.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/expedition/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/expensereport/card.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/expensereport/class/expensereportstats.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/expensereport/class/paymentexpensereport.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], - 'htdocs/expensereport/payment/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/exports/export.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/exports/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/fichinter/card-rec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fichinter/list.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/fourn/class/api_supplier_invoices.class.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/commande/card.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/fourn/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/fourn/facture/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/fourn/facture/list-rec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/facture/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/fourn/paiement/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/holiday/view_log.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/imports/import.php' => ['PhanPluginDuplicateIfStatements', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/imports/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-corporate/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-homesubmenu/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-noimg/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-onepageblackpurple/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-restaurant/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/doctemplates/websites/website_template-stellar/containers/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/install/fileconf.php' => ['PhanParamSuspiciousOrder'], 'htdocs/intracommreport/list.php' => ['PhanAccessPropertyStaticAsNonStatic'], 'htdocs/loan/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'], @@ -242,86 +111,23 @@ return [ 'htdocs/loan/note.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/payment/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/loan/schedule.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/main.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/agentMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/checkMargins.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/margin/customerMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/productMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/margin/tabs/thirdpartyMargins.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/master.inc.php' => ['PhanRedefineFunctionInternal'], - 'htdocs/modulebuilder/index.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/mrp/class/mo.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/product/admin/product_tools.php' => ['PhanNoopStringLiteral'], - 'htdocs/product/agenda.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/product/card.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/class/product.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/inventory/inventory.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/product/popuprop.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/price.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], 'htdocs/product/stats/card.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stats/commande.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/commande_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/contrat.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facture.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facture_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/facturerec.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/mo.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/propal.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stats/supplier_proposal.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/class/mouvementstock.class.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stock/movement_list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/product/stock/product.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/expedition.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/mo.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/product/stock/stats/reception.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/projet/list.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/projet/tasks/list.php' => ['PhanTypeArraySuspiciousNull'], - 'htdocs/projet/tasks/time.php' => ['PhanPluginDuplicateIfStatements'], 'htdocs/public/bookcal/index.php' => ['PhanTypeInvalidUnaryOperandNumeric'], 'htdocs/public/opensurvey/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/public/payment/newpayment.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/public/recruitment/index.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/public/website/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/reception/list.php' => ['PhanNoopArrayAccess', 'PhanPluginSuspiciousParamOrder'], - 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamOrderInternal'], - 'htdocs/salaries/class/salary.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/salaries/list.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/societe/class/companybankaccount.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/societe/class/societe.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/list.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/notify/card.php' => ['PhanPluginSuspiciousParamOrder'], - 'htdocs/societe/paymentmodes.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/societe/price.php' => ['PhanPluginSuspiciousParamOrder'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/takepos/invoice.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/ticket/class/ticketstats.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/ticket/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/user/agenda_extsites.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/user/bank.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/user/card.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/user/class/user.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/user/list.php' => ['PhanPluginDuplicateIfStatements'], - 'htdocs/user/notify/card.php' => ['PhanPluginSuspiciousParamOrder', 'PhanPluginSuspiciousParamPosition'], - 'htdocs/variants/class/ProductAttribute.class.php' => ['PhanParamSignatureMismatch'], 'htdocs/variants/class/ProductCombination.class.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/webportal/class/html.formwebportal.class.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/webportal/controllers/default.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/document.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/invoicelist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/login.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/membercard.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/orderlist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/partnershipcard.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/webportal/controllers/propallist.controller.class.php' => ['PhanParamSignatureMismatch'], - 'htdocs/website/class/website.class.php' => ['PhanPluginSuspiciousParamOrder', 'PhanTypeArraySuspiciousNull'], - 'htdocs/website/index.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/website/samples/wrapper.php' => ['PhanPluginSuspiciousParamPosition'], - 'htdocs/core/lib/json.lib.php' => ['PhanCompatibleNegativeStringOffset'], + 'internal' => ['PhanUndeclaredConstant'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. // (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) From 9cc3476765c5590ae19938ef9a4b522f519ca237 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:27:09 +0100 Subject: [PATCH 17/22] Fix: PHPDoc annotations in unappropriate comment (#28713) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Fix: PHPDoc annotations in unappropriate comment # Fix: PHPDoc annotations in unappropriate comment PHPDoc annotations need to be in /** */ or // comments. Fixed that (change type, move comment, add suppress directive) * Update dolreceiptprinter.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/api/admin/explorer_withredoc.php | 4 +-- .../class/bonprelevement.class.php | 34 +++++++++---------- htdocs/core/class/dolreceiptprinter.class.php | 6 ++-- htdocs/core/class/rssparser.class.php | 16 ++++----- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/api/admin/explorer_withredoc.php b/htdocs/api/admin/explorer_withredoc.php index 8c94e7a6f620e..fa370d54c9c31 100644 --- a/htdocs/api/admin/explorer_withredoc.php +++ b/htdocs/api/admin/explorer_withredoc.php @@ -14,14 +14,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php. */ /** * \defgroup api Module DolibarrApi * \brief API explorer using the swagger.json file * \file htdocs/api/admin/explorer_withredoc.php + * + * @deprecated Old explorer. Not using Swagger. See instead explorer in htdocs/api/index.php. */ require_once '../../main.inc.php'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9b3b16b60fc0a..abda85280a0a2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -92,7 +92,7 @@ class BonPrelevement extends CommonObject */ public $file; - /* + /** * @var string filename */ public $filename; @@ -146,21 +146,21 @@ class BonPrelevement extends CommonObject /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>0,), - 'ref' => array('type'=>'varchar(12)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflowmax150', 'showoncombobox'=>'1',), - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>25, 'notnull'=>0, 'visible'=>-1,), - 'amount' => array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>-1,), - 'statut' => array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>'1', 'position'=>500, 'notnull'=>0, 'visible'=>-1, 'arrayofkeyval'=>array(0=>'Wait', 1=>'Transfered', 2=>'Credited')), - 'credite' => array('type'=>'smallint(6)', 'label'=>'Credite', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>-1,), - 'note' => array('type'=>'text', 'label'=>'Note', 'enabled'=>'1', 'position'=>45, 'notnull'=>0, 'visible'=>-1,), - 'date_trans' => array('type'=>'datetime', 'label'=>'Datetrans', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>-1,), - 'method_trans' => array('type'=>'smallint(6)', 'label'=>'Methodtrans', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1,), - 'fk_user_trans' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusertrans', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150',), - 'date_credit' => array('type'=>'datetime', 'label'=>'Datecredit', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-1,), - 'fk_user_credit' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fkusercredit', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150',), - 'type' => array('type'=>'varchar(16)', 'label'=>'Type', 'enabled'=>'1', 'position'=>75, 'notnull'=>0, 'visible'=>-1,), - 'fk_bank_account' => array('type'=>'integer', 'label'=>'Fkbankaccount', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>-1, 'css'=>'maxwidth500 widthcentpercentminusxx',), + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), + 'ref' => array('type' => 'varchar(12)', 'label' => 'Ref', 'enabled' => '1', 'position' => 15, 'notnull' => 0, 'visible' => -1, 'csslist' => 'tdoverflowmax150', 'showoncombobox' => '1',), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 25, 'notnull' => 0, 'visible' => -1,), + 'amount' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => -1,), + 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => '1', 'position' => 500, 'notnull' => 0, 'visible' => -1, 'arrayofkeyval' => array(0 => 'Wait', 1 => 'Transfered', 2 => 'Credited')), + 'credite' => array('type' => 'smallint(6)', 'label' => 'Credite', 'enabled' => '1', 'position' => 40, 'notnull' => 0, 'visible' => -1,), + 'note' => array('type' => 'text', 'label' => 'Note', 'enabled' => '1', 'position' => 45, 'notnull' => 0, 'visible' => -1,), + 'date_trans' => array('type' => 'datetime', 'label' => 'Datetrans', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => -1,), + 'method_trans' => array('type' => 'smallint(6)', 'label' => 'Methodtrans', 'enabled' => '1', 'position' => 55, 'notnull' => 0, 'visible' => -1,), + 'fk_user_trans' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusertrans', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'date_credit' => array('type' => 'datetime', 'label' => 'Datecredit', 'enabled' => '1', 'position' => 65, 'notnull' => 0, 'visible' => -1,), + 'fk_user_credit' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fkusercredit', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150',), + 'type' => array('type' => 'varchar(16)', 'label' => 'Type', 'enabled' => '1', 'position' => 75, 'notnull' => 0, 'visible' => -1,), + 'fk_bank_account' => array('type' => 'integer', 'label' => 'Fkbankaccount', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',), ); public $rowid; public $ref; @@ -1565,7 +1565,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss global $action, $hookmanager; $hookmanager->initHooks(array('banktransferdao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4d8c8b0f78557..bc5d8fc9d4e66 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -129,7 +129,7 @@ class dolReceiptPrinter extends Printer */ public $db; - /* + /** * @var string[] array of tags */ public $tags; @@ -800,7 +800,7 @@ public function sendToPrinter($object, $templateid, $printerid) $this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); break; case 'DOL_PRINT_CURR_DATE': - if (strlen($vals[$tplline]['value'])<2) { + if (strlen($vals[$tplline]['value']) < 2) { $this->printer->text(date('d/m/Y H:i:s')."\n"); } else { $this->printer->text(date($vals[$tplline]['value'])."\n"); @@ -1056,7 +1056,7 @@ public function initPrinter($printerid) $this->connector = new CupsPrintConnector($parameter); break; default: - $found = false;; + $found = false; break; } if ($found) { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index d8ae597f9d36e..c16cc2d300779 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -503,13 +503,13 @@ public function parser($urlRSS, $maxNb = 0, $cachedelay = 60, $cachedir = '') // Add record to result array $this->_rssarray[$i] = array( - 'link'=>$itemLink, - 'title'=>$itemTitle, - 'description'=>$itemDescription, - 'pubDate'=>$itemPubDate, - 'category'=>$itemCategory, - 'id'=>$itemId, - 'author'=>$itemAuthor + 'link' => $itemLink, + 'title' => $itemTitle, + 'description' => $itemDescription, + 'pubDate' => $itemPubDate, + 'category' => $itemCategory, + 'id' => $itemId, + 'author' => $itemAuthor ); //var_dump($this->_rssarray); @@ -812,7 +812,7 @@ private function getAtomImageUrl(array $feed) } } - +// @phan-suppress PhanPluginPHPDocInWrongComment /* * A method for the xml_set_external_entity_ref_handler() * From d846044e386fa87732181e5191dc1db8474dcdcc Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:30:04 +0100 Subject: [PATCH 18/22] Fix: $form argument to price() must be int (#28699) * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 * Fix: $form argument to price() must be int # Fix: $form argument to price() must be int Changed '' for $form into 0 --- htdocs/comm/propal/card.php | 30 +++++++------- htdocs/comm/propal/list.php | 4 +- htdocs/commande/card.php | 40 +++++++++---------- htdocs/commande/list.php | 4 +- htdocs/commande/list_det.php | 4 +- htdocs/compta/bank/releve.php | 4 +- htdocs/compta/facture/card-rec.php | 14 +++---- htdocs/compta/facture/card.php | 26 ++++++------ htdocs/compta/facture/list.php | 4 +- htdocs/compta/facture/prelevement.php | 6 +-- htdocs/compta/paiement/card.php | 6 +-- htdocs/compta/paymentbybanktransfer/index.php | 4 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formmargin.class.php | 12 +++--- htdocs/don/card.php | 4 +- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorbooth_document.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/shipment.php | 8 ++-- htdocs/fourn/commande/card.php | 20 +++++----- htdocs/fourn/facture/card-rec.php | 6 +-- htdocs/fourn/facture/card.php | 12 +++--- htdocs/fourn/paiement/card.php | 2 +- htdocs/fourn/paiement/document.php | 2 +- htdocs/product/composition/card.php | 8 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/element.php | 6 +-- htdocs/projet/ganttview.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/card.php | 23 ++++++----- htdocs/supplier_proposal/card.php | 20 +++++----- htdocs/user/bank.php | 6 +-- htdocs/user/card.php | 10 ++--- 43 files changed, 160 insertions(+), 159 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7a3b3c13cba56..6d6ac13c58dad 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -834,7 +834,7 @@ } elseif ($action == 'import_lines_from_object' && $user->hasRight('propal', 'creer') && $object->statut == Propal::STATUS_DRAFT - ) { + ) { // add lines from objectlinked $fromElement = GETPOST('fromelement'); $fromElementid = GETPOST('fromelementid'); @@ -964,7 +964,7 @@ // Define margin $margin_rate = (GETPOST('marginforalllines') ? GETPOST('marginforalllines') : 0); foreach ($object->lines as &$line) { - $subprice = price2num($line->pa_ht * (1 + $margin_rate/100), 'MU'); + $subprice = price2num($line->pa_ht * (1 + $margin_rate / 100), 'MU'); $prod = new Product($db); $prod->fetch($line->fk_product); if ($prod->price_min > $subprice) { @@ -1083,7 +1083,7 @@ $pu_ttc_devise = 0; $price_min = 0; $price_min_ttc = 0; - $tva_npr=0; + $tva_npr = 0; $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); $db->begin(); @@ -1245,8 +1245,8 @@ } //If text set in desc is the same as product description (as now it's preloaded) we add it only one time - if ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { - $product_desc=''; + if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { + $product_desc = ''; } if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { @@ -2884,35 +2884,35 @@ print '
'; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; } @@ -2920,9 +2920,9 @@ print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 0a03d0cc1cdb5..2bc33b37f3f49 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -2256,14 +2256,14 @@ } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 92621cdfcacec..9722ca53344dc 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -933,8 +933,8 @@ } //If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time - if ($product_desc==$desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { - $product_desc=''; + if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { + $product_desc = ''; } if (!empty($product_desc) && getDolGlobalString('MAIN_NO_CONCAT_DESCRIPTION')) { @@ -1523,7 +1523,7 @@ if ($action == 'import_lines_from_object' && $usercancreate && $object->statut == Commande::STATUS_DRAFT - ) { + ) { $fromElement = GETPOST('fromelement'); $fromElementid = GETPOST('fromelementid'); $importLines = GETPOST('line_checkbox'); @@ -2782,19 +2782,19 @@ print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print ''; + print ''; } print ''; print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print ''; + print ''; } print ''; @@ -2802,9 +2802,9 @@ if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; @@ -2812,9 +2812,9 @@ if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print ''; - print ''; + print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ''; + print ''; } print ''; } @@ -2963,7 +2963,7 @@ $arrayforbutaction = array(); // Create a purchase order - $arrayforbutaction[] = array('lang'=>'orders', 'enabled'=>(isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm'=>$usercancreatepurchaseorder, 'label'=>'AddPurchaseOrder', 'url'=>'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); + $arrayforbutaction[] = array('lang' => 'orders', 'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0), 'perm' => $usercancreatepurchaseorder, 'label' => 'AddPurchaseOrder', 'url' => '/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id); /*if (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT && $object->getNbOfServicesLines() > 0) { if ($usercancreatepurchaseorder) { print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id, ''); @@ -2971,7 +2971,7 @@ }*/ // Create intervention - $arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang' => 'interventions', 'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm' => $user->hasRight('ficheinter', 'creer'), 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('ficheinter')) { $langs->load("interventions"); @@ -2985,7 +2985,7 @@ }*/ // Create contract - $arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang' => 'contracts', 'enabled' => (isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm' => $user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url' => '/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); @@ -3002,7 +3002,7 @@ // Create shipment if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { - $arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id); + $arrayforbutaction[] = array('lang' => 'sendings', 'enabled' => (isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm' => $user->hasRight('expedition', 'creer'), 'label' => 'CreateShipment', 'url' => '/expedition/shipment.php?id='.$object->id); /* if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); @@ -3017,11 +3017,11 @@ // Create bill $arrayforbutaction[] = array( - 'lang'=>'bills', - 'enabled'=>(isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), - 'perm'=>($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), - 'label'=>'CreateBill', - 'url'=>'/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid + 'lang' => 'bills', + 'enabled' => (isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), + 'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), + 'label' => 'CreateBill', + 'url' => '/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid ); /* if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ea017fbef3bff..b84de3413f5f4 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2554,7 +2554,7 @@ // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -2562,7 +2562,7 @@ // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 3c0f25f74ace1..0eec5b4bb5837 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -1997,14 +1997,14 @@ } // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 97e855217a642..56eb4e93a6cd9 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -387,7 +387,7 @@ $balancestart[$objp->numr] = $obj->amount; $db->free($resql); } - print ''; + print ''; // Calculate end amount $sql = "SELECT sum(b.amount) as amount"; @@ -400,7 +400,7 @@ $content[$objp->numr] = $obj->amount; $db->free($resql); } - print ''; + print ''; print '"; // Date next run @@ -1145,14 +1145,14 @@ // Auto validate the invoice print ""; // Auto generate document if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { print ""; } else { @@ -1308,11 +1308,11 @@ // Amount (excl. tax) print ''; - print ''; + print ''; print ''; // Amount tax - print ''; + print ''; print ''; // Amount Local Taxes @@ -1325,7 +1325,7 @@ print ''; } - print ''; + print ''; print ''; @@ -1543,7 +1543,7 @@ print '
'; diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 578d58a011784..00e7c8c0a6736 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -135,24 +135,24 @@ $sortfield = 'f.titre'; } $arrayfields = array( - 'f.titre'=>array('label'=>'Ref', 'checked'=>1), - 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'f.total_ht'=>array('label'=>'AmountHT', 'checked'=>1), - 'f.total_tva'=>array('label'=>'AmountVAT', 'checked'=>1), - 'f.total_ttc'=>array('label'=>'AmountTTC', 'checked'=>1), - 'f.fk_mode_reglement'=>array('label'=>'PaymentMode', 'checked'=>0), - 'f.fk_cond_reglement'=>array('label'=>'PaymentTerm', 'checked'=>0), - 'recurring'=>array('label'=>'RecurringInvoice', 'checked'=>1), - 'f.frequency'=>array('label'=>'Frequency', 'checked'=>1), - 'f.unit_frequency'=>array('label'=>'FrequencyUnit', 'checked'=>1), - 'f.nb_gen_done'=>array('label'=>'NbOfGenerationDoneShort', 'checked'=>1), - 'f.date_last_gen'=>array('label'=>'DateLastGenerationShort', 'checked'=>1), - 'f.date_when'=>array('label'=>'NextDateToExecutionShort', 'checked'=>1), - 'f.fk_user_author'=>array('label'=>'UserCreation', 'checked'=>0, 'position'=>500), - 'f.fk_user_modif'=>array('label'=>'UserModification', 'checked'=>0, 'position'=>505), - 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>520), - 'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>525), - 'status'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000), + 'f.titre' => array('label' => 'Ref', 'checked' => 1), + 's.nom' => array('label' => 'ThirdParty', 'checked' => 1), + 'f.total_ht' => array('label' => 'AmountHT', 'checked' => 1), + 'f.total_tva' => array('label' => 'AmountVAT', 'checked' => 1), + 'f.total_ttc' => array('label' => 'AmountTTC', 'checked' => 1), + 'f.fk_mode_reglement' => array('label' => 'PaymentMode', 'checked' => 0), + 'f.fk_cond_reglement' => array('label' => 'PaymentTerm', 'checked' => 0), + 'recurring' => array('label' => 'RecurringInvoice', 'checked' => 1), + 'f.frequency' => array('label' => 'Frequency', 'checked' => 1), + 'f.unit_frequency' => array('label' => 'FrequencyUnit', 'checked' => 1), + 'f.nb_gen_done' => array('label' => 'NbOfGenerationDoneShort', 'checked' => 1), + 'f.date_last_gen' => array('label' => 'DateLastGenerationShort', 'checked' => 1), + 'f.date_when' => array('label' => 'NextDateToExecutionShort', 'checked' => 1), + 'f.fk_user_author' => array('label' => 'UserCreation', 'checked' => 0, 'position' => 500), + 'f.fk_user_modif' => array('label' => 'UserModification', 'checked' => 0, 'position' => 505), + 'f.datec' => array('label' => 'DateCreation', 'checked' => 0, 'position' => 520), + 'f.tms' => array('label' => 'DateModificationShort', 'checked' => 0, 'position' => 525), + 'status' => array('label' => 'Status', 'checked' => 1, 'position' => 1000), ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -524,7 +524,7 @@ //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); +$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend' => $langs->trans("SendByMail"), 'builddoc' => $langs->trans("PDFMerge"))); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields @@ -675,7 +675,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // User creation @@ -702,10 +702,11 @@ if (!empty($arrayfields['status']['checked'])) { print ''; $liststatus = array( - 0=>$langs->trans("Draft"), - 1=>$langs->trans("Active"), - -1=>$langs->trans("Disabled"), + 0 => $langs->trans("Draft"), + 1 => $langs->trans("Active"), + -1 => $langs->trans("Disabled"), ); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, -2, 0, 0, '', 0, 0, 0, '', 'width100 onrightofpage'); print ''; if ($objp->frequency > 1) { - $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); + $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); } else { - $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year")); + $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); } print($objp->frequency > 0 ? $dur[$objp->unit_frequency] : ''); print ''; $listtype = array( - FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + FactureFournisseur::TYPE_STANDARD => $langs->trans("InvoiceStandard"), + FactureFournisseur::TYPE_REPLACEMENT => $langs->trans("InvoiceReplacement"), + FactureFournisseur::TYPE_CREDIT_NOTE => $langs->trans("InvoiceAvoir"), + FactureFournisseur::TYPE_DEPOSIT => $langs->trans("InvoiceDeposit"), ); /* if (!empty($conf->global->INVOICE_USE_SITUATION)) @@ -1109,7 +1109,7 @@ print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); print ''; print $form->selectarray('search_subtype', $subtypearray, $search_subtype, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); @@ -1289,7 +1289,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook -$parameters = array('arrayfields'=>$arrayfields); +$parameters = array('arrayfields' => $arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation @@ -1305,7 +1305,8 @@ // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { print ''; - $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + $liststatus = array('0' => $langs->trans("Draft"), '1' => $langs->trans("Unpaid"), '2' => $langs->trans("Paid")); + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'center search_status width100 onrightofpage', 1); print '
'; diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 26e6455ad32e4..08839af57499b 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -105,7 +105,7 @@ } $result = $object->fetch($id, $objectid, $batch); - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -281,6 +281,7 @@ print ''; } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Receptions"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); if (!empty($page)) { diff --git a/htdocs/public/webportal/tpl/menu.tpl.php b/htdocs/public/webportal/tpl/menu.tpl.php index 2275d8e8496c9..91edea91acbe4 100644 --- a/htdocs/public/webportal/tpl/menu.tpl.php +++ b/htdocs/public/webportal/tpl/menu.tpl.php @@ -112,10 +112,13 @@ ); $reshook = $hookmanager->executeHooks('PrintTopMenu', $parameters, $context, $context->action); // Note that $action and $object may have been modified by hook -if ($reshook < 0) $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if ($reshook < 0) { + $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} if (empty($reshook)) { if (!empty($hookmanager->resArray)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $navMenu = array_replace($navMenu, $hookmanager->resArray); } diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 347ed2c756af2..f1b8c29eb6c46 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -886,6 +886,7 @@ print ''; print ''; +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($massaction == 'createbills') { diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index e9707f39d44c2..fd5a1a88d06fa 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -297,7 +297,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if (file_exists($dir)) { // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks // Set nblines with the new facture lines content after hook @@ -358,6 +358,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->setSignature($cert, $cert, $this->emetteur->name, '', 2, $info); } + // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page @@ -627,9 +628,9 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $parameters = array( 'object' => $object, 'i' => $i, - 'pdf' =>& $pdf, - 'curY' =>& $curY, - 'nexY' =>& $nexY, + 'pdf' => & $pdf, + 'curY' => & $curY, + 'nexY' => & $nexY, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails ); @@ -711,7 +712,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede // Add pdfgeneration hook $hookmanager->initHooks(array('pdfgeneration')); - $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -721,7 +722,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede dolChmod($file); - $this->result = array('fullpath'=>$file); + $this->result = array('fullpath' => $file); return 1; // No error } else { @@ -1261,6 +1262,7 @@ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hide if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } elseif (empty($reshook)) { + // @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal $this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys } else { $this->cols = $hookmanager->resArray; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 80e4dd7baf183..3b1beab890d4f 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -128,11 +128,11 @@ if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -439,8 +439,8 @@ } $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewSalary'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); @@ -499,20 +499,20 @@ // Date start print ''; print '
'; - print $form->selectDate($search_date_start_from ? $search_date_start_from : -1, 'search_date_start_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print $form->selectDate($search_date_start_from ? $search_date_start_from : -1, 'search_date_start_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_date_start_to ? $search_date_start_to : -1, 'search_date_start_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print $form->selectDate($search_date_start_to ? $search_date_start_to : -1, 'search_date_start_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print '
'; print '
'; - print $form->selectDate($search_date_end_from ? $search_date_end_from : -1, 'search_date_end_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print $form->selectDate($search_date_end_from ? $search_date_end_from : -1, 'search_date_end_from', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; - print $form->selectDate($search_date_end_to ? $search_date_end_to : -1, 'search_date_end_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print $form->selectDate($search_date_end_to ? $search_date_end_to : -1, 'search_date_end_to', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print '
'; $liststatus = array('0' => $langs->trans("Unpaid"), '1' => $langs->trans("Paid")); +// @phan-suppress-next-line PhanPluginSuspiciousParamOrder print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage'); print ''; - $type = array('email'=>$langs->trans("EMail")); + $type = array('email' => $langs->trans("EMail")); print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp'); print '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '' . price($object->multicurrency_total_ht, '', $langs, 1, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '' . price($object->multicurrency_total_tva, '', $langs, 1, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 1, -1, -1, $object->multicurrency_code) . '' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 1, -1, -1, $object->multicurrency_code) . '' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '
' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '' . price($object->multicurrency_total_ttc, '', $langs, 1, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '
'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').'
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').''.price($balancestart[$objp->numr], '', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''.price($balancestart[$objp->numr], 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''.price(($balancestart[$objp->numr] + $content[$objp->numr]), '', $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''.price(($balancestart[$objp->numr] + $content[$objp->numr]), 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; if ($user->hasRight('banque', 'consolidate') && $action != 'editbankreceipt') { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index ab544c4ff70d3..954b0eb30777d 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1129,7 +1129,7 @@ // Frequency + unit print '
'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')).""; print " "; - print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); + print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); print "
".$langs->trans("StatusOfAutoGeneratedInvoices").""; - $select = array('0'=>$langs->trans('BillStatusDraft'), '1'=>$langs->trans('BillStatusValidated')); + $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); print "
".$langs->trans("StatusOfGeneratedDocuments").""; - $select = array('0'=>$langs->trans('DoNotGenerateDoc'), '1'=>$langs->trans('AutoGenerateDoc')); + $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print "
'.$langs->trans("AmountHT").''.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).''.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans("AmountVAT").''.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans("AmountVAT").''.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'
'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'
'.$langs->trans("AmountTTC").''.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'
'; print ''; print ''; print '
'; print " "; - print $form->selectarray('unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); + print $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); print '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 7127c82443490..9d277f17bc3ed 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1625,7 +1625,7 @@ $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount == 'amount') { - $descline .= ' ('.price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; + $descline .= ' ('.price($valuedeposit, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; } elseif ($typeamount == 'variable') { $descline .= ' ('.$valuedeposit.'%)'; } @@ -3356,12 +3356,12 @@ $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' - '.$langs->trans('CurrentOutstandingBill').': '; - print ''.price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency).''; + print ''.price($outstandingBills, 0, $langs, 0, 0, -1, $conf->currency).''; if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); } - print ' / '.price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ' / '.price($soc->outstanding_limit, 0, $langs, 0, 0, -1, $conf->currency); } print '
' . $langs->trans('AmountHT') . '' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->trans('AmountVAT') . '' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
' . $langs->trans('AmountTTC') . '' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '
'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2).'%').'
'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ht, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_tva, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.price($object->multicurrency_total_ttc, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$langs->trans('Amount').''.price($object->amount, '', $langs, 0, -1, -1, $conf->currency).'
'.$langs->trans('Amount').''.price($object->amount, 0, $langs, 0, -1, -1, $conf->currency).'
'.$invoice->getLibStatut(5, $alreadypayed).'
'.$langs->trans("Total").''; -print price($totaltoshow, '', '', 1, -1, -1, 'auto'); +print price($totaltoshow, 0, '', 1, -1, -1, 'auto'); print '

'; @@ -226,7 +226,7 @@ print ''.$langs->trans("SalaryInvoiceWaitingWithdraw").' ('.$numRow.')'; if ($numRow) { - while ($j < $numRow && $j<10) { + while ($j < $numRow && $j < 10) { $objSalary = $db->fetch_object($resql2); $user->fetch($objSalary->fk_user); diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index b8c75847372cd..e123c7692f64c 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -93,7 +93,7 @@ print ''.$langs->trans("AmountToWithdraw").''; print ''; -print price($bprev->SommeAPrelever('direct-debit'), '', '', 1, -1, -1, 'auto'); +print price($bprev->SommeAPrelever('direct-debit'), 0, '', 1, -1, -1, 'auto'); print '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 630602e2c751e..4a43106e8dc85 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -349,7 +349,7 @@ public function editfieldval($text, $htmlname, $value, $object, $perm, $typeofda } elseif (preg_match('/^url/', $typeofdata)) { $ret .= dol_print_url($value, '_blank', 32, 1); } elseif (preg_match('/^(amount|numeric)/', $typeofdata)) { - $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); + $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); } elseif (preg_match('/^checkbox/', $typeofdata)) { $tmp = explode(':', $typeofdata); $ret .= ''; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 1d3e333003299..c99648c999357 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -272,10 +272,10 @@ public function displayMarginInfos($object, $force_price = false) print '' . price($marginInfo['pa_products']) . ''; print '' . price($marginInfo['margin_on_products']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, null, null, null, 2) . '%') . ''; } print ''; } @@ -287,10 +287,10 @@ public function displayMarginInfos($object, $force_price = false) print '' . price($marginInfo['pa_services']) . ''; print '' . price($marginInfo['margin_on_services']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, null, null, null, 2) . '%') . ''; } print ''; } @@ -302,10 +302,10 @@ public function displayMarginInfos($object, $force_price = false) print '' . price($marginInfo['pa_total']) . ''; print '' . price($marginInfo['total_margin']) . ''; if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print '' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, null, null, null, 2) . '%') . ''; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print '' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2) . '%') . ''; + print '' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, null, null, null, 2) . '%') . ''; } print ''; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d925aa683687f..06546f208d187 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -453,12 +453,12 @@ $arrayoutstandingbills = $soc->getOutstandingBills(); $outstandingBills = $arrayoutstandingbills['opened']; print ' ('.$langs->trans('CurrentOutstandingBill').': '; - print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency); + print price($outstandingBills, 0, $langs, 0, 0, -1, $conf->currency); if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) { print img_warning($langs->trans("OutstandingBillReached")); } - print ' / '.price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); + print ' / '.price($soc->outstanding_limit, 0, $langs, 0, 0, -1, $conf->currency); } print ')'; print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 06fb0af429900..77ee9b6abd532 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -273,7 +273,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index bb19456cd2cf9..201dc52710bfe 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -261,7 +261,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 16ab981af3bc6..788128a69065b 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -234,7 +234,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a2b370ba6f461..9ee0be54b5804 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -389,7 +389,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($project->budget_amount, '')) { - print ''.price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($project->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index a83218f0a1251..b57b5180bf5b2 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -309,7 +309,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index afb8f29d9425f..cbaf93a8f4540 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -488,7 +488,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 7a3347098abb3..fe20c6ed00887 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -547,17 +547,17 @@ if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } @@ -772,7 +772,7 @@ // Qty remains to ship print ''; - if ($type == 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')|| getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { + if ($type == 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES') || getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { $toBeShipped[$objp->fk_product] = $objp->qty - $qtyAlreadyShipped; $toBeShippedTotal += $toBeShipped[$objp->fk_product]; print $toBeShipped[$objp->fk_product]; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0171b5d597da8..85de2e7fb6fc8 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2340,20 +2340,20 @@ print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; // Amount VAT print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -2361,18 +2361,18 @@ if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -2386,10 +2386,10 @@ print ''; // Amount TTC print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . $alert . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . $alert . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index d4581c706b340..c3d748e81d1a5 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1205,10 +1205,10 @@ print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; - print '' . $langs->trans("AmountVAT") . '' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans("AmountVAT") . '' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; // Amount Local Taxes @@ -1221,7 +1221,7 @@ print '' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . ''; } - print '' . $langs->trans("AmountTTC") . '' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . ''; + print '' . $langs->trans("AmountTTC") . '' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . ''; print ''; // Payment term diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c6b9c6457e592..8244ed6e8afca 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1224,7 +1224,7 @@ $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount == 'amount') { - $descline .= ' ('.price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; + $descline .= ' ('.price($valuedeposit, 0, $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; } elseif ($typeamount == 'variable') { $descline .= ' ('.$valuedeposit.'%)'; } @@ -3535,9 +3535,9 @@ function setRadioForTypeOfInvoice() { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -3568,7 +3568,7 @@ function setRadioForTypeOfInvoice() { print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); print ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -3587,9 +3587,9 @@ function setRadioForTypeOfInvoice() { print ''; print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 0987ec11c6f82..966cde2511b8f 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -221,7 +221,7 @@ // Amount print ''.$langs->trans('Amount').''; - print ''.price($object->amount, '', $langs, 0, 0, -1, $conf->currency).''; + print ''.price($object->amount, 0, $langs, 0, 0, -1, $conf->currency).''; // Status of validation of payment if (getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION')) { diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index b407c48982271..db152d3eb4717 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -126,7 +126,7 @@ $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Amount - $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, '', $langs, 0, 0, -1, $conf->currency); + $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); $allow_delete = 1; // Bank account diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 54310e0d7597a..0292732aefcc4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -446,7 +446,7 @@ $total += $totalline; print ''; - print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '').''.price($unitline, '', '', 0, 0, -1, $conf->currency)).''; + print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '').''.price($unitline, 0, '', 0, 0, -1, $conf->currency)).''; print ''; // Best selling price @@ -460,7 +460,7 @@ print ''; print($notdefined ? '' : ($value['nb'] > 1 ? $value['nb'].'x ' : '')); if (is_numeric($pricesell)) { - print ''.price($pricesell, '', '', 0, 0, -1, $conf->currency).''; + print ''.price($pricesell, 0, '', 0, 0, -1, $conf->currency).''; } else { print ''.$langs->trans($pricesell).''; } @@ -567,7 +567,7 @@ if ($atleastonenotdefined) { print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')'; } - print($atleastonenotdefined ? '' : price($total, '', '', 0, 0, -1, $conf->currency)); + print($atleastonenotdefined ? '' : price($total, 0, '', 0, 0, -1, $conf->currency)); print ''; // Minimum selling price @@ -579,7 +579,7 @@ if ($atleastonenotdefined) { print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')'; } - print($atleastonenotdefined ? '' : price($totalsell, '', '', 0, 0, -1, $conf->currency)); + print($atleastonenotdefined ? '' : price($totalsell, 0, '', 0, 0, -1, $conf->currency)); print ''; // Stock diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 48803930572b6..299b15c12fa98 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -143,7 +143,7 @@ // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index dd053b04549be..310ecd4704e7c 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -306,14 +306,14 @@ // Opportunity percent print ''.$langs->trans("OpportunityProbability").''; if (!is_null($object->opp_percent) && strcmp($object->opp_percent, '')) { - print price($object->opp_percent, '', $langs, 1, 0).' %'; + print price($object->opp_percent, 0, $langs, 1, 0).' %'; } print ''; // Opportunity Amount print ''.$langs->trans("OpportunityAmount").''; if (!is_null($object->opp_amount) && strcmp($object->opp_amount, '')) { - print ''.price($object->opp_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->opp_amount, 0, $langs, 1, 0, 0, $conf->currency).''; if (strcmp($object->opp_percent, '')) { print '       '.$langs->trans("Weighted").': '.price($object->opp_amount * $object->opp_percent / 100, 0, $langs, 1, 0, -1, $conf->currency).''; } @@ -324,7 +324,7 @@ // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 63bbbc3ff6e23..6b0e853937fbe 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -188,7 +188,7 @@ // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 4ae290dcf7a38..c5b496273f9b9 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -638,7 +638,7 @@ // Budget print ''.$langs->trans("Budget").''; if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($object->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 8363c284ba201..4656f02dbed89 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -224,7 +224,7 @@ // Budget print ''.$langs->trans("Budget").''; if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 3ae0f6d39e5ea..f8cc28e05a25a 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -260,7 +260,7 @@ // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 207f331d327ec..7507cafa4b3eb 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -217,7 +217,7 @@ // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 5ef996d2ae587..dfd36d12df799 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -207,7 +207,7 @@ // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + print price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); } print ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index d9face5c16a92..39a8f5dd7db53 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -332,7 +332,7 @@ // Budget print ''.$langs->trans("Budget").''; if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + print ''.price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; } print ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d4a18ca5fccec..5f079bb44e952 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1009,7 +1009,7 @@ // Budget print '' . $langs->trans("Budget") . ''; if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { - print '' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . ''; + print '' . price($projectstatic->budget_amount, 0, $langs, 1, 0, 0, $conf->currency) . ''; } print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index aa8e03f9d5e41..134d68a3eab8d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -93,7 +93,8 @@ $langs->load("products"); } -$error = 0; $errors = array(); +$error = 0; +$errors = array(); // Get parameters @@ -171,7 +172,7 @@ * Actions */ -$parameters = array('id'=>$socid, 'objcanvas'=>$objcanvas); +$parameters = array('id' => $socid, 'objcanvas' => $objcanvas); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -292,12 +293,12 @@ $error++; } - if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email') == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } - if (isModEnabled('mailing') && GETPOSTINT("private") == 1 && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && GETPOSTINT("private") == 1 && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT('contact_no_email') == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } @@ -1413,7 +1414,7 @@ function formatCustomerSelection (selection) { // Status print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; - print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); + print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; // Barcode @@ -1728,7 +1729,7 @@ function formatCustomerSelection (selection) { } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Parent company @@ -2167,7 +2168,7 @@ function init_supplier_categ() { // Status print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; - print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); + print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; // Address @@ -2487,7 +2488,7 @@ function init_check_no_email(input) { } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; // Parent company @@ -2945,9 +2946,9 @@ function init_check_no_email(input) { print ''.$langs->trans('Capital').''; if ($object->capital) { if (isModEnabled("multicurrency") && !empty($object->multicurrency_code)) { - print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code); + print price($object->capital, 0, $langs, 0, -1, -1, $object->multicurrency_code); } else { - print price($object->capital, '', $langs, 0, -1, -1, $conf->currency); + print price($object->capital, 0, $langs, 0, -1, -1, $conf->currency); } } else { print ' '; @@ -3048,7 +3049,7 @@ function init_check_no_email(input) { } // Other attributes - $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $parameters = array('socid' => $socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Parent company diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e8fc5bf25d194..f072cf540c47b 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1825,20 +1825,20 @@ print ''; // Amount HT print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; // Amount VAT print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount VAT - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; @@ -1846,18 +1846,18 @@ if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -1866,10 +1866,10 @@ print ''; // Amount TTC print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { // Multicurrency Amount TTC - print '' . price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 535452175f120..20fa770194a0b 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -441,7 +441,7 @@ // Salary print ''.$langs->trans("Salary").''; print ''; - print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, 0, $langs, 1, -1, -1, $conf->currency) : '').''; print ''; print "\n"; @@ -451,7 +451,7 @@ print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; @@ -461,7 +461,7 @@ print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 94447146dbf42..984bed16d5c8c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1657,7 +1657,7 @@ // Salary print ''.$langs->trans("Salary").''; print ''; - print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; + print($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, 0, $langs, 1, -1, -1, $conf->currency) : '').''; print ''; print "\n"; @@ -1667,7 +1667,7 @@ print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; @@ -1677,7 +1677,7 @@ print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); print ''; print "\n"; } @@ -2861,7 +2861,7 @@ if ($caneditfield) { print ''; } else { - print($object->thm != '' ? price($object->thm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->thm != '' ? price($object->thm, 0, $langs, 1, -1, -1, $conf->currency) : ''); } print ''; print "\n"; @@ -2875,7 +2875,7 @@ if ($caneditfield) { print ''; } else { - print($object->tjm != '' ? price($object->tjm, '', $langs, 1, -1, -1, $conf->currency) : ''); + print($object->tjm != '' ? price($object->tjm, 0, $langs, 1, -1, -1, $conf->currency) : ''); } print ''; print "\n"; From f309d1634cd4ff4765a8db6bbbfe0182b4f5ace8 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:30:46 +0100 Subject: [PATCH 19/22] Qual: Better hint for index value for phan (#28712) # Qual: Better hint for index value for phan. ($i - 1) must be >= 0, so update test from $i>0 to $i>=1 . This helps static analysis. --- htdocs/core/lib/json.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index b5a53c7f8883d..15f54b75f9789 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -267,7 +267,7 @@ function dol_json_decode($json, $assoc = false) } else { $out .= $json[$i]; } - if ($i > 0 && $json[$i] == '"' && $json[($i - 1)] != "\\") { + if ($i >= 1 && $json[$i] == '"' && $json[$i - 1] != "\\") { $comment = !$comment; } } From 3d0a85608b0cc884d8b593b9c79544c6e21cfc33 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:34:18 +0100 Subject: [PATCH 20/22] Qual: Fix and enable alias deprecation detection (#28716) * Qual: Ignore some false positives for deprecated functions # Qual: Ignore some false positives for deprecated functions The Phan Deprecation Plugin for internal functions has mixed up some mail functions and lists them as deprecated, this ignores that * Qual: Enable detection and fixing of internal deprecations * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Replace 'join' with 'implode' * Qual: Update codespell lines ignore list after format # Qual: Update codespell lines ignore list after forma Done using latest library, so also adds some exceptions that are needed in the future; --------- Co-authored-by: Laurent Destailleur --- .../codespell/codespell-lines-ignore.txt | 16 ++- dev/tools/phan/config.php | 2 +- dev/tools/phan/config_fixer.php | 6 +- htdocs/asset/class/asset.class.php | 64 +++++----- htdocs/asset/class/assetmodel.class.php | 30 ++--- htdocs/bom/class/bom.class.php | 92 +++++++-------- htdocs/bookcal/class/availabilities.class.php | 44 +++---- htdocs/bookcal/class/calendar.class.php | 36 +++--- htdocs/categories/class/categorie.class.php | 16 +-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 16 +-- htdocs/core/class/timespent.class.php | 42 +++---- htdocs/core/lib/functions.lib.php | 1 + .../class/conferenceorbooth.class.php | 36 +++--- .../class/conferenceorboothattendee.class.php | 2 +- .../fournisseur.commande.dispatch.class.php | 4 +- htdocs/hrm/class/evaluation.class.php | 44 +++---- htdocs/hrm/class/evaluationdet.class.php | 26 ++--- htdocs/hrm/class/job.class.php | 26 ++--- htdocs/hrm/class/position.class.php | 32 ++--- htdocs/hrm/class/skill.class.php | 41 ++++--- htdocs/hrm/class/skilldet.class.php | 18 +-- htdocs/hrm/class/skillrank.class.php | 24 ++-- htdocs/mrp/class/mo.class.php | 110 +++++++++--------- .../class/opensurveysondage.class.php | 40 +++---- .../class/partnership_type.class.php | 16 +-- .../class/stocktransfer.class.php | 58 ++++----- .../class/stocktransferline.class.php | 26 ++--- .../class/recruitmentcandidature.class.php | 52 ++++----- .../class/recruitmentjobposition.class.php | 52 ++++----- htdocs/ticket/class/cticketcategory.class.php | 28 ++--- htdocs/user/class/user.class.php | 24 ++-- htdocs/webhook/class/target.class.php | 34 +++--- htdocs/website/class/websitepage.class.php | 48 ++++---- .../workstation/class/workstation.class.php | 42 +++---- htdocs/zapier/class/hook.class.php | 2 +- 36 files changed, 585 insertions(+), 567 deletions(-) diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 5ddee3b9244a4..94c67e08f754f 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -56,7 +56,7 @@ $this->datea = $this->db->jdate($obj->datea); $this->datee = $this->db->jdate($obj->datee); $this->periode = $this->db->jdate($obj->period); - $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses); + $tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses); $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment //si les reponses ne concerne pas la colonne effacée, on concatenate GETPOST("mouvement", 'alpha'), @@ -73,6 +73,8 @@ $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $ensemblereponses = $obj->reponses; + $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field + $newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit); $object->datee = $datee; $object->periode = $dateperiod; $return .= '
'.$langs->trans("Payement").' : '.$this->type_payment.''; @@ -97,16 +99,19 @@ $taskstatic->datee = $db->jdate($obj->date_end); $this->category->childs = array(); $this->datea = dol_now(); + $tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field 'datee' => $date_end, // mise a jour des reponses utilisateurs dans la base if (!empty($arrayfields['t.datee']['checked'])) { if ($user->hasRight('stock', 'mouvement', 'lire')) { if (empty($reyear) || empty($remonth) || empty($reday)) { jQuery("#mouvement").change(function() { + preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg); print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1); print ''.$langs->trans("TransferStock").''; print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; print ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.$langs->trans("AddIn").''; print dol_print_date($object->periode, "day"); $TWeek[$week_number] = $week_number; $action = 'transfert'; @@ -174,6 +179,8 @@ if (in_array('01', $TWeek) && in_array('52', $TWeek) && $weekNb == '01') { print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0); print $object->datee ? dol_print_date($object->datee, 'daytext') : ' '; + print ''; + print ''.$langs->trans("AddIn").''; print ''.$langs->trans("Datee").''; print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", '', $param, '', $sortfield, $sortorder, 'center '); * @param string $datee End date (ex 23:59:59) @@ -189,6 +196,8 @@ $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"), 'tzuserrel'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans('Referers'); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $tmpval); + $inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val); $morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'"; $morewherefilterarray[] = " t.datee >= '".$db->idate($search_date_end_start)."'"; $opensurveysondage->mail_admin = $_SESSION['adresse']; @@ -221,7 +230,8 @@ $sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee"; $title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Referers'); $totalforvisibletasks = projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek); - 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), + $value = preg_replace('/([a-z\.]+)\s*([!<>=]+|in|notin|like|notlike)\s*/', '\1:\2:', $value); // Clean string 'x < 10' into 'x:<:10' so we can then explode on space to get all AND tests to do + 'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50), 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101), 't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>5), // Ligne de la periode d'analyse du rapport @@ -233,6 +243,7 @@ foreach ($TWeek as $week_number) { if (!empty($arrayfields['t.datee']['checked'])) { if ($action == "transfert") { + if ($object->id > 0 && $action == 'addin') { if (GETPOST('reday')) { if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) { print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); @@ -240,6 +251,7 @@ print ''; if ($default == '' || $notNull != 1) { $out .= ''; @@ -771,7 +772,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = } $out .= ''; break; - case 'sellist' : + case 'sellist': $out = ''; break; - case 'link' : + case 'link': $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]' $showempty = (($required && $default != '') ? 0 : 1); @@ -931,7 +932,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = break; - default : + default: if (!empty($hidden)) { $out = $this->inputType('hidden', $htmlName, $value, $htmlId); } From d93fd1839c3fda968475d8ac1d239dcffca1c777 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 8 Mar 2024 21:40:18 +0100 Subject: [PATCH 22/22] Fix typing for showOutputFieldForObject (#28709) # Fix typing for showOutputFieldForObject Type hint that $value can also be a list of strings. Also updated the "else-if" sequence so that a static tool checker can still appropriately detect when $value is a string and when it is a list of strings so that it provides correct feedback. Added an error message to the syslog in case we got an array but not "array" as the value for "$type" --- .../class/html.formwebportal.class.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 6634426f2dff6..6b6c73e9944bc 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -948,7 +948,7 @@ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = * @param CommonObject $object Common object * @param array $val Array of properties of field to show * @param string $key Key of attribute - * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) + * @param string|string[] $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) @@ -1026,6 +1026,9 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam } // Format output value differently according to properties of field + // + // First the cases that do not use $value from the arguments: + // if (in_array($key, array('rowid', 'ref'))) { if (property_exists($object, 'ref')) { $value = $object->ref; @@ -1036,6 +1039,20 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam } } elseif ($key == 'status' && method_exists($object, 'getLibStatut')) { $value = $object->getLibStatut(3); + // + // Then the cases where $value is an array + // + } elseif (is_array($value)) { + // Handle array early to get type identification solve for static + // analysis + if ($type == 'array') { + $value = implode('
', $value); + } else { + dol_syslog(__METHOD__ . 'ERROR unexpected type=$type for array value='.((string) json_encode($value)), LOG_ERR); + } + // + // Then the cases where $value is not an array (hence string) + // } elseif ($type == 'date') { if (!empty($value)) { $value = dol_print_date($value, 'day'); // We suppose dates without time are always gmt (storage of course + output) @@ -1305,8 +1322,6 @@ public function showOutputFieldForObject($object, $val, $key, $value, $moreparam } } elseif ($type == 'password') { $value = preg_replace('/./i', '*', $value); - } elseif ($type == 'array') { - $value = implode('
', $value); } else { // text|html|varchar $value = dol_htmlentitiesbr($value); }