From 69a7af88e7abf1494295587c920f4a6b0caeaa71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Aug 2018 18:14:02 +0200 Subject: [PATCH] function declaration --- .../class/accountancycategory.class.php | 17 +++++++++----- .../class/accountancysystem.class.php | 8 ++++--- .../class/accountingaccount.class.php | 21 ++++++++++++------ .../class/accountingjournal.class.php | 6 +++-- .../class/api_subscriptions.class.php | 5 +++-- htdocs/blockedlog/class/blockedlog.class.php | 10 +++++---- htdocs/compta/bank/class/account.class.php | 4 ++-- .../core/class/commondocgenerator.class.php | 22 ++++++++++--------- .../class/commonstickergenerator.class.php | 10 ++++----- .../core/class/html.formaccounting.class.php | 7 +++--- htdocs/core/class/openid.class.php | 19 +++++++++------- htdocs/core/class/smtps.class.php | 17 +++++++------- htdocs/core/class/vcard.class.php | 16 ++++++++------ htdocs/core/db/mssql.class.php | 7 +++--- htdocs/core/db/sqlite3.class.php | 10 +++++---- htdocs/core/lib/expensereport.lib.php | 13 ++++++----- .../modules/member/doc/pdf_standard.class.php | 5 +++-- htdocs/core/modules/modOauth.class.php | 4 ++-- htdocs/core/modules/modPrinting.class.php | 4 ++-- .../core/modules/modReceiptPrinter.class.php | 2 +- .../generate/modGeneratePassPerso.class.php | 6 ++--- .../user/doc/doc_generic_user_odt.modules.php | 6 ++--- htdocs/document.php | 8 +++++-- .../class/api_interventions.class.php | 13 ++++++----- .../class/api_supplier_invoices.class.php | 15 +++++++------ .../fourn/class/api_supplier_orders.class.php | 14 +++++++----- 26 files changed, 156 insertions(+), 113 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 27254ef31d1..7420ae8a982 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -359,7 +359,8 @@ class AccountancyCategory // extends CommonObject * @param int $id Id * @return int <0 if KO, 0 if not found, >0 if OK */ - public function display($id) { + public function display($id) + { global $conf; $sql = "SELECT t.rowid, t.account_number, t.label"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as t"; @@ -394,7 +395,8 @@ class AccountancyCategory // extends CommonObject * * @return int <0 if KO, 0 if not found, >0 if OK */ - public function getCptBK($id) { + public function getCptBK($id) + { global $conf; $sql = "SELECT t.numero_compte, t.label_operation, t.doc_ref"; @@ -442,8 +444,9 @@ class AccountancyCategory // extends CommonObject * * @return int <0 if KO, 0 if not found, >0 if OK */ - public function getAccountsWithNoCategory($id) { - global $conf; + public function getAccountsWithNoCategory($id) + { + global $conf; $sql = "SELECT aa.account_number as numero_compte, aa.label as label_compte"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; @@ -485,7 +488,8 @@ class AccountancyCategory // extends CommonObject * * @return int <0 if KO, >0 if OK */ - public function updateAccAcc($id_cat, $cpts = array()) { + public function updateAccAcc($id_cat, $cpts = array()) + { global $conf; $error = 0; @@ -548,7 +552,8 @@ class AccountancyCategory // extends CommonObject * * @return int <0 if KO, >0 if OK */ - public function deleteCptCat($cpt_id) { + public function deleteCptCat($cpt_id) + { $error = 0; $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account as aa"; diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index f14a3e7f761..7f946bb7e61 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -43,7 +43,8 @@ class AccountancySystem * * @param DoliDB $db handler */ - function __construct($db) { + function __construct($db) + { $this->db = $db; } @@ -102,7 +103,8 @@ class AccountancySystem * @param User $user making insert * @return int if KO, Id of line if OK */ - function create($user) { + function create($user) + { $now = dol_now(); $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_system"; @@ -130,4 +132,4 @@ class AccountancySystem return $result; } -} \ No newline at end of file +} diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 257c2af0111..a375a005a17 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -69,7 +69,8 @@ class AccountingAccount extends CommonObject * * @param DoliDB $db Database handle */ - function __construct($db) { + function __construct($db) + { global $conf; $this->db = $db; @@ -146,7 +147,8 @@ class AccountingAccount extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function create($user, $notrigger = 0) { + function create($user, $notrigger = 0) + { global $conf; $error = 0; $now = dol_now(); @@ -297,7 +299,8 @@ class AccountingAccount extends CommonObject * * @return int <0 if KO, >0 if OK */ - function checkUsage() { + function checkUsage() + { global $langs; $sql = "(SELECT fk_code_ventilation FROM " . MAIN_DB_PREFIX . "facturedet"; @@ -330,7 +333,8 @@ class AccountingAccount extends CommonObject * @param int $notrigger 0=triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function delete($user, $notrigger = 0) { + function delete($user, $notrigger = 0) + { $error = 0; $result = $this->checkUsage(); @@ -457,7 +461,8 @@ class AccountingAccount extends CommonObject * @param int $id of record * @return void */ - function info($id) { + function info($id) + { $sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a'; $sql .= ' WHERE a.rowid = ' . $id; @@ -494,7 +499,8 @@ class AccountingAccount extends CommonObject * @param int $id Id * @return int <0 if KO, >0 if OK */ - function account_desactivate($id) { + function account_desactivate($id) + { $result = $this->checkUsage(); if ($result > 0) { @@ -526,7 +532,8 @@ class AccountingAccount extends CommonObject * @param int $id Id * @return int <0 if KO, >0 if OK */ - function account_activate($id) { + function account_activate($id) + { $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 454de6d7b84..2291028ddf3 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -46,7 +46,8 @@ class AccountingJournal extends CommonObject * * @param DoliDB $db Database handle */ - function __construct($db) { + function __construct($db) + { $this->db = $db; } @@ -117,7 +118,8 @@ class AccountingJournal extends CommonObject * * @return int <0 if KO, >0 if OK */ - function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { + function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { $sql = "SELECT rowid, code, label, nature, active"; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; // Manage filter diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php index 3ae4f6f39d5..ed403167dd4 100644 --- a/htdocs/adherents/class/api_subscriptions.class.php +++ b/htdocs/adherents/class/api_subscriptions.class.php @@ -34,7 +34,7 @@ class Subscriptions extends DolibarrApi 'fk_adherent', 'dateh', 'datef', - 'amount' + 'amount', ); /** @@ -85,7 +85,8 @@ class Subscriptions extends DolibarrApi * * @throws RestException */ - function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') { + function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') + { global $db, $conf; $obj_ret = array(); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 0210491fba7..aca7ae47808 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -609,7 +609,8 @@ class BlockedLog * @param int $id Id of object to load * @return int >0 if OK, <0 if KO, 0 if not found */ - public function fetch($id) { + public function fetch($id) + { global $langs; @@ -705,7 +706,8 @@ class BlockedLog * * @return boolean */ - public function setCertified() { + public function setCertified() + { $res = $this->db->query("UPDATE ".MAIN_DB_PREFIX."blockedlog SET certified=1 WHERE rowid=".$this->id); if($res===false) return false; @@ -722,7 +724,8 @@ class BlockedLog * @param int $forcesignature Force signature (for example '0000000000' when we disabled the module) * @return int <0 if KO, >0 if OK */ - public function create($user, $forcesignature='') { + public function create($user, $forcesignature='') + { global $conf,$langs,$hookmanager; @@ -1055,4 +1058,3 @@ class BlockedLog } } - diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 79b72a5a54c..a4925330c2a 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -944,7 +944,8 @@ class Account extends CommonObject * * @param int[]|int $categories Category or categories IDs */ - public function setCategories($categories) { + public function setCategories($categories) + { // Handle single category if (! is_array($categories)) { $categories = array($categories); @@ -2282,4 +2283,3 @@ class AccountLine extends CommonObject } } - diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 70058ae4a7c..629bc19e390 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -42,9 +42,10 @@ abstract class CommonDocGenerator * * @param DoliDB $db Database handler */ - public function __construct($db) { - $this->db = $db; - } + public function __construct($db) + { + $this->db = $db; + } /** @@ -228,7 +229,8 @@ abstract class CommonDocGenerator * @param array_key $array_key Name of the key for return array * @return array of substitution key->code */ - function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') { + function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') + { global $conf; if(empty($object->country) && ! empty($object->country_code)) @@ -652,7 +654,8 @@ abstract class CommonDocGenerator * @param boolean $recursive Want to fetch child array or child object * @return array Array of substitution key->code */ - function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) { + function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) + { $array_other = array(); if(!empty($object)) { foreach($object as $key => $value) { @@ -769,10 +772,9 @@ abstract class CommonDocGenerator */ function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) { - if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); - $pdf->line($x+$l, $y, $x+$l, $y+$h); - if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); - $pdf->line($x, $y+$h, $x, $y); + if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); + $pdf->line($x+$l, $y, $x+$l, $y+$h); + if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); + $pdf->line($x, $y+$h, $x, $y); } } - diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 1091962f6ea..efd0f491162 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -93,7 +93,7 @@ abstract class CommonStickerGenerator { $this->db = $db; } - + /** * Function to build PDF on disk, then output on HTTP strem. * @@ -114,7 +114,7 @@ abstract class CommonStickerGenerator * @return void */ abstract function addSticker(&$pdf,$outputlangs,$param); - + /** * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne @@ -130,7 +130,7 @@ abstract class CommonStickerGenerator $this->_Line_Height = $this->_Get_Height_Chars($pt); $pdf->SetFont('','',$pt); } - } + } /** * protected Print dot line @@ -216,7 +216,7 @@ abstract class CommonStickerGenerator * @param string $dest to * @return float value value after conversion */ - function _Convert_Metric ($value, $src, $dest) + function _Convert_Metric($value, $src, $dest) { if ($src != $dest) { $tab['in'] = 39.37008; @@ -251,7 +251,7 @@ abstract class CommonStickerGenerator * @param string $format Format * @return void */ - function _Set_Format(&$pdf, $format) + function _Set_Format(&$pdf, $format) { $this->_Metric = $format['metric']; $this->_Avery_Name = $format['name']; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 17e437f5223..b6030809d6f 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -216,7 +216,8 @@ class FormAccounting extends Form * @param string $selectedkey Value * @return string HTML edit field */ - function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') { + function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') + { $options = array(); $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; @@ -339,7 +340,8 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') { + function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') + { $aux_account = array(); @@ -428,4 +430,3 @@ class FormAccounting extends Form } } } - diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index d46481a0c60..7d36df58b81 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -30,8 +30,8 @@ class SimpleOpenID var $URLs = array(); var $error = array(); var $fields = array( - 'required' => array(), - 'optional' => array(), + 'required' => array(), + 'optional' => array(), ); /** @@ -126,7 +126,8 @@ class SimpleOpenID * @return void */ function SetIdentity($a) - { // Set Identity URL + { + // Set Identity URL if ((stripos($a, 'http://') === false) && (stripos($a, 'https://') === false)){ $a = 'http://'.$a; @@ -153,7 +154,8 @@ class SimpleOpenID * @return string */ function GetIdentity() - { // Get Identity + { + // Get Identity return $this->openid_url_identity; } @@ -254,7 +256,8 @@ class SimpleOpenID * @return false|string false if KO, string of url if OK */ function array2url($arr) - { // converts associated array to URL Query String + { + // converts associated array to URL Query String if (!is_array($arr)){ return false; } @@ -306,7 +309,8 @@ class SimpleOpenID * @return string */ function CURL_Request($url, $method="GET", $params = "") - { // Remember, SSL MUST BE SUPPORTED + { + // Remember, SSL MUST BE SUPPORTED if (is_array($params)) $params = $this->array2url($params); $curl = curl_init($url . ($method == "GET" && $params != "" ? "?" . $params : "")); @@ -361,7 +365,7 @@ class SimpleOpenID */ function GetOpenIDServer($url='') { - global $conf; + global $conf; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; if (empty($url)) $url=$conf->global->MAIN_AUTHENTICATION_OPENID_URL; @@ -522,4 +526,3 @@ class SimpleOpenID } } - diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 7f0f8143cbd..c18e2232c01 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1650,7 +1650,7 @@ class SMTPs * @param integer $_value Message Priority * @return void */ - function setPriority ( $_value = 3 ) + function setPriority( $_value = 3 ) { if ( ( is_numeric($_value) ) && ( ( $_value >= 0 ) && ( $_value <= 5 ) ) ) @@ -1814,12 +1814,14 @@ class SMTPs * @param int $_errNum Error Code Number * @param string $_errMsg Error Message * @return void - */ - function _setErr ( $_errNum, $_errMsg ) - { - $this->_smtpsErrors[] = array( 'num' => $_errNum, - 'msg' => $_errMsg ); - } + */ + function _setErr( $_errNum, $_errMsg ) + { + $this->_smtpsErrors[] = array( + 'num' => $_errNum, + 'msg' => $_errMsg, + ); + } /** * Returns errors codes and messages for Class @@ -2049,4 +2051,3 @@ class SMTPs * - basic shell with some commets * */ - diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 8bdeb3e43b7..81fcb25e2b4 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -111,12 +111,13 @@ class vCard * mise en forme de la photo * warning NON TESTE ! * - * @param string $type Type - * @param string $photo Photo - * @return void - */ + * @param string $type Type + * @param string $photo Photo + * @return void + */ function setPhoto($type, $photo) - { // $type = "GIF" | "JPEG" + { + // $type = "GIF" | "JPEG" $this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo); } @@ -155,7 +156,7 @@ class vCard * @return void */ function setBirthday($date) - { + { // $date format is YYYY-MM-DD - RFC 2425 and RFC 2426 $this->properties["BDAY"] = dol_print_date($date, 'dayrfc'); } @@ -200,7 +201,8 @@ class vCard * @param string $type Type * @return void */ - function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") { + function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") + { $label = ""; if ($postoffice!="") $label.= "$postoffice\r\n"; if ($extended!="") $label.= "$extended\r\n"; diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 4734c3364b5..be980c306ec 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -1138,7 +1138,8 @@ class DoliDBMssql extends DoliDB * @param string $fieldname Field's name to escape * @return string field's name escaped */ - function EscapeFieldName($fieldname) { + function EscapeFieldName($fieldname) + { return "[".$fieldname."]"; } @@ -1150,7 +1151,8 @@ class DoliDBMssql extends DoliDB * @param mixed $fields String for one field or array of string for multiple field * @return false|object */ - function GetFieldInformation($table,$fields) { + function GetFieldInformation($table,$fields) + { $sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME"; if (is_array($fields)) { @@ -1176,4 +1178,3 @@ class DoliDBMssql extends DoliDB } } - diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 78762f282b4..a08756f786a 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -1302,7 +1302,8 @@ class DoliDBSqlite3 extends DoliDB * @param int $day Day * @return int Formatted date */ - private static function calc_daynr($year, $month, $day) { + private static function calc_daynr($year, $month, $day) + { $y = $year; if ($y == 0 && $month == 0) return 0; $num = (365* $y + 31 * ($month - 1) + $day); @@ -1322,7 +1323,8 @@ class DoliDBSqlite3 extends DoliDB * @param bool $sunday_first_day_of_week ??? * @return int */ - private static function calc_weekday($daynr, $sunday_first_day_of_week) { + private static function calc_weekday($daynr, $sunday_first_day_of_week) + { $ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); return $ret; } @@ -1348,7 +1350,8 @@ class DoliDBSqlite3 extends DoliDB * @param string $calc_year ??? * @return string ??? */ - private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) { + private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) + { $daynr=self::calc_daynr($year,$month,$day); $first_daynr=self::calc_daynr($year,1,1); $monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0; @@ -1388,4 +1391,3 @@ class DoliDBSqlite3 extends DoliDB } } - diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 1efdc73f247..779e6c9e174 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -67,7 +67,7 @@ function expensereport_prepare_head($object) $head[$h][2] = 'note'; $h++; } - + $head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; @@ -81,11 +81,12 @@ function expensereport_prepare_head($object) /** * Returns an array with the tabs for the "Expense report payment" section * It loads tabs from modules looking for the entity payment - * + * * @param Paiement $object Current payment object * @return array Tabs for the payment section */ -function payment_expensereport_prepare_head(PaymentExpenseReport $object) { +function payment_expensereport_prepare_head(PaymentExpenseReport $object) +{ global $langs, $conf; @@ -139,7 +140,7 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'expenseik'; $h++; } - + if (!empty($conf->global->MAIN_USE_EXPENSE_RULE)) { $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; @@ -147,7 +148,7 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'expenserules'; $h++; } - + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -168,5 +169,5 @@ function expensereport_admin_prepare_head() complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin','remove'); - return $head; + return $head; } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 49acce1e2d6..6a723ce0553 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -42,7 +42,8 @@ class pdf_standard extends CommonStickerGenerator * @param array $param Associative array containing label content and optional parameters * @return void */ - function addSticker(&$pdf,$outputlangs,$param) { + function addSticker(&$pdf,$outputlangs,$param) + { // use this method in future refactoring } @@ -323,7 +324,7 @@ class pdf_standard extends CommonStickerGenerator if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "admin", "members")); diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 3f2ecc0ac72..74689230525 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -40,7 +40,7 @@ class modOauth extends DolibarrModules * * @param DoliDB $db Database handler */ - function __construct($db) + function __construct($db) { $this->db = $db ; $this->numero = 66000; @@ -52,7 +52,7 @@ class modOauth extends DolibarrModules $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Enable OAuth authentication"; - // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module. diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index 17d2f398e2b..ea086e2dbbe 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -40,7 +40,7 @@ class modPrinting extends DolibarrModules * * @param DoliDB $db Database handler */ - function __construct($db) + function __construct($db) { $this->db = $db ; $this->numero = 64000; @@ -50,7 +50,7 @@ class modPrinting extends DolibarrModules $this->module_position = 520; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); - // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) + // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Enable Direct Printing System."; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 77f264f0d52..b2ed975a404 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -40,7 +40,7 @@ class modReceiptPrinter extends DolibarrModules * * @param DoliDB $db Database handler */ - function __construct($db) + function __construct($db) { $this->db = $db ; $this->numero = 67000; diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 96041bcac2c..39b3d54ea30 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -72,7 +72,7 @@ class modGeneratePassPerso extends ModeleGenPassword $this->langs=$langs; $this->user=$user; - if(empty($conf->global->USER_PASSWORD_PATTERN)){ + if (empty($conf->global->USER_PASSWORD_PATTERN)) { // default value (8carac, 1maj, 1digit, 1spe, 3 repeat, no ambi at auto generation. dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '8;1;1;1;3;1','chaine',0,'',$conf->entity); } @@ -201,7 +201,8 @@ class modGeneratePassPerso extends ModeleGenPassword * @param string $password Password to check * @return int 0 if KO, >0 if OK */ - function consecutiveInterationSameCharacter($password){ + function consecutiveInterationSameCharacter($password) + { $last = ""; $count = 0; $char = str_split($password); @@ -220,4 +221,3 @@ class modGeneratePassPerso extends ModeleGenPassword return 1; } } - diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index a2c15780e35..9e05292fb5a 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -409,7 +409,7 @@ class doc_generic_user_odt extends ModelePDFUser $odfHandler=null; // Destroy object $this->result = array('fullpath'=>$file); - + return 1; // Success } else @@ -422,7 +422,8 @@ class doc_generic_user_odt extends ModelePDFUser return -1; } - function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + function get_substitutionarray_object($object,$outputlangs,$array_key='object') + { $array_other=array(); foreach($object as $key => $value) { if (!is_array($value) && !is_object($value)) { @@ -433,4 +434,3 @@ class doc_generic_user_odt extends ModelePDFUser } } - diff --git a/htdocs/document.php b/htdocs/document.php index 725d079a9f6..81c8d00a9f7 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -64,13 +64,17 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) * * @return void */ -function llxHeader() { } +function llxHeader() +{ +} /** * Footer empty * * @return void */ -function llxFooter() { } +function llxFooter() +{ +} require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 8b21b534856..7701af5fe91 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -35,7 +35,7 @@ class Interventions extends DolibarrApi static $FIELDS = array( 'socid', 'fk_project', - 'description' + 'description', ); /** @@ -44,7 +44,7 @@ class Interventions extends DolibarrApi static $FIELDSLINE = array( 'description', 'date', - 'duree' + 'duree', ); /** @@ -106,7 +106,8 @@ class Interventions extends DolibarrApi * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') { + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') + { global $db, $conf; $obj_ret = array(); @@ -217,7 +218,8 @@ class Interventions extends DolibarrApi * @return int */ /* TODO - function getLines($id) { + function getLines($id) + { if(! DolibarrApiAccess::$user->rights->ficheinter->lire) { throw new RestException(401); } @@ -424,7 +426,8 @@ class Interventions extends DolibarrApi * @param object $object Object to clean * @return array Array of cleaned object properties */ - function _cleanObjectDatas($object) { + function _cleanObjectDatas($object) + { $object = parent::_cleanObjectDatas($object); diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 68bb902b8fb..3b3ac43c496 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -33,7 +33,7 @@ class SupplierInvoices extends DolibarrApi * @var array $FIELDS Mandatory fields, checked when create and update object */ static $FIELDS = array( - 'socid' + 'socid', ); /** @@ -96,7 +96,8 @@ class SupplierInvoices extends DolibarrApi * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') { + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') + { global $db, $conf; $obj_ret = array(); @@ -152,8 +153,7 @@ class SupplierInvoices extends DolibarrApi } $result = $db->query($sql); - if ($result) - { + if ($result) { $i = 0; $num = $db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); @@ -170,10 +170,10 @@ class SupplierInvoices extends DolibarrApi else { throw new RestException(503, 'Error when retrieve supplier invoice list : '.$db->lasterror()); } - if( ! count($obj_ret)) { + if ( ! count($obj_ret)) { throw new RestException(404, 'No supplier invoice found'); } - return $obj_ret; + return $obj_ret; } /** @@ -332,7 +332,8 @@ class SupplierInvoices extends DolibarrApi * @param Object $object Object to clean * @return array Array of cleaned object properties */ - function _cleanObjectDatas($object) { + function _cleanObjectDatas($object) + { $object = parent::_cleanObjectDatas($object); diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index d9596bf3958..ac5c825856c 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -46,8 +46,8 @@ class SupplierOrders extends DolibarrApi */ function __construct() { - global $db, $conf; - $this->db = $db; + global $db, $conf; + $this->db = $db; $this->order = new CommandeFournisseur($this->db); } @@ -68,11 +68,11 @@ class SupplierOrders extends DolibarrApi } $result = $this->order->fetch($id); - if( ! $result ) { + if ( ! $result ) { throw new RestException(404, 'Supplier order not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur',$this->order->id,'','commande')) { + if ( ! DolibarrApi::_checkAccessToResource('fournisseur',$this->order->id,'','commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -96,7 +96,8 @@ class SupplierOrders extends DolibarrApi * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') { + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') + { global $db, $conf; $obj_ret = array(); @@ -336,7 +337,8 @@ class SupplierOrders extends DolibarrApi * @param Object $object Object to clean * @return array Array of cleaned object properties */ - function _cleanObjectDatas($object) { + function _cleanObjectDatas($object) + { $object = parent::_cleanObjectDatas($object);