From bd5bffa72c21c7e2a2dcd3d0aa2aceda8afe36f8 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Mon, 16 Oct 2017 06:47:05 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/class/lettering.class.php | 14 +- .../admin/dolistore/class/dolistore.class.php | 536 ++-- htdocs/admin/mails_senderprofile_list.php | 414 +-- htdocs/collab/index.php | 500 ++-- htdocs/commande/card.php | 494 ++-- htdocs/compta/facture/card.php | 1222 ++++----- htdocs/compta/facture/fiche-rec.php | 1534 +++++------ htdocs/contrat/card.php | 2440 ++++++++-------- .../core/class/emailsenderprofile.class.php | 20 +- htdocs/core/class/html.formfile.class.php | 2442 ++++++++--------- htdocs/core/class/html.formmail.class.php | 1102 ++++---- .../class/expensereport_rule.class.php | 22 +- htdocs/fourn/commande/card.php | 1634 +++++------ htdocs/fourn/facture/card.php | 2004 +++++++------- htdocs/main.inc.php | 2436 ++++++++-------- htdocs/societe/rib.php | 236 +- htdocs/supplier_proposal/card.php | 424 +-- htdocs/websites/index.php | 2 +- scripts/emailings/mailing-send.php | 94 +- 19 files changed, 8785 insertions(+), 8785 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index f3d9359b19d..423a3e54b02 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -33,12 +33,12 @@ include_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; */ class lettering extends BookKeeping { - /** - * lettrageTiers - * - * @param int $socid Thirdparty id - * @return int <0 if KO, >0 if OK - */ + /** + * lettrageTiers + * + * @param int $socid Thirdparty id + * @return int <0 if KO, >0 if OK + */ public function lettrageTiers($socid) { $db = $this->db; @@ -121,7 +121,7 @@ class lettering extends BookKeeping /** Prise en charge des lettering complexe avec prelevment , virement - */ + */ $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.date_lettering, bu.url_id , bu.type "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) "; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 84ec9457532..07dbec4b902 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -25,119 +25,119 @@ include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class */ class Dolistore { - // params - public $start; // beginning of pagination - public $end; // end of pagination - public $per_page; // pagination: display per page - public $categorie; // the current categorie - public $search; // the search keywords + // params + public $start; // beginning of pagination + public $end; // end of pagination + public $per_page; // pagination: display per page + public $categorie; // the current categorie + public $search; // the search keywords - // setups - public $url; // the url of this page - public $shop_url; // the url of the shop - public $vat_rate; // the vat rate used in the shop (prices are provided without vat) - public $lang; // the integer representing the lang in the store - public $debug_api; // usefull if no dialog + // setups + public $url; // the url of this page + public $shop_url; // the url of the shop + public $vat_rate; // the vat rate used in the shop (prices are provided without vat) + public $lang; // the integer representing the lang in the store + public $debug_api; // usefull if no dialog - /** - * Constructor - */ - function __construct() - { - global $conf, $langs; + /** + * Constructor + */ + function __construct() + { + global $conf, $langs; - $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; - $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; - $this->vat_rate = 1.2; // 20% de TVA - $this->debug_api = false; + $this->url = DOL_URL_ROOT.'/admin/modules.php?mode=marketplace'; + $this->shop_url = 'https://www.dolistore.com/index.php?controller=product&id_product='; + $this->vat_rate = 1.2; // 20% de TVA + $this->debug_api = false; - $langtmp = explode('_', $langs->defaultlang); - $lang = $langtmp[0]; - $lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1 - if (! in_array($lang, array_keys($lang_array))) $lang = 'en'; - $this->lang = $lang_array[$lang]; - } + $langtmp = explode('_', $langs->defaultlang); + $lang = $langtmp[0]; + $lang_array = array('en'=>0, 'fr'=>1, 'es'=>2, 'it'=>3, 'de'=>4); // Into table ps_lang of Prestashop - 1 + if (! in_array($lang, array_keys($lang_array))) $lang = 'en'; + $this->lang = $lang_array[$lang]; + } - /** - * Load data from remote Dolistore market place. - * This fills ->categories - * - * @param array $options Options - * @return void - */ - function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) - { - global $conf, $langs; + /** + * Load data from remote Dolistore market place. + * This fills ->categories + * + * @param array $options Options + * @return void + */ + function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0)) + { + global $conf, $langs; - $this->start = $options['start']; - $this->end = $options['end']; - $this->per_page = $options['per_page']; - $this->categorie = $options['categorie']; - $this->search = $options['search']; + $this->start = $options['start']; + $this->end = $options['end']; + $this->per_page = $options['per_page']; + $this->categorie = $options['categorie']; + $this->search = $options['search']; - if ($this->end == 0) { - $this->end = $this->per_page; - } + if ($this->end == 0) { + $this->end = $this->per_page; + } - try { - $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); + try { + $this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api); - // Here we set the option array for the Webservice : we want products resources - $opt = array(); - $opt['resource'] = 'products'; + // Here we set the option array for the Webservice : we want products resources + $opt = array(); + $opt['resource'] = 'products'; - // make a search to limit the id returned. - if ($this->search != '') { - $opt2 = array(); - $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->products->children() as $product) { - $products[] = (int) $product['id']; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } elseif ($this->categorie != 0) { - $opt2 = array(); - $opt2['resource'] = 'categories'; - $opt2['id'] = $this->categorie; - // Call - $xml = $this->api->get($opt2); - $products = array(); - foreach ($xml->category->associations->products->children() as $product) { - $products[] = (int) $product->id; - } - $opt['filter[id]'] = '['.implode('|', $products).']'; - } - $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; - $opt['sort'] = 'id_desc'; - $opt['filter[active]'] = '[1]'; - $opt['limit'] = "$this->start,$this->end"; + // make a search to limit the id returned. + if ($this->search != '') { + $opt2 = array(); + $opt2['url'] = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/search?query='.$this->search.'&language='.$this->lang; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->products->children() as $product) { + $products[] = (int) $product['id']; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } elseif ($this->categorie != 0) { + $opt2 = array(); + $opt2['resource'] = 'categories'; + $opt2['id'] = $this->categorie; + // Call + $xml = $this->api->get($opt2); + $products = array(); + foreach ($xml->category->associations->products->children() as $product) { + $products[] = (int) $product->id; + } + $opt['filter[id]'] = '['.implode('|', $products).']'; + } + $opt['display'] = '[id,name,id_default_image,id_category_default,reference,price,condition,show_price,date_add,date_upd,description_short,description,module_version,dolibarr_min,dolibarr_max]'; + $opt['sort'] = 'id_desc'; + $opt['filter[active]'] = '[1]'; + $opt['limit'] = "$this->start,$this->end"; // $opt['filter[id]'] contais list of product id that are result of search - // Call API to get the detail - $xml = $this->api->get($opt); - $this->products = $xml->products->children(); + // Call API to get the detail + $xml = $this->api->get($opt); + $this->products = $xml->products->children(); - // Here we set the option array for the Webservice : we want categories resources - $opt = array(); - $opt['resource'] = 'categories'; - $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; - $opt['sort'] = 'id_asc'; - // Call - $xml = $this->api->get($opt); - $this->categories = $xml->categories->children(); - } catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - else if ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); - } - } + // Here we set the option array for the Webservice : we want categories resources + $opt = array(); + $opt['resource'] = 'categories'; + $opt['display'] = '[id,id_parent,nb_products_recursive,active,is_root_category,name,description]'; + $opt['sort'] = 'id_asc'; + // Call + $xml = $this->api->get($opt); + $this->categories = $xml->categories->children(); + } catch (PrestaShopWebserviceException $e) { + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + else if ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + } + } /** * Return tree of Dolistore categories. $this->categories must have been loaded before. @@ -145,199 +145,199 @@ class Dolistore * @param int $parent Id of parent category * @return string */ - function get_categories($parent = 0) - { - if (!isset($this->categories)) die('not possible'); - if ($parent != 0) { - $html = '