From 4f554ab52a5d352f69b468c3694ef1e1b8077ef7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 20 Jun 2018 12:09:47 +0200 Subject: [PATCH 01/91] clean and update code --- htdocs/comm/mailing/cibles.php | 9 ++------- htdocs/externalsite/admin/externalsite.php | 2 -- htdocs/fichinter/card.php | 1 - htdocs/fichinter/index.php | 7 ------- htdocs/fichinter/stats/index.php | 6 +++--- htdocs/fourn/commande/list.php | 2 -- htdocs/fourn/facture/list.php | 2 -- htdocs/fourn/facture/rapport.php | 4 ++-- htdocs/fourn/recap-fourn.php | 1 - 9 files changed, 7 insertions(+), 27 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ef3fa3d81a9..91d9fc1a423 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -76,8 +76,6 @@ if ($action == 'add') $module=GETPOST("module"); $result=-1; - $var=true; - foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory @@ -278,8 +276,6 @@ if ($object->fetch($id) >= 0) clearstatcache(); - $var = true; - foreach ($modulesdir as $dir) { $modulenames=array(); @@ -332,16 +328,15 @@ if ($object->fetch($id) >= 0) // Si le module mailing est qualifie if ($qualified) { - $var = !$var; if ($allowaddtarget) { - print '
'; + print ''; print ''; } else { - print '
'; + print '
'; } print '
'; diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index d76c23e11b0..6e585921ddb 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -92,8 +92,6 @@ print "".$langs->trans("Value").""; print "".$langs->trans("Examples").""; print ""; -$var=true; - print ''; print ''.$langs->trans("Label").""; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b0d085838a8..15b75495c38 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1403,7 +1403,6 @@ else if ($id > 0 || ! empty($ref)) print ' '; print "\n"; } - $var=true; while ($i < $num) { $objp = $db->fetch_object($resql); diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 474c6774f26..c4241d9e152 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -143,13 +143,11 @@ if ($resql) print ''; } - $var=true; $bool=false; foreach ($listofstatus as $status) { if (! $conf->use_javascript_ajax) { - print ''; print ''.$fichinterstatic->LibStatut($status,$bool,0).''; print ''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; @@ -198,10 +196,8 @@ if (! empty($conf->ficheinter->enabled)) if ($num) { $i = 0; - $var = true; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; print ''; @@ -248,7 +244,6 @@ if ($resql) if ($num) { $i = 0; - $var = true; while ($i < $num) { @@ -319,10 +314,8 @@ if (! empty($conf->ficheinter->enabled)) if ($num) { $i = 0; - $var = true; while ($i < $num) { - $obj = $db->fetch_object($resql); print ''; print ''; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index b00b1391003..48890ca0897 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -285,7 +285,7 @@ print '%'; print ''; $oldyear=0; -$var=true; + foreach ($data as $val) { $year = $val['year']; @@ -293,7 +293,7 @@ foreach ($data as $val) { // If we have empty year $oldyear--; - print ''; + print ''; print '0?'&userid='.$userid:'').'">'.$oldyear.''; print '0'; @@ -306,7 +306,7 @@ foreach ($data as $val) } - print ''; + print ''; print '0?'&userid='.$userid:'').'">'.$year.''; print ''.$val['nb'].''; print ''.round($val['nb_diff']).''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index f0e9793f9a1..0a6dafb70e7 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -935,13 +935,11 @@ if ($resql) $projectstatic=new Project($db); $i=0; - $var=true; $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; $objectstatic->ref_supplier = $obj->ref_supplier; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 8c77feb2187..8402a82f4fe 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -822,8 +822,6 @@ if ($resql) if ($num > 0) { $i=0; - - $var=true; $totalarray=array(); while ($i < min($num,$limit)) { diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index ee7f5f99769..495bc7a4645 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -146,7 +146,7 @@ if ($year) print ''.$langs->trans("Size").''; print ''.$langs->trans("Date").''; print ''; - $var=true; + if (is_resource($handle)) { while (($file = readdir($handle))!==false) @@ -156,7 +156,7 @@ if ($year) $tfile = $dir . '/'.$year.'/'.$file; $relativepath = $year.'/'.$file; - print "".''.img_pdf().' '.$file.''; + print ''.''.img_pdf().' '.$file.''; print ''.dol_print_size(dol_filesize($tfile)).''; print ''.dol_print_date(dol_filemtime($tfile),"dayhour").''; } diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index fc5821b96f8..f85d1831f37 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -82,7 +82,6 @@ if ($socid > 0) $resql=$db->query($sql); if ($resql) { - $var=true; $num = $db->num_rows($resql); print ''; From e913d854d0e4cac84edfcf4ce694eb47f35d9c8f Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Mon, 16 Jul 2018 11:00:39 +0200 Subject: [PATCH 02/91] Fix PR --- htdocs/comm/mailing/cibles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 91d9fc1a423..d3a627a1695 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -331,12 +331,12 @@ if ($object->fetch($id) >= 0) if ($allowaddtarget) { - print ''; + print ''; print ''; } else { - print '
'; + print '
'; } print '
'; From 39f5641fede00140e191eb7b3922b872251fe200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 17:33:36 +0200 Subject: [PATCH 03/91] trim trailing --- dev/setup/codesniffer/ruleset.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 6619cf83754..5f8e4de07f9 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -171,7 +171,12 @@ - + + + + + + From c991a4d204444b125a7c7a4fd853480ddba49dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 18:05:20 +0200 Subject: [PATCH 04/91] trim trailing --- dev/setup/codesniffer/ruleset.xml | 10 +++++++++- .../bookkeeping/thirdparty_lettrage.php | 2 +- .../thirdparty_lettrage_supplier.php | 2 +- htdocs/commande/card.php | 4 ++-- htdocs/compta/bank/class/bankcateg.class.php | 18 ++++++++--------- htdocs/hrm/class/establishment.class.php | 8 ++++---- htdocs/install/default.css | 20 +++++++++---------- htdocs/printing/index.php | 8 ++++---- htdocs/public/demo/demo.css | 10 +++++----- htdocs/public/notice.php | 8 ++++---- 10 files changed, 49 insertions(+), 41 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 5f8e4de07f9..29e1f5775e7 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -177,7 +177,15 @@ - + + 0 + + + 0 + + + 0 + diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index c4084b600eb..be335107839 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -82,7 +82,7 @@ $socid = GETPOST("socid", 'int'); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); -if ($result < 0) +if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 61452230902..905361b4c8e 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -86,7 +86,7 @@ $socid = GETPOST("socid", 'int'); $object = new Societe($db); $object->id = $socid; $result = $object->fetch($socid); -if ($result<0) +if ($result<0) { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0c3e4328505..3bdab169f6d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -700,8 +700,8 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else + } + else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 176fdb626a5..44e4f72c496 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -31,10 +31,10 @@ class BankCateg // extends CommonObject //public $element='bank_categ'; //!< Id that identify managed objects //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored public $picto='generic'; - + public $id; public $label; - + /** * Constructor @@ -205,7 +205,7 @@ class BankCateg // extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account"; $sql.= " WHERE fk_categorie = ".$this->id; - + $resql = $this->db->query($sql); if (!$resql) { @@ -213,13 +213,13 @@ class BankCateg // extends CommonObject $this->errors[] = "Error ".$this->db->lasterror(); } } - + // Delete link between tag and bank lines if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class"; $sql.= " WHERE fk_categ = ".$this->id; - + $resql = $this->db->query($sql); if (!$resql) { @@ -227,21 +227,21 @@ class BankCateg // extends CommonObject $this->errors[] = "Error ".$this->db->lasterror(); } } - + // Delete bank categ if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ"; $sql .= " WHERE rowid=".$this->id; - + $resql = $this->db->query($sql); - if (!$resql) + if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } - + // Commit or rollback if ($error) { foreach ($this->errors as $errmsg) { diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 8a99788d040..b4a03ef0396 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -34,7 +34,7 @@ class Establishment extends CommonObject public $fk_element = 'fk_establishment'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='building'; - + public $id; public $ref; public $rowid; @@ -208,7 +208,7 @@ class Establishment extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_code; - $this->country = $obj->country; + $this->country = $obj->country; return 1; } @@ -386,7 +386,7 @@ class Establishment extends CommonObject return ''; } - + /** * Initialise object with example values * Id must be 0 if object instance is a specimen @@ -397,5 +397,5 @@ class Establishment extends CommonObject { $this->id = 0; $this->ref = 'DEAAA'; - } + } } diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 6ea6d451e92..2e005a30b21 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -1,5 +1,5 @@ -/* Copyright (C) 2004 Rodolphe Quiedeville - * Copyright (C) 2009-2017 Laurent Destailleur +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2009-2017 Laurent Destailleur * * 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 @@ -89,16 +89,16 @@ div.soustitre { body { margin: 15px 4px 4px; } - - input, input[type=text], input[type=password], select, textarea { - min-width: 20px; + + input, input[type=text], input[type=password], select, textarea { + min-width: 20px; min-height: 1.4em; line-height: 1.4em; padding: .4em .1em; border: 1px solid #BBB; /* max-width: inherit; why this ? */ } - + .hideonsmartphone { display: none; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } @@ -120,13 +120,13 @@ div.soustitre { padding-left: 0; padding-right: 0; } - + table.main-inside { padding-left: 1px; padding-right: 1px; line-height: 20px; } - + span.titre { font-size: 90%; font-weight: normal; @@ -146,7 +146,7 @@ input:disabled padding: 0 0 0 0; margin: 0 0 0 0; color: #AAA !important; - cursor: not-allowed !important; + cursor: not-allowed !important; } input[type=submit] { @@ -212,7 +212,7 @@ table.listofchoices, table.listofchoices tr, table.listofchoices td { } .blinkwait { font-weight: bold; - text-decoration:blink !important; + text-decoration:blink !important; } .installchoices table tr td { diff --git a/htdocs/printing/index.php b/htdocs/printing/index.php index 384d0834cc0..020f16fd3ec 100644 --- a/htdocs/printing/index.php +++ b/htdocs/printing/index.php @@ -49,19 +49,19 @@ print $langs->trans("DirectPrintingJobsDesc").'

'; // List Jobs from printing modules $object = new PrintingDriver($db); $result = $object->listDrivers($db, 10); -foreach ($result as $driver) +foreach ($result as $driver) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; $classname = 'printing_'.$driver; $langs->load($driver); $printer = new $classname($db); - if ($conf->global->{$printer->active}) + if ($conf->global->{$printer->active}) { //$printer->list_jobs('commande'); $result = $printer->list_jobs(); print $printer->resprint; - - if ($result > 0) + + if ($result > 0) { setEventMessages($printer->error, $printer->errors, 'errors'); } diff --git a/htdocs/public/demo/demo.css b/htdocs/public/demo/demo.css index c4624f2d943..d137b7be456 100644 --- a/htdocs/public/demo/demo.css +++ b/htdocs/public/demo/demo.css @@ -16,19 +16,19 @@ a:hover { border: 1px solid #bbb; border-radius: 8px; -moz-border-radius: 8px; - box-shadow: 2px 2px 8px #BBB; + box-shadow: 2px 2px 8px #BBB; } .CTable { padding: 6px; font-weight: normal; color: #444444 !important; - + margin: 8px 0px 8px 2px; - + /*border: 1px solid #bbb; border-radius: 8px; -moz-border-radius: 8px;*/ - + background: -webkit-linear-gradient(bottom, rgb(255,255,255) 85%, rgb(255,255,255) 100%); } .csscolumns { @@ -129,4 +129,4 @@ img.demothumb { margin-left: 0px; margin-right: 0px; } -} \ No newline at end of file +} diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index 623baa2020a..3b25349324c 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -19,13 +19,13 @@ * \file htdocs/public/notice.php * \brief Dolibarr page to show a notice. * Default notice is a message to say network connection is off. - * You can also call this page with URL: + * You can also call this page with URL: * /public/notice.php?lang=xx_XX&transkey=translation_key (key must be inside file main.lang, error.lang or other.lang) * /public/notice.php?transphrase=url_encoded_sentence_to_show */ define('NOCSRFCHECK',1); -define('NOLOGIN',1); +define('NOLOGIN',1); require '../main.inc.php'; @@ -43,8 +43,8 @@ else { $langs->load("error"); $langs->load("other"); - - if (GETPOST('transphrase')) print GETPOST('transphrase'); + + if (GETPOST('transphrase')) print GETPOST('transphrase'); if (GETPOST('transkey')) print $langs->trans(GETPOST('transkey')); } From 8312d95174ad22d21e524b4a3412a5475042ddab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 18:22:16 +0200 Subject: [PATCH 05/91] trim trailing --- htdocs/admin/bank.php | 2 +- htdocs/admin/dolistore/css/dolistore.css | 12 +-- htdocs/admin/events.php | 2 +- htdocs/admin/modules.php | 4 +- htdocs/admin/receiptprinter.php | 38 +++---- htdocs/admin/sms.php | 16 +-- htdocs/admin/stock.php | 4 +- htdocs/admin/system/modules.php | 6 +- htdocs/admin/ticket.php | 6 +- htdocs/cashdesk/css/style.css | 2 +- htdocs/core/ajax/check_notifications.php | 30 +++--- htdocs/core/class/html.formcontract.class.php | 16 +-- htdocs/fichinter/card-rec.php | 86 ++++++++-------- htdocs/fourn/js/lib_dispatch.js | 28 +++--- htdocs/holiday/class/holiday.class.php | 4 +- htdocs/opensurvey/css/style.css | 98 +++++++++---------- htdocs/support/default.css | 4 +- 17 files changed, 179 insertions(+), 179 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index a4e9e4bb210..5c9be79e848 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -420,7 +420,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print ''; print ''; } -else +else { print '' . "\n"; print '' . img_picto($langs->trans("Disabled"), diff --git a/htdocs/admin/dolistore/css/dolistore.css b/htdocs/admin/dolistore/css/dolistore.css index bba808a21a0..fb4dc2d5bb1 100644 --- a/htdocs/admin/dolistore/css/dolistore.css +++ b/htdocs/admin/dolistore/css/dolistore.css @@ -6,10 +6,10 @@ div.divsearchfield { } .margeCoteGauche,.margeCote{ - padding-right: 20px!important; + padding-right: 20px!important; } .margeCote,.margeCoteDroite{ - padding-left: 20px!important; + padding-left: 20px!important; } .nomargesupinf{ margin-top: 0; @@ -26,13 +26,13 @@ div.divsearchfield { width: 100%; } .tree{ - margin: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; padding:0px; list-style: none; line-height: 2em; font-family: Arial; } .tree li{ font-size: 16px; - position: relative;list-style: none; + position: relative;list-style: none; } .tree li:before{ position: absolute; @@ -65,7 +65,7 @@ div.divsearchfield { .tree li.root:after{ display: none; } -.tree li:last-child:after{ +.tree li:last-child:after{ display: none } .blockUI { @@ -159,7 +159,7 @@ textarea.row4{ .reviewList { max-height: 150px; - overflow-y: scroll; + overflow-y: scroll; } .reviewRow{ diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 1d1ec548853..d249def1401 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -94,7 +94,7 @@ print "\n"; foreach ($eventstolog as $key => $arr) { if ($arr['id']) - { + { print ''; print ''.$arr['id'].''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 437a43bd05b..b647dfdbfb0 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI - * + * * 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 @@ -672,7 +672,7 @@ if ($mode == 'common') print ''; print $versiontrans; if(!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)){ - require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; if (!empty($objMod->url_last_version)) { $newversion = getURLContent($objMod->url_last_version); if(isset($newversion['content'])){ diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 4465017bdc6..209fd9b3583 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -243,14 +243,14 @@ if ($mode == 'config' && $user->admin) print "\n"; $ret = $printer->listprinters(); $nbofprinters = count($printer->listprinters); - + if ($ret > 0) { setEventMessages($printer->error, $printer->errors, 'errors'); } else { - for ($line=0; $line < $nbofprinters; $line++) + for ($line=0; $line < $nbofprinters; $line++) { print ''; - if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) + if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) { print ''; print ''; @@ -285,7 +285,7 @@ if ($mode == 'config' && $user->admin) } } - if ($action!='editprinter') + if ($action!='editprinter') { if ($nbofprinters > 0) { @@ -299,7 +299,7 @@ if ($mode == 'config' && $user->admin) print ''; print "\n"; } - + print ''; print ''; $ret = $printer->selectTypePrinter(); @@ -315,7 +315,7 @@ if ($mode == 'config' && $user->admin) print ''; dol_fiche_end(); - + if ($action!='editprinter') { print '
'; } else { @@ -324,9 +324,9 @@ if ($mode == 'config' && $user->admin) print ''; print '

'; - + dol_fiche_head(); - + print $langs->trans("ReceiptPrinterTypeDesc")."

\n"; print ''."\n"; print ''; @@ -338,7 +338,7 @@ if ($mode == 'config' && $user->admin) dol_fiche_end(); print '

'; - + dol_fiche_head(); print $langs->trans("ReceiptPrinterProfileDesc")."

\n"; print '
'.$langs->trans("CONNECTOR_DUMMY").':'.$langs->trans("CONNECTOR_DUMMY_HELP").'
'."\n"; @@ -378,7 +378,7 @@ if ($mode == 'template' && $user->admin) setEventMessages($printer->error, $printer->errors, 'errors'); } else { $max = count($printer->listprinterstemplates); - for ($line=0; $line < $max; $line++) + for ($line=0; $line < $max; $line++) { print ''; if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) { @@ -423,7 +423,7 @@ if ($mode == 'template' && $user->admin) print ''; print "\n"; $max = count($printer->tags); - for ($tag=0; $tag < $max; $tag++) + for ($tag=0; $tag < $max; $tag++) { print ''; print ''; @@ -436,14 +436,14 @@ if ($mode == 'template' && $user->admin) } // to remove after test -$object=new stdClass(); -$object->date_time = '2015-11-02 22:30:25'; -$object->id = 1234; -$object->customer_firstname = 'John'; -$object->customer_lastname = 'Deuf'; -$object->vendor_firstname = 'Jim'; -$object->vendor_lastname = 'Big'; -$object->barcode = '3700123862396'; +// $object=new stdClass(); +// $object->date_time = '2015-11-02 22:30:25'; +// $object->id = 1234; +// $object->customer_firstname = 'John'; +// $object->customer_lastname = 'Deuf'; +// $object->vendor_firstname = 'Jim'; +// $object->vendor_lastname = 'Big'; +// $object->barcode = '3700123862396'; //$printer->sendToPrinter($object, 1, 16); //setEventMessages($printer->error, $printer->errors, 'errors'); diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index db1cb20b5e3..64bb04af945 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -169,21 +169,21 @@ if ($action == 'edit') print '
'.$langs->trans("Description").'
<'.$printer->tags[$tag].'>'.$langs->trans(strtoupper($printer->tags[$tag])).'
'; print ''; - // Disable + // Disable print ''; - // Separator + // Separator print ''; - // Method + // Method print ''; - // From + // From print ''; print ''; @@ -213,20 +213,20 @@ else print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''; print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1); print '
 
'.$langs->trans("MAIN_SMS_SENDMODE").''; if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1); else print ''.$langs->trans("None").''; print '
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'
'; print ''; - // Disable + // Disable print ''; - // Separator + // Separator print ''; - // Method + // Method print ''; - // From + // From print ''; print '\n"; } -if($conf->order->enabled) +if($conf->order->enabled) { print ''; print ''; @@ -388,7 +388,7 @@ if($conf->order->enabled) print "\n"; } -if($conf->expedition->enabled) +if($conf->expedition->enabled) { print ''; print ''; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 4a6967089e2..5027066a37b 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -79,17 +79,17 @@ foreach($modulesdir as $dir) { try { $objMod = new $modName($db); - + $modules[$objMod->numero]=$objMod; $modules_names[$objMod->numero]=$objMod->name; $modules_files[$objMod->numero]=$file; $modules_fullpath[$file]=$dir.$file; $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; - } + } catch(Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); - } + } } else { diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 95af411b813..c9d650f781d 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -54,11 +54,11 @@ if ($action == 'updateMask') { $error++; } - if (!$error) + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else + } + else { setEventMessages($langs->trans("Error"), null, 'errors'); } diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index d4149619aae..dc579711aa3 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -52,7 +52,7 @@ p { } .logopos { padding-top: 20px; - max-height: 40px; + max-height: 40px; } /* ------------------- Header ------------------- */ diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 6984bbff5b4..09252bc0edc 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -44,37 +44,37 @@ $eventfound = array(); //dol_syslog('time='.$time.' $_SESSION[auto_ck_events_not_before]='.$_SESSION['auto_check_events_not_before']); // TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when several tabs are opened. -if ($time >= $_SESSION['auto_check_events_not_before']) +if ($time >= $_SESSION['auto_check_events_not_before']) { $time_update = (int) $conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY; // Always defined - if (! empty($_SESSION['auto_check_events_not_before'])) + if (! empty($_SESSION['auto_check_events_not_before'])) { // We start scan from the not before so if two tabs were opend at differents seconds and we close one (so the js timer), - // then we are not losing periods + // then we are not losing periods $starttime = $_SESSION['auto_check_events_not_before']; // Protection to avoid too long sessions - if ($starttime < ($time - (int) $conf->global->MAIN_SESSION_TIMEOUT)) + if ($starttime < ($time - (int) $conf->global->MAIN_SESSION_TIMEOUT)) { dol_syslog("We ask to check browser notification on a too large period. We fix this with current date."); $starttime = $time; } } - else + else { $starttime = $time; } - + $_SESSION['auto_check_events_not_before'] = $time + $time_update; - - // Force save of session change we did. + + // Force save of session change we did. // WARNING: Any change in sessions after that will not be saved ! session_write_close(); - + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - - + + dol_syslog('NEW $_SESSION[auto_check_events_not_before]='.$_SESSION['auto_check_events_not_before']); - + $sql = 'SELECT id'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'actioncomm a, ' . MAIN_DB_PREFIX . 'actioncomm_resources ar'; $sql .= ' WHERE a.id = ar.fk_actioncomm'; @@ -91,11 +91,11 @@ if ($time >= $_SESSION['auto_check_events_not_before']) $actionmod = new ActionComm($db); - while ($obj = $db->fetch_object($resql)) + while ($obj = $db->fetch_object($resql)) { $langs->load("agenda"); $langs->load("commercial"); - + $actionmod->fetch($obj->id); // Message must be formated and translated to be used with javascript directly @@ -105,7 +105,7 @@ if ($time >= $_SESSION['auto_check_events_not_before']) $event['tipo'] = $langs->transnoentities('Action' . $actionmod->code); $event['titulo'] = $actionmod->label; $event['location'] = $langs->transnoentities('Location').': '.$actionmod->location; - + $eventfound[] = $event; } } diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index a3a3696e5f4..7d107298c32 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -67,14 +67,14 @@ class FormContract if ($socid > 0) { // CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. - if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) + if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; else if ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') { $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; $sql.= " OR c.fk_soc IS NULL)"; } - } + } if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; $sql.= " ORDER BY c.ref "; @@ -140,14 +140,14 @@ class FormContract } print ''; $db->free($resql); - + if (!empty($conf->use_javascript_ajax)) { // Make select dynamic include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; print ajax_combobox($htmlname); } - + return $num; } else @@ -156,7 +156,7 @@ class FormContract return -1; } } - + /** * Show a form to select a contract * @@ -171,7 +171,7 @@ class FormContract function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) { global $langs; - + print "\n"; print ''; print ''; @@ -179,6 +179,6 @@ class FormContract $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty); print ''; print ''; - } - + } + } diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 8b258ebbf6e..55236c86d44 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -101,7 +101,7 @@ if ($action == 'add') { $action = "create"; $error++; } - + if (! GETPOST('socid')) { setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Customer")), null, 'errors'); $action = "create"; @@ -144,7 +144,7 @@ if ($action == 'add') { $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); $object->date_when = $date_next_execution; - + if ($object->create($user) > 0) { $id = $object->id; $action = ''; @@ -155,10 +155,10 @@ if ($action == 'add') { } } elseif ($action == 'createfrommodel') { $newinter = new fichinter($db); - + // on récupère les enregistrements $object->fetch($id); - + // on transfert les données de l'un vers l'autre if ($object->socid > 0) { @@ -167,14 +167,14 @@ if ($action == 'add') { $newinter->fk_contrat=$object->fk_contrat; } else $newinter->socid=GETPOST("socid"); - + $newinter->entity=$object->entity; $newinter->duree=$object->duree; - + $newinter->description=$object->description; $newinter->note_private=$object->note_private; $newinter->note_public=$object->note_public; - + // on créer un nouvelle intervention $extrafields = new ExtraFields($db); $extralabels = $extrafields->fetch_name_optionals_label($newinter->table_element); @@ -182,7 +182,7 @@ if ($action == 'add') { $newinter->array_options = $array_options; $newfichinterid = $newinter->create($user); - + if ($newfichinterid > 0) { // on ajoute les lignes de détail ensuite foreach ($object->lines as $ficheinterligne) @@ -205,14 +205,14 @@ if ($action == 'add') { header('Location: '.$_SERVER["PHP_SELF"]); exit; } elseif ($action == 'setfrequency' && $user->rights->ficheinter->creer) { - // Set frequency and unit frequency + // Set frequency and unit frequency $object->fetch($id); $object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha')); } elseif ($action == 'setdate_when' && $user->rights->ficheinter->creer) { // Set next date of execution $object->fetch($id); $date = dol_mktime( - GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, + GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear') ); if (!empty($date)) $object->setNextDate($date); @@ -239,7 +239,7 @@ if (! empty($conf->projet->enabled)) $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime( - 23, 59, 59, + 23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'] ); // Today is last second of current day @@ -265,7 +265,7 @@ if ($action == 'create') { $rowspan=4; if (! empty($conf->projet->enabled) && $object->fk_project > 0) $rowspan++; if (! empty($conf->contrat->enabled) && $object->fk_contrat > 0) $rowspan++; - + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).'
 
'.$langs->trans("MAIN_SMS_SENDMODE").''; $text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE]; if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning(); print $text; print '
'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_SMS_FROM; if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && ! isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone")); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e1098ef262d..74870b69fc3 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -373,7 +373,7 @@ if($conf->invoice->enabled) print "
'.$langs->trans("StockMustBeEnoughForOrder").'
'.$langs->trans("StockMustBeEnoughForShipment").'
'; $object->fetch_thirdparty(); @@ -297,12 +297,12 @@ if ($action == 'create') { // Duration print ''; print ''; print ''; } - + // Project if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); @@ -345,7 +345,7 @@ if ($action == 'create') { print "
'.$langs->trans("TotalDuration").''.convertSecondToTime( - $object->duration, 'all', + $object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY ).'
"; print " "; print $form->selectarray( - 'unit_frequency', + 'unit_frequency', array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), (GETPOST('unit_frequency')?GETPOST('unit_frequency'):'m') ); @@ -424,7 +424,7 @@ if ($action == 'create') { } $db->free($result); - } else + } else print $db->error(); print "
"; @@ -466,7 +466,7 @@ if ($action == 'create') { } else { /* * View mode - * + * */ if ($id > 0) { if ($object->fetch($id) > 0) { @@ -497,7 +497,7 @@ if ($action == 'create') { $morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).'
: '; } if ($action == 'classify') { - + $morehtmlref.='
'; $morehtmlref.=''; $morehtmlref.=''; @@ -512,7 +512,7 @@ if ($action == 'create') { $object->socid, $object->fk_project, 'none', 0, 0, 0, 1 ); - } + } } else { if (! empty($object->fk_project)) { $proj = new Project($db); @@ -567,7 +567,7 @@ if ($action == 'create') { if ($action == 'contrat') { $formcontract= new Formcontract($db); $formcontract->formSelectContract( - $_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, + $_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1 ); } else { @@ -594,9 +594,9 @@ if ($action == 'create') { $title = $langs->trans("Recurrence"); print load_fiche_titre($title, '', 'calendar'); - + print ''; - + // if "frequency" is empty or = 0, the reccurence is disabled print ''; - + // Date when print ''; print ''; - + // Max period / Rest period print ''; print ''; - + print '
'; print ''; print ''; print '
'; @@ -616,26 +616,26 @@ if ($action == 'create') { print '
'; print " "; print $form->selectarray( - 'unit_frequency', - array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), + 'unit_frequency', + array('d'=>$langs->trans('Day'), 'm'=>$langs->trans('Month'), 'y'=>$langs->trans('Year')), ($object->unit_frequency?$object->unit_frequency:'m') ); print '
'; } else { - if ($object->frequency > 0) + if ($object->frequency > 0) print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); - else + else print $langs->trans("NotARecurringInterventionalTemplate"); } print '
'; if ( $user->rights->ficheinter->creer && ($action == 'date_when' || $object->frequency > 0)) { print $form->editfieldkey( - $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, + $langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day' ); } else { @@ -650,12 +650,12 @@ if ($action == 'create') { } print '
'; if ($user->rights->ficheinter->creer && ($action == 'nb_gen_max' || $object->frequency > 0)) { print $form->editfieldkey( - $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, + $langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer ); } else @@ -673,29 +673,29 @@ if ($action == 'create') { print '
'; - + // Frequencry/Recurring section if ($object->frequency > 0) { print '
'; if (empty($conf->cron->enabled)) { $txtinfoadmin=$langs->trans( - "EnableAndSetupModuleCron", + "EnableAndSetupModuleCron", $langs->transnoentitiesnoconv("Module2300Name") ); print info_admin($txtinfoadmin); } print '
'; print ''; - + // Nb of generation already done print ''; print ''; print ''; - + // Date last print ''; $texte.= ''; $texte.= ''; - + // Parametrage du prefix des avoirs $texte.= ''; $texte.= ''; @@ -135,7 +135,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Get Mask value $mask = ''; - if (is_object($facture) && $facture->type == 1) + if (is_object($facture) && $facture->type == 1) { $mask=$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT; if (! $mask) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 551b9ded2cb..e542c564fd6 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -52,7 +52,7 @@ class pdf_soleil extends ModelePDFFicheinter * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -62,8 +62,8 @@ class pdf_soleil extends ModelePDFFicheinter * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -74,37 +74,37 @@ class pdf_soleil extends ModelePDFFicheinter * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -169,7 +169,7 @@ class pdf_soleil extends ModelePDFFicheinter 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'; - + // Translations $outputlangs->loadLangs(array("main", "interventions", "dict", "companies")); @@ -552,7 +552,7 @@ class pdf_soleil extends ModelePDFFicheinter { global $conf,$langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "interventions")); @@ -732,4 +732,3 @@ class pdf_soleil extends ModelePDFFicheinter } } - diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index a6473eaeb8e..f6d94e08e97 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -629,8 +629,8 @@ class ImportCsv extends ModeleImports } } else { // We have a last INSERT ID. Check if we have a row referencing this foreign key. - // This is required when updating table with some extrafields. When inserting a record in parent table, we can make - // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record + // This is required when updating table with some extrafields. When inserting a record in parent table, we can make + // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record // may already exists. So we rescan the extrafield table to be know if record exists or not for the rowid. $sqlSelect = 'SELECT rowid FROM '.$tablename; @@ -752,5 +752,3 @@ function cleansep($value) { return str_replace(array(',',';'),'/',$value); }; - - diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 7f222f523ca..545fb8d4466 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -653,8 +653,8 @@ class ImportXlsx extends ModeleImports } } else { // We have a last INSERT ID. Check if we have a row referencing this foreign key. - // This is required when updating table with some extrafields. When inserting a record in parent table, we can make - // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record + // This is required when updating table with some extrafields. When inserting a record in parent table, we can make + // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record // may already exists. So we rescan the extrafield table to be know if record exists or not for the rowid. $sqlSelect = 'SELECT rowid FROM '.$tablename; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index f3329fa9b18..79cb4c4961c 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Class to build Delivery Order documents with typhon model + * Class to build Delivery Order documents with typhon model */ class pdf_typhon extends ModelePDFDeliveryOrder { @@ -43,69 +43,69 @@ class pdf_typhon extends ModelePDFDeliveryOrder * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string */ public $version = 'dolibarr'; - + /** * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -120,7 +120,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "bills", "sendings", "companies")); @@ -192,7 +192,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder 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'; - + // Translations $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings", "deliveries")); @@ -953,4 +953,3 @@ class pdf_typhon extends ModelePDFDeliveryOrder } } - diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index 548510f81a0..e60e18979b7 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -32,9 +32,9 @@ class mailing_example extends MailingTargets var $desc='Put here a description'; // CHANGE THIS: Set to 1 if selector is available for admin users only var $require_admin=0; - // CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector + // CHANGE THIS: Add a tooltip language key to add a tooltip help icon after the email target selector var $tooltip='MyTooltipLangKey'; - + var $require_module=array(); var $picto=''; var $db; @@ -144,4 +144,3 @@ class mailing_example extends MailingTargets } } - diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 5824f456365..cf007e67333 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -118,7 +118,7 @@ class mailing_pomme extends MailingTargets $s.=''; $s.=''; $s.=''; - + $s.=' '; $s.=$langs->trans("Employee").': '; $s.=''; - + return $s; } @@ -156,7 +156,7 @@ class mailing_pomme extends MailingTargets if ($filtersarray) { dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING); } - + global $conf, $langs; $langs->load("companies"); @@ -169,10 +169,10 @@ class mailing_pomme extends MailingTargets $sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql.= " AND u.entity IN (0,".$conf->entity.")"; $sql.= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; - if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql.= " AND u.statut=1"; - if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND u.statut=0"; - if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql.= " AND u.employee=1"; - if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql.= " AND u.employee=0"; + if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql.= " AND u.statut=1"; + if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND u.statut=0"; + if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql.= " AND u.employee=1"; + if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql.= " AND u.employee=0"; $sql.= " ORDER BY u.email"; // Stocke destinataires dans cibles @@ -222,4 +222,3 @@ class mailing_pomme extends MailingTargets } } - diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index e527c8faaca..0347a94de35 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -50,7 +50,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator 'fontsize' => 8, 'stretchtext' => 4 ); - + // set style for 2d barcode private $_style2d = array( 'border' => false, @@ -61,24 +61,24 @@ class pdf_tcpdflabel extends CommonStickerGenerator 'module_width' => 1, // width of a single module in points 'module_height' => 1 // height of a single module in points ); - + private $_align2d = 'N'; - + private $_xres = 0.4; - + /** * write barcode to pdf - * + * * @param PDF $pdf PDF reference * @param string $code code to print * @param string $encoding type of barcode * @param boolean $is2d true if 2d barcode - * @param int $x x position in user units + * @param int $x x position in user units * @param int $y y position in user units * @param int $w width in user units * @param int $h height in user units - */ - private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h) + */ + private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h) { if ($is2d) { $pdf->write2DBarcode($code, $encoding, $x, $y, $w, $h, $this->_style2d, $this->_align2d); @@ -86,7 +86,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->write1DBarcode($code, $encoding, $x, $y, $w, $h, $this->_xres, $this->_style1d); } } - + /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * @@ -95,10 +95,10 @@ class pdf_tcpdflabel 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) { global $mysoc,$conf; - + $textleft = $param['textleft']; $header = $param['textheader']; $footer = $param['textfooter']; @@ -106,8 +106,8 @@ class pdf_tcpdflabel extends CommonStickerGenerator $code = $param['code']; $encoding = $param['encoding']; $is2d = $param['is2d']; - - + + // We are in a new page, then we must add a page if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) { @@ -132,7 +132,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator } } - $xleft = 2; + $xleft = 2; $ytop = 2; // Top @@ -154,7 +154,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $heighttouse = $maxheighttouse; $logoHeight = $heighttouse; $logoWidth = $heighttouse; - + //var_dump($this->_Width.'x'.$this->_Height.' with border and scale '.$imgscale.' => max '.$maxwidthtouse.'x'.$maxheighttouse.' => We use '.$widthtouse.'x'.$heighttouse);exit; // Center @@ -162,7 +162,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { // Output left area if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, 0, $logoHeight); - else if ($code && !empty($encoding)) + else if ($code && !empty($encoding)) { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); } @@ -177,7 +177,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text { if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, 0); - else if ($code && !empty($encoding)) + else if ($code && !empty($encoding)) { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse); } @@ -187,7 +187,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator else if (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text { if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, 0); - else if ($code && !empty($encoding)) + else if ($code && !empty($encoding)) { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse); } @@ -203,7 +203,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator } else { $pdf->SetXY($_PosX+$xleft+$logoWidth+1, $_PosY+$ytop); $pdf->MultiCell($widthtouse-$logoWidth1-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R'); - } + } } else if ($textright == '%LOGO%') // right part logo left part text/barcode { @@ -214,7 +214,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator } else { $pdf->SetXY($_PosX+$xleft, $_PosY+$ytop); $pdf->MultiCell($widthtouse-$logoWidth-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L'); - } + } } else // text on halft left and text on half right { @@ -228,7 +228,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator { // Output right area if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, 0, $logoHeight); - else if ($code && !empty($encoding)) + else if ($code && !empty($encoding)) { $this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse); } @@ -295,7 +295,7 @@ class pdf_tcpdflabel 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")); diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 229aec99beb..44683111e5a 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -42,69 +42,69 @@ class pdf_baleine extends ModelePDFProjects * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string */ public $version = 'dolibarr'; - + /** * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -119,7 +119,7 @@ class pdf_baleine extends ModelePDFProjects function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "projects", "companies")); @@ -179,7 +179,7 @@ class pdf_baleine extends ModelePDFProjects 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", "projects")); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index b487c211376..330aefd5c67 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -64,7 +64,7 @@ class pdf_beluga extends ModelePDFProjects function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "projects", "companies")); @@ -126,7 +126,7 @@ class pdf_beluga extends ModelePDFProjects 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", "projects")); @@ -253,7 +253,7 @@ class pdf_beluga extends ModelePDFProjects $iniY = $tab_top + $heightoftitleline + 1; $curY = $tab_top + $heightoftitleline + 1; $nexY = $tab_top + $heightoftitleline + 1; - + $listofreferent=array( 'propal'=>array( 'name'=>"Proposals", @@ -368,8 +368,8 @@ class pdf_beluga extends ModelePDFProjects //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); - - if ($key == 'agenda') + + if ($key == 'agenda') { // var_dump($elementarray); } @@ -378,11 +378,11 @@ class pdf_beluga extends ModelePDFProjects if ($num >= 0) { $nexY = $pdf->GetY() + 5; - + $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0,0,0); - + $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); @@ -418,7 +418,7 @@ class pdf_beluga extends ModelePDFProjects $num = count($elementarray); // Loop on each lines - for ($i = 0; $i < $num; $i ++) + for ($i = 0; $i < $num; $i ++) { $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage @@ -496,10 +496,10 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage + $heightoftitleline + 1; - + // Label $pdf->SetXY($this->posxref, $curY); $posybefore=$pdf->GetY(); @@ -557,7 +557,7 @@ class pdf_beluga extends ModelePDFProjects { $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L'); } - + // Amount without tax if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); @@ -610,7 +610,7 @@ class pdf_beluga extends ModelePDFProjects $curY = $nexY; } } - + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages @@ -775,7 +775,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetXY($posx,$posy); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R'); } - + $pdf->SetTextColor(0,0,60); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 256d42c61c2..1b3c72db177 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -44,79 +44,79 @@ class pdf_azur extends ModelePDFPropales * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string Save the name of generated file as the main doc when generating a doc with this template */ public $update_main_doc_field; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ public $phpmin = array(5, 4); - + /** * Dolibarr version of the loaded document * @public string */ public $version = 'dolibarr'; - + /** * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Objet societe qui emet */ - public $emetteur; + public $emetteur; /** @@ -127,7 +127,7 @@ class pdf_azur extends ModelePDFPropales function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "bills")); @@ -219,7 +219,7 @@ class pdf_azur extends ModelePDFPropales 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", "bills", "propal", "products")); @@ -1432,7 +1432,7 @@ class pdf_azur extends ModelePDFPropales function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $conf,$langs; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills")); @@ -1691,4 +1691,3 @@ class pdf_azur extends ModelePDFPropales return ($tab_hl*7); } } - diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 66ad1413dcd..6adcd2e9cb7 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -87,7 +87,7 @@ class pdf_standard extends ModelePDFStock public function __construct($db) { global $conf,$langs,$mysoc; - + // Load traductions files requiredby by page $langs->loadLangs(array("main", "companies")); @@ -114,12 +114,12 @@ class pdf_standard extends ModelePDFStock // Recupere emetteur $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined - + // Define position of columns $this->wref = 15; $this->posxdesc=$this->marge_gauche+1; $this->posxlabel=$this->posxdesc+$this->wref; - $this->posxtva=80; + $this->posxtva=80; $this->posxqty=95; $this->posxup=115; $this->posxunit=135; @@ -164,7 +164,7 @@ class pdf_standard extends ModelePDFStock 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", "bills", "stocks", "orders", "deliveries")); @@ -188,7 +188,7 @@ class pdf_standard extends ModelePDFStock $stockFournisseur = new ProductFournisseur($this->db); $supplierprices = $stockFournisseur->list_product_fournisseur_price($object->id); $object->supplierprices = $supplierprices; - + $productstatic=new Product($db); if (! file_exists($dir)) @@ -268,8 +268,8 @@ class pdf_standard extends ModelePDFStock /* Affichage de la liste des produits de l'entrepot */ /* */ /* ************************************************************************** */ - - $nexY+=5; + + $nexY+=5; $nexY = $pdf->GetY(); $nexY+=10; @@ -311,7 +311,7 @@ class pdf_standard extends ModelePDFStock if ($objtp->label != '') $objp->produit = $objtp->label; } } - + $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetTextColor(0,0,0); @@ -319,7 +319,7 @@ class pdf_standard extends ModelePDFStock $pdf->setTopMargin($tab_top_newpage); $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); - + // Description of product line $curX = $this->posxdesc-1; @@ -372,13 +372,13 @@ class pdf_standard extends ModelePDFStock } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut - + $productstatic->id=$objp->rowid; $productstatic->ref = $objp->ref; $productstatic->label = $objp->produit; $productstatic->type=$objp->type; $productstatic->entity=$objp->entity; - $productstatic->status_batch=$objp->tobatch; + $productstatic->status_batch=$objp->tobatch; // Ref. $pdf->SetXY($this->posxdesc, $curY); @@ -391,12 +391,12 @@ class pdf_standard extends ModelePDFStock // Quantity $valtoshow=price2num($objp->value, 'MS'); $towrite = (empty($valtoshow)?'0':$valtoshow); - + $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $towrite, 0, 'R'); - + $pdf->MultiCell($this->posxup-$this->posxqty-0.8, 3, $towrite, 0, 'R'); + $totalunit+=$objp->value; - + $pdf->SetXY($this->posxup, $curY); $pdf->MultiCell($this->posxunit-$this->posxup-0.8, 3, price(price2num($objp->ppmp,'MU'), 0, $outputlangs), 0, 'R'); @@ -429,7 +429,7 @@ class pdf_standard extends ModelePDFStock } $nexY+=2; // Passe espace entre les lignes - + // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) { @@ -466,20 +466,20 @@ class pdf_standard extends ModelePDFStock if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } } - + $db->free($resql); - + /** * footer table */ $nexY = $pdf->GetY(); $nexY+=2; - $curY = $nexY; - - $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); + $curY = $nexY; + + $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->SetFont('','B',$default_font_size-1); $pdf->SetTextColor(0,0,120); @@ -487,7 +487,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetXY($this->posxdesc, $curY); $pdf->MultiCell($this->wref, 3, $langs->trans("Total"), 0, 'L'); - // Quantity + // Quantity $valtoshow=price2num($totalunit, 'MS'); $towrite = empty($valtoshow)?'0':$valtoshow; @@ -736,8 +736,8 @@ class pdf_standard extends ModelePDFStock } } */ - $tab_top = $tab_top_newpage+21; - + $tab_top = $tab_top_newpage+21; + // Show square if ($pagenb == 1) { @@ -749,7 +749,7 @@ class pdf_standard extends ModelePDFStock $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; } - + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; // Affiche zone infos @@ -836,21 +836,21 @@ class pdf_standard extends ModelePDFStock // Output Rect //$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param - + $pdf->SetLineStyle(array('dash'=>'0','color'=>array(220,26,26))); - $pdf->SetDrawColor(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->SetDrawColor(128,128,128); $pdf->SetTextColor(0,0,120); - + if (empty($hidetop)) { //$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param $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); if (empty($hidetop)) { @@ -860,7 +860,7 @@ class pdf_standard extends ModelePDFStock //$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'); } @@ -873,7 +873,7 @@ class pdf_standard extends ModelePDFStock } //$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); - if (empty($hidetop)) + if (empty($hidetop)) { $pdf->SetXY($this->posxunit - 1, $tab_top + 1); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '', @@ -887,18 +887,18 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("SellPriceMin"),'','C'); } - //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); + //$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->postotalht-1, $tab_top+1); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht,2, $outputlangs->transnoentities("EstimatedStockValueSellShort"),'','C'); } - - $pdf->SetDrawColor(220,26,26); + + $pdf->SetDrawColor(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->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11); $pdf->SetLineStyle(array('dash'=>0)); - + } /** @@ -914,7 +914,7 @@ class pdf_standard extends ModelePDFStock function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="") { global $conf,$langs,$db,$hookmanager; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "propal", "companies", "bills", "orders", "stocks")); @@ -961,7 +961,7 @@ class pdf_standard extends ModelePDFStock $text=$this->emetteur->name; $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } - + $pdf->SetFont('','B', $default_font_size + 3); $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); @@ -981,22 +981,22 @@ class pdf_standard extends ModelePDFStock $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("LocationSummary").' :', '', 'R'); - + $posy+=4; $pdf->SetXY($posx-50,$posy); $pdf->MultiCell(150, 3, $object->lieu, '', 'R'); - - + + // Parent entrepot $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ParentWarehouse").' :', '', 'R'); - + $posy+=4; $pdf->SetXY($posx-50,$posy); $e = new Entrepot($db); - if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) + if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { $pdf->MultiCell(150, 3, $e->libelle, '', 'R'); } @@ -1004,14 +1004,14 @@ class pdf_standard extends ModelePDFStock { $pdf->MultiCell(150, 3, $outputlangs->transnoentities("None"), '', 'R'); } - + // Description $nexY = $pdf->GetY(); $nexY+=5; $pdf->SetXY($posx,$posy); $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("Description").' : '.nl2br($object->description), 0, 1); $nexY = $pdf->GetY(); - + $calcproductsunique=$object->nb_different_products(); $calcproducts=$object->nb_products(); @@ -1023,12 +1023,12 @@ class pdf_standard extends ModelePDFStock $valtoshow=price2num($calcproducts['nb'], 'MS'); $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("NumberOfProducts").' : '.(empty($valtoshow)?'0':$valtoshow), 0, 1); $nexY = $pdf->GetY(); - + // Value $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("EstimatedStockValueShort").' : '. price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency), 0, 1); $nexY = $pdf->GetY(); - - + + // Last movement $sql = "SELECT max(m.datem) as datem"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -1056,7 +1056,7 @@ class pdf_standard extends ModelePDFStock $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("LastMovement").' : '.$toWrite, 0, 1); $nexY = $pdf->GetY(); - + /*if ($object->ref_client) { $posy+=5; @@ -1147,4 +1147,3 @@ class pdf_standard extends ModelePDFStock } } - diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index d14a9bdcdc8..be563f4d495 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -40,75 +40,75 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ public $type; - + /** * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ public $phpmin = array(5, 4); - + /** * Dolibarr version of the loaded document * @public string */ public $version = 'dolibarr'; - + /** * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Objet societe qui emet */ - public $emetteur; - + public $emetteur; + /** @@ -1249,4 +1249,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } } - 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 bda0170397d..1bd1b89cd38 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -42,17 +42,17 @@ class pdf_standard extends ModelePDFSuppliersPayments * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -62,54 +62,54 @@ class pdf_standard extends ModelePDFSuppliersPayments * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string */ public $version = 'dolibarr'; - + /** * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe */ - public $emetteur; + public $emetteur; /** @@ -120,7 +120,7 @@ class pdf_standard extends ModelePDFSuppliersPayments function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "bills")); @@ -814,4 +814,3 @@ class pdf_standard extends ModelePDFSuppliersPayments } } - 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 5f971cab2d1..7d7009a3c58 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -42,17 +42,17 @@ class pdf_aurore extends ModelePDFSupplierProposal * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -62,8 +62,8 @@ class pdf_aurore extends ModelePDFSupplierProposal * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -74,32 +74,32 @@ class pdf_aurore extends ModelePDFSupplierProposal * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ @@ -120,7 +120,7 @@ class pdf_aurore extends ModelePDFSupplierProposal public function __construct($db) { global $conf, $langs, $mysoc; - + // Translations $langs->loadLangs(array("main", "bills")); @@ -160,7 +160,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->posxdesc=$this->marge_gauche+1; $this->posxdiscount=162; $this->postotalht=174; - + if ($conf->global->PRODUCT_USE_UNITS) { $this->posxtva=101; @@ -172,7 +172,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->posxup=126; $this->posxqty=145; } - + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) $this->posxup=$this->posxtva; $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format @@ -211,7 +211,7 @@ class pdf_aurore extends ModelePDFSupplierProposal 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'; - + // Translations $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal")); @@ -524,7 +524,7 @@ class pdf_aurore extends ModelePDFSupplierProposal { $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); } - + // Unit if($conf->global->PRODUCT_USE_UNITS) { @@ -1232,7 +1232,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } } - + if($conf->global->PRODUCT_USE_UNITS) { $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -1274,7 +1274,7 @@ class pdf_aurore extends ModelePDFSupplierProposal function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $conf,$langs; - + // Translations $outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies")); @@ -1496,4 +1496,3 @@ class pdf_aurore extends ModelePDFSupplierProposal } } - diff --git a/htdocs/core/modules/syslog/mod_syslog_firephp.php b/htdocs/core/modules/syslog/mod_syslog_firephp.php index 98a3c7142af..abc341f9a30 100644 --- a/htdocs/core/modules/syslog/mod_syslog_firephp.php +++ b/htdocs/core/modules/syslog/mod_syslog_firephp.php @@ -126,8 +126,8 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface if (is_object($langs)) // $langs may not be defined yet. { $errors[] = $langs->trans("ErrorFailedToOpenFile", self::$firephp_class_path); - } - else + } + else { $errors[] = "ErrorFailedToOpenFile " . self::$firephp_class_path; } diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 2881e23a21b..75bf96dd825 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -93,7 +93,7 @@ class MultiCurrency extends CommonObject public function __construct(DoliDB $db) { $this->db = &$db; - + return 1; } @@ -108,21 +108,21 @@ class MultiCurrency extends CommonObject public function create(User $user, $trigger = true) { global $conf,$langs; - + dol_syslog('Currency::create', LOG_DEBUG); $error = 0; - + if (self::checkCodeAlreadyExists($this->code)) { $error++; $this->errors[] = $langs->trans('multicurrency_code_already_added'); return -1; } - + if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity; $now=date('Y-m-d H:i:s'); - + // Insert request $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '('; $sql .= ' code,'; @@ -152,7 +152,7 @@ class MultiCurrency extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); $this->date_create = $now; $this->fk_user = $user->id; - + if ($trigger) { $result=$this->call_trigger('CURRENCY_CREATE', $user); if ($result < 0) $error++; @@ -181,7 +181,7 @@ class MultiCurrency extends CommonObject public function fetch($id, $code = null) { dol_syslog('Currency::fetch', LOG_DEBUG); - + global $conf; $sql = 'SELECT'; @@ -192,7 +192,7 @@ class MultiCurrency extends CommonObject dol_syslog(__METHOD__,LOG_DEBUG); $resql = $this->db->query($sql); - + if ($resql) { $numrows = $this->db->num_rows($resql); if ($numrows) { @@ -204,7 +204,7 @@ class MultiCurrency extends CommonObject $this->entity = $obj->entity; $this->date_create = $obj->date_create; $this->fk_user = $obj->fk_user; - + $this->fetchAllCurrencyRate(); $this->getRate(); } @@ -234,7 +234,7 @@ class MultiCurrency extends CommonObject $sql.= ' FROM ' . MAIN_DB_PREFIX . $this->table_element_line. ' as cr'; $sql.= ' WHERE cr.fk_multicurrency = '.$this->id; $sql.= ' ORDER BY cr.date_sync DESC'; - + $this->rates = array(); dol_syslog(__METHOD__,LOG_DEBUG); @@ -245,7 +245,7 @@ class MultiCurrency extends CommonObject while ($obj = $this->db->fetch_object($resql)) { $rate = new CurrencyRate($this->db); $rate->fetch($obj->rowid); - + $this->rates[] = $rate; } $this->db->free($resql); @@ -272,19 +272,19 @@ class MultiCurrency extends CommonObject $error = 0; dol_syslog('Currency::update', LOG_DEBUG); - + // Clean parameters $this->name = trim($this->name); $this->code = trim($this->code); - + // Check parameters if (empty($this->code)) { $error++; dol_syslog('Currency::update $this->code can not be empty', LOG_ERR); - + return -1; } - + // Update request $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET'; $sql .= ' name=\''.$this->db->escape($this->name).'\''; @@ -328,7 +328,7 @@ class MultiCurrency extends CommonObject public function delete($trigger = true) { global $user; - + dol_syslog('Currency::delete', LOG_DEBUG); $error = 0; @@ -347,7 +347,7 @@ class MultiCurrency extends CommonObject $this->errors[] = 'Error ' . $this->db->lasterror(); dol_syslog('Currency::delete ' . join(',', $this->errors), LOG_ERR); } - + $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element; $sql .= ' WHERE rowid=' . $this->id; @@ -371,7 +371,7 @@ class MultiCurrency extends CommonObject return 1; } } - + /** * Delete rates in database * @@ -386,85 +386,85 @@ class MultiCurrency extends CommonObject return false; } } - + return true; } - + /** - * Delete rate in database - * + * Delete rate in database + * * @param double $rate rate value - * + * * @return int -1 if KO, 1 if OK */ public function addRate($rate) { $currencyRate = new CurrencyRate($this->db); $currencyRate->rate = $rate; - - if ($currencyRate->create($this->id) > 0) + + if ($currencyRate->create($this->id) > 0) { $this->rate = $currencyRate; return 1; } - else + else { $this->rate = null; return -1; } } - + /** * Try get label of code in llx_currency then add rate - * + * * @param string $code currency code * @param double $rate new rate - * + * * @return int -1 if KO, 1 if OK, 2 if label found and OK */ function addRateFromDolibarr($code, $rate) { global $db, $user; - + $currency = new MultiCurrency($db); $currency->code = $code; $currency->name = $code; - + $sql = 'SELECT label FROM '.MAIN_DB_PREFIX.'c_currencies WHERE code_iso = \''.$db->escape($code).'\''; - + dol_syslog(__METHOD__,LOG_DEBUG); $resql = $db->query($sql); if ($resql && ($line = $db->fetch_object($resql))) { $currency->name = $line->label; } - + if ($currency->create($user) > 0) { $currency->addRate($rate); - + if (!empty($line)) return 2; else return 1; } - - return -1; + + return -1; } - + /** * Add new entry into llx_multicurrency_rate to historise - * + * * @param double $rate rate value - * + * * @return int <0 if KO, >0 if OK */ public function updateRate($rate) { return $this->addRate($rate); } - + /** - * Fetch CurrencyRate object in $this->rate - * + * Fetch CurrencyRate object in $this->rate + * * @return int <0 if KO, 0 if not found, >0 if OK */ public function getRate() @@ -473,50 +473,50 @@ class MultiCurrency extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as cr'; $sql.= ' WHERE cr.fk_multicurrency = '.$this->id; $sql.= ' AND cr.date_sync = (SELECT MAX(cr2.date_sync) FROM '.MAIN_DB_PREFIX.$this->table_element_line.' AS cr2 WHERE cr2.fk_multicurrency = '.$this->id.')'; - + dol_syslog(__METHOD__,LOG_DEBUG); $resql = $this->db->query($sql); if ($resql && ($obj = $this->db->fetch_object($resql))) { $this->rate = new CurrencyRate($this->db); return $this->rate->fetch($obj->rowid); } - + } - + /** - * Get id of currency from code + * Get id of currency from code * * @param DoliDB $db object db * @param string $code code value search - * + * * @return 0 if not found, >0 if OK */ public static function getIdFromCode(&$db, $code) { global $conf; - + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'multicurrency WHERE code = \''.$db->escape($code).'\' AND entity = '.$conf->entity; - + dol_syslog(__METHOD__,LOG_DEBUG); $resql = $db->query($sql); if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid; else return 0; } - + /** - * Get id and rate of currency from code - * + * Get id and rate of currency from code + * * @param DoliDB $db object db * @param string $code code value search * @param date $date_document date from document (propal, order, invoice, ...) - * + * * @return array [0] => id currency * [1] => rate */ public static function getIdAndTxFromCode(&$db, $code, $date_document='') { global $conf; - + $sql1 = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m'; $sql1.= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)'; $sql1.= ' WHERE m.code = \''.$db->escape($code).'\''; @@ -524,10 +524,10 @@ class MultiCurrency extends CommonObject $sql2= ''; if (!empty($conf->global->MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE) && !empty($date_document)) $sql2.= ' AND DATE_FORMAT(mc.date_sync, "%Y-%m-%d") = "'.date('Y-m-d', $date_document).'"'; $sql3.= ' ORDER BY mc.date_sync DESC LIMIT 1'; - + dol_syslog(__METHOD__,LOG_DEBUG); $resql = $db->query($sql1.$sql2.$sql3); - + if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate); else { @@ -536,67 +536,67 @@ class MultiCurrency extends CommonObject $resql = $db->query($sql1.$sql3); if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate); } - + return array(0, 1); } - } - + } + /** * Get the conversion of amount with invoice rate - * + * * @param int $fk_facture id of facture * @param double $amount amount to convert * @param string $way dolibarr mean the amount is in dolibarr currency * @param string $table facture or facture_fourn - * + * * @return double amount converted */ public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture') { global $db; - + $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); - - if ($multicurrency_tx) + + if ($multicurrency_tx) { if ($way == 'dolibarr') return $amount * $multicurrency_tx; else return $amount / $multicurrency_tx; } else return $amount; } - + /** * Get current invoite rate - * + * * @param int $fk_facture id of facture * @param string $table facture or facture_fourn */ public static function getInvoiceRate($fk_facture, $table='facture') { global $db; - + $sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture; - + dol_syslog(__METHOD__,LOG_DEBUG); $resql = $db->query($sql); if ($resql && ($line = $db->fetch_object($resql))) { return $line->multicurrency_tx; } - + return false; } /** * With free account we can't set source then recalcul all rates to force another source - * - * @param stdClass $TRate Object containing all currencies rates + * + * @param stdClass $TRate Object containing all currencies rates * @return -1 if KO, 0 if nothing, 1 if OK */ public static function recalculRates(&$TRate) { global $conf; - + if (!empty($conf->global->MULTICURRENCY_ALTERNATE_SOURCE)) { $alternate_source = 'USD'.$conf->global->MULTICURRENCY_ALTERNATE_SOURCE; @@ -607,25 +607,25 @@ class MultiCurrency extends CommonObject { $rate *= $coef; } - + return 1; } - + return -1; // Alternate souce not found } - + return 0; // Nothing to do } - + /** * Sync rates from api - * + * * @param array $response array of reponse from api to sync dolibarr rates */ public static function syncRates($response) { global $db,$conf; - + $ch = curl_init('http://apilayer.net/api/live?access_key='.$key.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); @@ -634,11 +634,11 @@ class MultiCurrency extends CommonObject if ($response->success) { - + $TRate = $response->quotes; $timestamp = $response->timestamp; - if (self::recalculRates($TRate) >= 0) + if (self::recalculRates($TRate) >= 0) { foreach ($TRate as $currency_code => $rate) { @@ -648,11 +648,11 @@ class MultiCurrency extends CommonObject { $obj->updateRate($rate); } - else + else { self::addRateFromDolibarr($code, $rate); } - } + } } } else @@ -660,17 +660,17 @@ class MultiCurrency extends CommonObject setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors'); } } - + /** * Check in database if the current code already exists - * + * * @param string $code current code to search * @return boolean True if exists, false if not exists */ public static function checkCodeAlreadyExists($code) { global $db; - + $currency = new MultiCurrency($db); if ($currency->fetch('', $code) > 0) return true; else return false; @@ -710,7 +710,7 @@ class CurrencyRate extends CommonObjectLine * @var int Id of entity */ public $entity; - + /** * Constructor * @@ -719,10 +719,10 @@ class CurrencyRate extends CommonObjectLine public function __construct(DoliDB $db) { $this->db = &$db; - + return 1; } - + /** * Create object into database * @@ -734,14 +734,14 @@ class CurrencyRate extends CommonObjectLine public function create($fk_multicurrency, $trigger = true) { global $conf, $user; - + dol_syslog('CurrencyRate::create', LOG_DEBUG); $error = 0; $this->rate = price2num($this->rate); if (empty($this->entity) || $this->entity <= 0) $this->entity = $conf->entity; $now=date('Y-m-d H:i:s'); - + // Insert request $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '('; $sql .= ' rate,'; @@ -769,7 +769,7 @@ class CurrencyRate extends CommonObjectLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); $this->fk_multicurrency = $fk_multicurrency; $this->date_sync = $now; - + if ($trigger) { $result=$this->call_trigger('CURRENCYRATE_CREATE', $user); if ($result < 0) $error++; @@ -829,7 +829,7 @@ class CurrencyRate extends CommonObjectLine return - 1; } } - + /** * Update object into database * @@ -840,13 +840,13 @@ class CurrencyRate extends CommonObjectLine public function update($trigger = true) { global $user; - + $error = 0; dol_syslog('CurrencyRate::update', LOG_DEBUG); - + $this->rate = price2num($this->rate); - + // Update request $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET'; $sql .= ' rate='.$this->rate; @@ -878,7 +878,7 @@ class CurrencyRate extends CommonObjectLine return 1; } } - + /** * Delete object in database * @@ -889,7 +889,7 @@ class CurrencyRate extends CommonObjectLine public function delete($trigger = true) { global $user; - + dol_syslog('CurrencyRate::delete', LOG_DEBUG); $error = 0; @@ -925,5 +925,5 @@ class CurrencyRate extends CommonObjectLine return 1; } } - + } diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php index 0049daeaa7d..b546af62a4f 100644 --- a/htdocs/product/admin/price_rules.php +++ b/htdocs/product/admin/price_rules.php @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Page to set how to autocalculate price for each level when option * PRODUCT_MULTIPRICE is on. */ @@ -190,14 +190,14 @@ $genPriceOptions = function($level) use ($price_options) {
'.$langs->trans("NbOfGenerationDone").''; print $object->nb_gen_done?$object->nb_gen_done:'0'; print '
'; print $langs->trans("DateLastGeneration"); @@ -788,7 +788,7 @@ if ($action == 'create') { $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, "; $sql.= " f.duree, f.fk_contrat, f.fk_projet, f.frequency, f.nb_gen_done, f.nb_gen_max,"; $sql.= " f.date_last_gen, f.date_when, f.datec"; - + $sql.= " FROM ".MAIN_DB_PREFIX."fichinter_rec as f"; $sql.= " , ".MAIN_DB_PREFIX."societe as s "; if (! $user->rights->societe->client->voir && ! $socid) { @@ -813,7 +813,7 @@ if ($action == 'create') { if ($resql) { $num = $db->num_rows($resql); print_barre_liste( - $langs->trans("RepeatableInterventional"), $page, + $langs->trans("RepeatableInterventional"), $page, $_SERVER['PHP_SELF'], "&socid=$socid", $sortfield, $sortorder, '', $num, '', 'title_commercial.png' ); @@ -824,12 +824,12 @@ if ($action == 'create') { print ''; print ''; print_liste_field_titre( - $langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "", + $langs->trans("Ref"), $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px" align="left"', $sortfiled, $sortorder ); print_liste_field_titre( - $langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "", + $langs->trans("Company"), $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px" align="left"', $sortfiled, $sortorder ); if (! empty($conf->contrat->enabled)) @@ -847,7 +847,7 @@ if ($action == 'create') { ); print_liste_field_titre( $langs->trans("Duration"), $_SERVER['PHP_SELF'], - 'f.duree', '', '', + 'f.duree', '', '', 'width="50px" align="right"', $sortfiled, $sortorder ); // Recurring or not @@ -915,7 +915,7 @@ if ($action == 'create') { print ''; print ''; - + print ''; } - + if ($user->rights->ficheinter->creer) { // Action column print ''; print "
'.convertSecondToTime($objp->duree).''.yn($objp->frequency?1:0).''; if ($objp->frequency) { print $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') ; @@ -938,7 +938,7 @@ if ($action == 'create') { print ''.$langs->trans('NA').''; print ''; @@ -958,7 +958,7 @@ if ($action == 'create') { $i++; } } - } else + } else print '
'.$langs->trans("NoneF").'
"; diff --git a/htdocs/fourn/js/lib_dispatch.js b/htdocs/fourn/js/lib_dispatch.js index c2c570643f8..d183aeb4e48 100644 --- a/htdocs/fourn/js/lib_dispatch.js +++ b/htdocs/fourn/js/lib_dispatch.js @@ -23,23 +23,23 @@ /** * addDispatchLine * Adds new table row for dispatching to multiple stock locations - * + * * @param index int index of product line. 0 = first product line * @param type string type of dispatch (batch = batch dispatch, dispatch = non batch dispatch) * @param mode string 'qtymissing' will create new line with qty missing, 'lessone' will keep 1 in old line and the rest in new one */ -function addDispatchLine(index, type, mode) +function addDispatchLine(index, type, mode) { mode = mode || 'qtymissing' - + console.log("fourn/js/lib_dispatch.js Split line type="+type+" index="+index+" mode="+mode); var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true), // clone first batch line to jQuery object nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length, // position of line for batch qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()), // Qty ordered is same for all rows qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val()), qtyDispatched; - - if (mode === 'lessone') + + if (mode === 'lessone') { qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()) + 1; } @@ -47,7 +47,7 @@ function addDispatchLine(index, type, mode) { qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()) + qty; } - + if (qtyDispatched < qtyOrdered) { //replace tr suffix nbr @@ -62,19 +62,19 @@ function addDispatchLine(index, type, mode) $row.attr('name',type+'_'+nbrTrs+'_'+index); //insert new row before last row $("tr[name^='"+type+"_'][name$='_"+index+"']:last").after($row); - + //remove cloned select2 with duplicate id. $("#s2id_entrepot_"+nbrTrs+'_'+index).detach(); // old way to find duplicated select2 component $(".csswarehouse_"+nbrTrs+"_"+index+":first-child").parent("span.selection").parent(".select2").detach(); - + /* Suffix of lines are: _ trs.length _ index */ $("#qty_"+nbrTrs+"_"+index).focus(); $("#qty_dispatched_0_"+index).val(qtyDispatched); - + //hide all buttons then show only the last one $("tr[name^='"+type+"_'][name$='_"+index+"'] .splitbutton").hide(); $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); - + if (mode === 'lessone') { qty = 1; // keep 1 in old line @@ -94,11 +94,11 @@ function addDispatchLine(index, type, mode) /** * onChangeDispatchLineQty - * - * Change event handler for dispatch qty input field, + * + * Change event handler for dispatch qty input field, * recalculate qty dispatched when qty input has changed. * If qty is more then qty ordered reset input qty to max qty to dispatch. - * + * * element requires arbitrary data qty (value before change), type (type of dispatch) and index (index of product line) */ @@ -124,4 +124,4 @@ function onChangeDispatchLineQty() { } $(this).data('qty', $(this).val()); } -} \ No newline at end of file +} diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index c8b64790061..213231cf160 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -418,7 +418,7 @@ class Holiday extends CommonObject } else { - // SQL Error + // SQL Error $this->error="Error ".$this->db->lasterror(); return -1; } @@ -542,7 +542,7 @@ class Holiday extends CommonObject } else { - // SQL Error + // SQL Error $this->error="Error ".$this->db->lasterror(); return -1; } diff --git a/htdocs/opensurvey/css/style.css b/htdocs/opensurvey/css/style.css index 7e359bd134e..e790d2d59f8 100644 --- a/htdocs/opensurvey/css/style.css +++ b/htdocs/opensurvey/css/style.css @@ -104,10 +104,10 @@ borghesi@unistra.fr Ce logiciel est régi par la licence CeCILL-B soumise au droit français et respectant les principes de diffusion des logiciels libres. Vous pouvez utiliser, modifier et/ou redistribuer ce programme sous les conditions -de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA +de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA sur le site "http://www.cecill.info". -Le fait que vous puissiez accéder à cet en-tête signifie que vous avez +Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la licence CeCILL-B, et que vous en avez accepté les termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. @@ -120,10 +120,10 @@ Creation : Feb 2008 borghesi@unistra.fr This software is governed by the CeCILL-B license under French law and -abiding by the rules of distribution of free software. You can use, +abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-B license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". +"http://www.cecill.info". The fact that you are presently reading this means that you have had knowledge of the CeCILL-B license and that you accept its terms. You can @@ -133,12 +133,12 @@ find a copy of this license in the file LICENSE. */ /* -Le fichier style.css est le fichier de style de studs. Il se trouve à la racine +Le fichier style.css est le fichier de style de studs. Il se trouve à la racine du répertoire studs. Il contient toutes les mises en forme des fichiers PHP de Studs. */ /*bandeau de titre*/ -div.bandeau{ +div.bandeau{ line-height:35px; text-align:center; background-color: #0b419b; @@ -146,7 +146,7 @@ div.bandeau{ vertical-align:middle; font-size:35px; font-family:arial, sans-serif; - padding:8px; + padding:8px; height:35px; position:static; top:6px; @@ -154,30 +154,30 @@ div.bandeau{ right:6px; } -div.logo{ +div.logo{ height:64px; float:right; top:8px; right:8px; margin-left: 0; - margin-right:0; + margin-right:0; margin-bottom:auto; } /*Sous bandeau avec bouton de navigation*/ -div.bandeautitre{ +div.bandeautitre{ height:17px; font-size:14px; font-weight:bold; text-align:center; vertical-align:middle; font-family:arial, sans-serif; - padding:3px; + padding:3px; position:static; top:57px; left:6px; right:6px; -} -div.sousbandeau{ +} +div.sousbandeau{ height:17px; background-color: #DDDDDD; font-size:11px; @@ -191,15 +191,15 @@ div.sousbandeau{ right:6px; } /*bandeau de pied*/ -div.surbandeaupied{ +div.surbandeaupied{ background-color: #0077DD; position:absolute; bottom:30px; left:6px; - right:6px; + right:6px; height:6px; } -div.bandeaupied{ +div.bandeaupied{ text-align:center; background-color: #0b419b; color:white; @@ -209,29 +209,29 @@ div.bandeaupied{ position:fixed; bottom:6px; left:6px; - right:6px; + right:6px; margin:2px; } -div.surbandeaupiedmobile{ +div.surbandeaupiedmobile{ background-color: #0077DD; - position:static; + position:static; bottom:32px; left:6px; - right:6px; + right:6px; height:6px; } -div.bandeaupiedmobile{ +div.bandeaupiedmobile{ text-align:center; background-color: #0b419b; color:white; font-size:11px; font-family:arial, sans-serif; - padding:6px; - position:static; + padding:6px; + position:static; } /*les boutons se trouvant dans le sousbandeau*/ div.sousbandeau a, div.sousbandeau span.sousbandeaulangue a { - background-color: #0b419b; + background-color: #0b419b; height:16px; padding: 2px 6px 2px 6px; vertical-align:middle; @@ -249,7 +249,7 @@ span.sousbandeaulangue { float:right; } /*corps de la page index.php*/ -div.corps{ +div.corps{ font-size:12px; font-family:arial, sans-serif; position:static; @@ -257,10 +257,10 @@ div.corps{ } div.corps table{ font-family:arial, sans-serif; - font-size:12px; + font-size:12px; font-weight:bold; } -div.corpscentre{ +div.corpscentre{ font-size:12px; font-family:arial, sans-serif; text-align:center; @@ -285,7 +285,7 @@ div.jourschoisis { div.bodydate { padding:10px; font-family:arial, sans-serif; - font-size:12px; + font-size:12px; text-align:center; position:static; top:330px; @@ -294,7 +294,7 @@ div.bodydate { } div.bodydate table{ font-family:arial, sans-serif; - font-size:12px; + font-size:12px; font-weight:bold; } /*cadre de commentaires*/ @@ -302,7 +302,7 @@ div.presentationdate { width:100%; font-family:arial, sans-serif; text-align:center; - font-size:12px; + font-size:12px; border-top:1px solid; border-bottom:1px solid; border-left: none; @@ -321,14 +321,14 @@ div.presentationdatefin { border: 1px solid; margin-top: 10px; margin-left: 30%; - margin-right: 30%; + margin-right: 30%; position:static; } /*cadre principal de studs.php*/ div.cadre { - padding:10px; + padding:10px; font-family:arial, sans-serif; - font-size:12px; + font-size:12px; position:static; top:235px; text-align:center; @@ -350,54 +350,54 @@ div.cadre td { } /*case de tableau OK dans affichage de sondage*/ div.cadre td.ok { - background-color: #66FF99; - font-size:12px; + background-color: #66FF99; + font-size:12px; text-align:center; } /*Case de tableau NON dans affichage de sondage*/ div.cadre td.non { - background-color: #FF7777; + background-color: #FF7777; min-width: 60px; } /*Case de tableau VIDE dans affichage de sondage*/ div.cadre td.vide { - background-color: #DDDDDD; + background-color: #DDDDDD; text-align:center; } /*Case de tableau contenant les noms dans affichage de sondage*/ div.cadre td.nom { - background-color: #DDDDDD; - font-size:12px; + background-color: #DDDDDD; + font-size:12px; text-align:center; } div.cadre td.casevide { - background-color: white; + background-color: white; text-align:center; } /*les cases contenant les sommes de chaque colonne dans l'affichage de calendrier*/ div.cadre td.somme { font-weight: bold; - font-size:14px; + font-size:14px; } /*Case de tableau SUJET dans affichage de sondage*/ div.cadre td.sujet, div.cadre td.jour, div.cadre td.heure { border: 2px; - background-color: #DDDDDD; + background-color: #DDDDDD; font-size:14px; padding:1px 5px; } div.cadre td.annee { border: 2px; - background-color: #969696; + background-color: #969696; font-weight: bold; font-size:14px; padding:1px 5px; } div.cadre td.mois { border: 2px; - background-color: #C0C0C0; + background-color: #C0C0C0; font-weight: bold; font-size:14px; padding:1px 5px; @@ -421,7 +421,7 @@ div.calendrier td.joursemaine { font-family:arial, sans-serif; font-size:14px; border: 2px; - background-color: white; + background-color: white; } div.calendrier td.jourwe { width:65px; @@ -429,7 +429,7 @@ div.calendrier td.jourwe { font-family:arial, sans-serif; font-size:14px; border: 2px; - background-color: #C0C0C0; + background-color: #C0C0C0; } /*jour avant le premier jour du mois dans calendrier*/ div.calendrier td.avant { @@ -438,21 +438,21 @@ div.calendrier td.avant { border: 2px; font-family:arial, sans-serif; font-size:13px; - background-color: #DDDDDD; + background-color: #DDDDDD; } /*jour libre dans calendrier*/ div.calendrier td.libre { width:65px; text-align: center; border: 2px; - background-color: #66FF99; + background-color: #66FF99; } /*jour deja selectionné dans calendrier*/ div.calendrier td.choisi { width:65px; text-align: center; border: 2px; - background-color: #0077DD; + background-color: #0077DD; } /* Le paragraphe de fin */ p.affichageresultats{ diff --git a/htdocs/support/default.css b/htdocs/support/default.css index 17204387eb4..6737a6ede00 100644 --- a/htdocs/support/default.css +++ b/htdocs/support/default.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 Rodolphe Quiedeville +/* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2009 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -147,7 +147,7 @@ padding: 4px 4px 4px 4px; tr.title { -background: #DDDFDD; +background: #DDDFDD; } table { font-size: 12px; } From f8e7d71ae855e0e5bed6f35d2f5db6315493ca07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 18:33:00 +0200 Subject: [PATCH 06/91] trim trailing --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e3f1511266..c1a231eb3f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -216,7 +216,7 @@ before_script: - | export CONF_FILE=htdocs/conf/conf.php echo "Setting up Dolibarr $CONF_FILE" - echo ' $CONF_FILE + echo ' $CONF_FILE echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE @@ -291,11 +291,11 @@ script: - | echo "Checking coding style" # Ensure we catch errors - set -e + #set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . - set +e + #set +e echo # TODO: Check Javascript (jshint?) From 6cb0fb10d619368d619673ed9cd8bbb0be7ee761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 19:05:34 +0200 Subject: [PATCH 07/91] trim trailing --- .../highlight.js | 14 +- .../prettify.css | 2 +- .../prettify.js | 2 +- .../stylesheet.css | 38 ++-- htdocs/asterisk/cidlookup.php | 4 +- .../class/commonstickergenerator.class.php | 8 +- htdocs/core/class/coreobject.class.php | 20 +- htdocs/core/class/html.formpropal.class.php | 7 +- .../core/filemanagerdol/connectors/php/io.php | 6 +- htdocs/core/lib/barcode.lib.php | 6 +- htdocs/core/lib/emailing.lib.php | 4 +- htdocs/core/lib/expensereport.lib.php | 8 +- htdocs/core/lib/format_cards.lib.php | 2 +- htdocs/core/lib/functionsnumtoword.lib.php | 92 ++++---- htdocs/core/lib/hrm.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 12 +- htdocs/core/lib/loan.lib.php | 2 +- htdocs/core/lib/modulebuilder.lib.php | 8 +- htdocs/core/lib/salaries.lib.php | 8 +- htdocs/core/lib/xcal.lib.php | 3 +- .../barcode/doc/phpbarcode.modules.php | 5 +- .../barcode/doc/tcpdfbarcode.modules.php | 44 ++-- .../modules/cheque/doc/pdf_blochet.class.php | 12 +- .../modules/cheque/modules_chequereceipts.php | 3 +- .../contract/doc/pdf_strato.modules.php | 29 ++- .../expedition/doc/pdf_merou.modules.php | 36 ++-- .../expedition/doc/pdf_rouget.modules.php | 27 ++- .../doc/pdf_standard.modules.php | 27 ++- .../modules/facture/doc/pdf_crabe.modules.php | 19 +- .../modules/facture/mod_facture_mercure.php | 4 +- .../fichinter/doc/pdf_soleil.modules.php | 25 ++- .../modules/import/import_csv.modules.php | 6 +- .../modules/import/import_xlsx.modules.php | 4 +- .../livraison/doc/pdf_typhon.modules.php | 35 ++-- .../core/modules/mailings/example.modules.php | 5 +- .../core/modules/mailings/pomme.modules.php | 15 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 44 ++-- .../project/doc/pdf_baleine.modules.php | 32 +-- .../project/doc/pdf_beluga.modules.php | 26 +-- .../modules/propale/doc/pdf_azur.modules.php | 37 ++-- .../stock/doc/pdf_standard.modules.php | 101 +++++---- .../pdf/pdf_canelle.modules.php | 31 ++- .../doc/pdf_standard.modules.php | 31 ++- .../doc/pdf_aurore.modules.php | 37 ++-- .../modules/syslog/mod_syslog_firephp.php | 4 +- .../class/multicurrency.class.php | 196 +++++++++--------- htdocs/product/admin/price_rules.php | 6 +- htdocs/product/class/api_products.class.php | 2 +- .../product/inventory/ajax/ajax.inventory.php | 35 ++-- .../product/stock/class/productlot.class.php | 9 +- htdocs/product/stock/mouvement.php | 3 +- htdocs/product/stock/product.php | 6 +- htdocs/stripe/transaction.php | 10 +- htdocs/theme/eldy/ckeditor/config.js | 14 +- htdocs/theme/md/ckeditor/config.js | 14 +- test/phpunit/UserGroupTest.php | 14 +- 56 files changed, 584 insertions(+), 612 deletions(-) diff --git a/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js b/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js index d6386c93792..10056e95fd4 100644 --- a/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js +++ b/build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js @@ -15,14 +15,14 @@ else return 0; function highlightTOC(str) { - - - - - + + + + + if (StopProcess()) return; try { - + str = str || parent.BODY.document.location.href; uri = last(str); list = parent.TOC.document.getElementsByTagName("a"); @@ -33,7 +33,7 @@ function highlightTOC(str) { list[i].style.backgroundColor = "#6697cc"; list[i].style.padding = "2px"; list[i].style.color = "#ffffff"; - + } else { list[i].style.backgroundColor = "#ffffff"; list[i].style.color = "#003380"; diff --git a/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.css b/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.css index ee31b50285a..ab64ac4bb6b 100644 --- a/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.css +++ b/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.css @@ -12,7 +12,7 @@ .atn { color: #606; } .atv { color: #080; } .dec { color: #606; } -pre.preformatted { +pre.preformatted { display: block; font-family: "Courier New", verdana, arial, helvetica, sans-serif; diff --git a/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.js b/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.js index 11234738656..fab5c8e6f2a 100644 --- a/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.js +++ b/build/aps/Limitations of APS Support in the Panel_fichiers/prettify.js @@ -1116,7 +1116,7 @@ window['_pr_isIE6'] = function () { for (var i = 0; i < 10; ++i) { lineBreaks[i] = lineBreakHtml + '
  • '; } - var lineNum = numberLines[1] && numberLines[1].length + var lineNum = numberLines[1] && numberLines[1].length ? numberLines[1] - 1 : 0; // Lines are 1-indexed html.push('
    1. trans("Unknown"); - + // Security check -if (empty($conf->clicktodial->enabled)) +if (empty($conf->clicktodial->enabled)) { print "Error: Module Click to dial is not enabled.\n"; exit; diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 1091962f6ea..c6ef9351b69 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 @@ -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/coreobject.class.php b/htdocs/core/class/coreobject.class.php index 1456fb991c2..ce13aa473c3 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -1,6 +1,6 @@ * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ * \ingroup core * \brief File of class to manage all object. Might be replace or merge into commonobject */ - + require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class CoreObject extends CommonObject @@ -54,7 +54,7 @@ class CoreObject extends CommonObject $this->id = 0; $this->datec = 0; $this->tms = 0; - + if (!empty($this->fields)) { foreach ($this->fields as $field=>$info) @@ -68,14 +68,14 @@ class CoreObject extends CommonObject $this->to_delete=false; $this->is_clone=false; - + return true; } else { return false; } - + } /** @@ -110,7 +110,7 @@ class CoreObject extends CommonObject if($res>0) { if ($loadChild) $this->fetchChild(); } - + return $res; } @@ -133,14 +133,14 @@ class CoreObject extends CommonObject if($object->{$key} === $id) return $k; } } - + $k = count($this->{$tabName}); - + $className = ucfirst($tabName); $this->{$tabName}[$k] = new $className($this->db); if($id>0 && $key==='id' && $try_to_load) { - $this->{$tabName}[$k]->fetch($id); + $this->{$tabName}[$k]->fetch($id); } return $k; @@ -220,7 +220,7 @@ class CoreObject extends CommonObject foreach($this->{$className} as $i => &$object) { $object->{$this->fk_element} = $this->id; - + $object->update($user); if($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete==true) unset($this->{$className}[$i]); } diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 14e1a466275..3deff2bbb0e 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -59,10 +59,10 @@ class FormPropal $prefix=''; $listofstatus=array(); - if ($mode == 'supplier') + if ($mode == 'supplier') { $prefix='SupplierProposalStatus'; - + $langs->load("supplier_proposal"); $listofstatus=array( 0=>array('id'=>0, 'code'=>'PR_DRAFT'), @@ -75,7 +75,7 @@ class FormPropal else { $prefix="PropalStatus"; - + $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; $sql .= " WHERE active = 1"; dol_syslog(get_class($this)."::selectProposalStatus", LOG_DEBUG); @@ -139,4 +139,3 @@ class FormPropal print ''; } } - diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 66d024edce8..8fee80af4bd 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -24,7 +24,7 @@ /** * CombinePaths - * + * * @param string $sBasePath sBasePath * @param string $sFolder sFolder * @return string Combined path @@ -393,7 +393,7 @@ EOF; // This is the function that sends the results of the uploading process to CKE. /** * SendCKEditorResults - * + * * @param string $callback callback * @param string $sFileUrl sFileUrl * @param string $customMsg customMsg @@ -409,5 +409,3 @@ function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '') echo ''; } - - diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 13956f688aa..efd245209d2 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -251,7 +251,7 @@ function barcode_encode_genbarcode($code,$encoding) $command=escapeshellarg($genbarcode_loc); //$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\""; $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding)); - + $fullcommandclear=$command." ".$paramclear." 2>&1"; //print $fullcommandclear."
      \n";exit; @@ -277,8 +277,8 @@ function barcode_encode_genbarcode($code,$encoding) "error" => "" ); //var_dump($ret); - if (preg_match('/permission denied/i',$ret['bars'])) - { + if (preg_match('/permission denied/i',$ret['bars'])) + { $ret['error']=$ret['bars']; $ret['bars']=''; return $ret; } diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index 00a06ca3f09..d9cad7f1c1e 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -48,8 +48,8 @@ function emailing_prepare_head(Mailing $object) $h++; } - - if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR)) + + if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR)) { $head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id; $head[$h][1] = $langs->trans("MailAdvTargetRecipients"); diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 1efdc73f247..059f9ad2396 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,7 +81,7 @@ 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 */ @@ -139,7 +139,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 +147,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 diff --git a/htdocs/core/lib/format_cards.lib.php b/htdocs/core/lib/format_cards.lib.php index 7e89946d471..ecfce2108dd 100644 --- a/htdocs/core/lib/format_cards.lib.php +++ b/htdocs/core/lib/format_cards.lib.php @@ -36,7 +36,7 @@ $sql = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, t $resql = $db->query($sql); if ($resql) { - while ($row = $db->fetch_array($resql)) + while ($row = $db->fetch_array($resql)) { $_Avery_Labels[$row['code']]['name']=$row['name']; $_Avery_Labels[$row['code']]['paper-size']=$row['paper_size']; diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index f4319b7d11a..f69bc12fd3f 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -21,12 +21,12 @@ * \brief A set of functions for Dolibarr * This file contains all frequently used functions. */ - - + + /** * Function to return number in text. - * - * + * + * * @param float $num Number to convert * @param Lang $langs Language * @param boolean $currency 0=number to translate | 1=currency to translate @@ -36,7 +36,7 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false) { global $conf; - + $num = str_replace(array(',', ' '), '', trim($num)); if(! $num) { return false; @@ -48,49 +48,49 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false) $num = (int) $TNum[0]; $words = array(); $list1 = array( - '', - $langs->transnoentitiesnoconv('one'), - $langs->transnoentitiesnoconv('two'), - $langs->transnoentitiesnoconv('three'), - $langs->transnoentitiesnoconv('four'), - $langs->transnoentitiesnoconv('five'), - $langs->transnoentitiesnoconv('six'), - $langs->transnoentitiesnoconv('seven'), - $langs->transnoentitiesnoconv('eight'), - $langs->transnoentitiesnoconv('nine'), - $langs->transnoentitiesnoconv('ten'), + '', + $langs->transnoentitiesnoconv('one'), + $langs->transnoentitiesnoconv('two'), + $langs->transnoentitiesnoconv('three'), + $langs->transnoentitiesnoconv('four'), + $langs->transnoentitiesnoconv('five'), + $langs->transnoentitiesnoconv('six'), + $langs->transnoentitiesnoconv('seven'), + $langs->transnoentitiesnoconv('eight'), + $langs->transnoentitiesnoconv('nine'), + $langs->transnoentitiesnoconv('ten'), $langs->transnoentitiesnoconv('eleven'), - $langs->transnoentitiesnoconv('twelve'), - $langs->transnoentitiesnoconv('thirteen'), - $langs->transnoentitiesnoconv('fourteen'), - $langs->transnoentitiesnoconv('fifteen'), - $langs->transnoentitiesnoconv('sixteen'), - $langs->transnoentitiesnoconv('seventeen'), - $langs->transnoentitiesnoconv('eighteen'), + $langs->transnoentitiesnoconv('twelve'), + $langs->transnoentitiesnoconv('thirteen'), + $langs->transnoentitiesnoconv('fourteen'), + $langs->transnoentitiesnoconv('fifteen'), + $langs->transnoentitiesnoconv('sixteen'), + $langs->transnoentitiesnoconv('seventeen'), + $langs->transnoentitiesnoconv('eighteen'), $langs->transnoentitiesnoconv('nineteen') ); $list2 = array( - '', - $langs->transnoentitiesnoconv('ten'), - $langs->transnoentitiesnoconv('twenty'), - $langs->transnoentitiesnoconv('thirty'), - $langs->transnoentitiesnoconv('forty'), - $langs->transnoentitiesnoconv('fifty'), - $langs->transnoentitiesnoconv('sixty'), - $langs->transnoentitiesnoconv('seventy'), - $langs->transnoentitiesnoconv('eighty'), - $langs->transnoentitiesnoconv('ninety'), + '', + $langs->transnoentitiesnoconv('ten'), + $langs->transnoentitiesnoconv('twenty'), + $langs->transnoentitiesnoconv('thirty'), + $langs->transnoentitiesnoconv('forty'), + $langs->transnoentitiesnoconv('fifty'), + $langs->transnoentitiesnoconv('sixty'), + $langs->transnoentitiesnoconv('seventy'), + $langs->transnoentitiesnoconv('eighty'), + $langs->transnoentitiesnoconv('ninety'), $langs->transnoentitiesnoconv('hundred') ); $list3 = array( - '', - $langs->transnoentitiesnoconv('thousand'), - $langs->transnoentitiesnoconv('million'), - $langs->transnoentitiesnoconv('billion'), - $langs->transnoentitiesnoconv('trillion'), + '', + $langs->transnoentitiesnoconv('thousand'), + $langs->transnoentitiesnoconv('million'), + $langs->transnoentitiesnoconv('billion'), + $langs->transnoentitiesnoconv('trillion'), $langs->transnoentitiesnoconv('quadrillion') ); - + $num_length = strlen($num); $levels = (int) (($num_length + 2) / 3); $max_length = $levels * 3; @@ -120,11 +120,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false) $concatWords = implode(' ', $words); // Delete multi whitespaces $concatWords = trim(preg_replace('/[ ]+/', ' ', $concatWords)); - + if(!empty($currency)) { $concatWords .= ' '.$currency; } - + // If we need to write cents call again this function for cents if(!empty($TNum[1])) { if(!empty($currency)) $concatWords .= ' '.$langs->transnoentities('and'); @@ -133,11 +133,11 @@ function dol_convertToWord($num, $langs, $currency=false, $centimes=false) } return $concatWords; } - - + + /** * Function to return number or amount in text. - * + * * @deprecated * @param float $numero Number to convert * @param Lang $langs Language @@ -164,7 +164,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number') /*In dolibarr 3.6.2 (my current version) doesn't have $langs->default and in case exist why ask $lang like a parameter?*/ if (((is_object($langs) && $langs->default == 'es_MX') || (! is_object($langs) && $langs == 'es_MX')) && $numorcurrency == 'currency') - { + { if ($numero>=1 && $numero<2) { return ("UN PESO ".$parte_decimal." / 100 M.N."); } @@ -229,7 +229,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency='number') /** * hundreds2text - * + * * @param integer $hundreds Hundreds * @param integer $tens Tens * @param integer $units Units diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index 5f7eabc7500..08b0e3be01a 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/lib/hrm.lib.php * \ingroup HRM - * \brief Library for hrm + * \brief Library for hrm */ $langs->load('hrm'); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 4e7fa860529..451ac0731ef 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -36,7 +36,7 @@ function facture_prepare_head($object) { global $db, $langs, $conf; - + $h = 0; $head = array(); @@ -63,7 +63,7 @@ function facture_prepare_head($object) $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " WHERE pfd.fk_facture = ".$object->id; $resql=$db->query($sql); - if ($resql) + if ($resql) { $obj=$db->fetch_object($resql); if ($obj) $nbStandingOrders = $obj->nb; @@ -152,12 +152,12 @@ function invoice_admin_prepare_head() $head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][2] = 'attributeslines'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); $head[$h][2] = 'attributesrec'; $h++; - + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); $head[$h][2] = 'attributeslinesrec'; @@ -172,7 +172,7 @@ function invoice_admin_prepare_head() function invoice_rec_prepare_head($object) { global $db, $langs, $conf; - + $h = 0; $head = array(); @@ -191,5 +191,3 @@ function invoice_rec_prepare_head($object) return $head; } - - diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 3f7029dd26b..b61c57b4bc3 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -59,7 +59,7 @@ function loan_prepare_head($object) $tab++; if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { + { $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; $head[$tab][1] = $langs->trans("Notes"); diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 7e8bf3ae8d7..4981e0fffd0 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -258,13 +258,13 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='', foreach($object->fields as $key => $val) { $i++; - - $type = $val['type']; + + $type = $val['type']; $type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php' if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database else if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database - else if ($type == 'link' || $type == 'sellist') $type = 'integer'; + else if ($type == 'link' || $type == 'sellist') $type = 'integer'; $texttoinsert.= "\t".$key." ".$type; if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY'; if ($key == 'entity') $texttoinsert.= ' DEFAULT 1'; @@ -343,5 +343,3 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='', return $error ? -1 : 1; } - - diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index eaaa90a710e..2f2b9641c11 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -20,14 +20,14 @@ /** * Returns an array with the tabs for the "salaries" section * It loads tabs from modules looking for the entity salaries - * + * * @param Paiement $object Current salaries object * @return array Tabs for the salaries section */ function salaries_prepare_head($object) { - + global $db, $langs, $conf; - + $h = 0; $head = array(); @@ -57,7 +57,7 @@ function salaries_prepare_head($object) { $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - + complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove'); return $head; diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index b0a30697413..3f09bd3410a 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -64,7 +64,7 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile) && $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){ $hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour'); $mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min'); - $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec'); + $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec'); fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n"); } @@ -520,4 +520,3 @@ function quotedPrintDecode($str) $out = quoted_printable_decode($out); // Available with PHP 4+ return trim($out); } - diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index d04c6a70c04..a76fa073118 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -109,7 +109,7 @@ class modPhpbarcode extends ModeleBarCode * @param string $encoding Mode of encoding * @param string $readable Code can be read * @param integer $scale Scale - * @param integer $nooutputiferror No output if error + * @param integer $nooutputiferror No output if error * @return int <0 if KO, >0 if OK */ function buildBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0) @@ -150,7 +150,7 @@ class modPhpbarcode extends ModeleBarCode * @param string $encoding Mode of encoding * @param string $readable Code can be read * @param integer $scale Scale - * @param integer $nooutputiferror No output if error + * @param integer $nooutputiferror No output if error * @return int <0 if KO, >0 if OK */ function writeBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0) @@ -169,4 +169,3 @@ class modPhpbarcode extends ModeleBarCode } } - diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 5b9422b15e7..9d064ec267c 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -34,7 +34,7 @@ class modTcpdfbarcode extends ModeleBarCode var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $error=''; var $is2d = false; - + /** * Return description of numbering model * @@ -55,8 +55,8 @@ class modTcpdfbarcode extends ModeleBarCode function isEnabled() { return true; - } - + } + /** * Test si les numeros deja en vigueur dans la base ne provoquent pas de * de conflits qui empechera cette numerotation de fonctionner. @@ -66,10 +66,10 @@ class modTcpdfbarcode extends ModeleBarCode function canBeActivated() { global $langs; - + return true; } - + /** * Return true if encoding is supported * @@ -83,7 +83,7 @@ class modTcpdfbarcode extends ModeleBarCode return 0; } else { return 1; - } + } } /** @@ -99,17 +99,17 @@ class modTcpdfbarcode extends ModeleBarCode function buildBarCode($code,$encoding,$readable='Y',$scale=1,$nooutputiferror=0) { global $_GET; - + $tcpdfEncoding = $this->getTcpdfEncodingType($encoding); if (empty($tcpdfEncoding)) return -1; - + $color = array(0,0,0); $_GET["code"]=$code; $_GET["type"]=$encoding; $_GET["height"]=$height; $_GET["readable"]=$readable; - + if ($code) { // Load the tcpdf barcode class if ($this->is2d) { @@ -122,15 +122,15 @@ class modTcpdfbarcode extends ModeleBarCode $width = 1; require_once TCPDF_PATH.'tcpdf_barcodes_1d.php'; $barcodeobj = new TCPDFBarcode($code, $tcpdfEncoding); - } - + } + dol_syslog("buildBarCode::TCPDF.getBarcodePNG"); $barcodeobj->getBarcodePNG($width, $height, $color); - + return 1; } else { return -2; - } + } } /** @@ -172,8 +172,8 @@ class modTcpdfbarcode extends ModeleBarCode $width = 1; require_once TCPDF_PATH.'tcpdf_barcodes_1d.php'; $barcodeobj = new TCPDFBarcode($code, $tcpdfEncoding); - } - + } + dol_syslog("writeBarCode::TCPDF.getBarcodePngData"); if ($imageData = $barcodeobj->getBarcodePngData($width, $height, $color)) { if (function_exists('imagecreate')) { @@ -186,16 +186,16 @@ class modTcpdfbarcode extends ModeleBarCode } } else { return -4; - } + } } else { return -2; } } - + /** * get available output_modes for tcpdf class wth its translated description * - * @param string $dolEncodingType dolibarr barcode encoding type + * @param string $dolEncodingType dolibarr barcode encoding type * @return string tcpdf encoding type */ public function getTcpdfEncodingType($dolEncodingType) @@ -232,7 +232,7 @@ class modTcpdfbarcode extends ModeleBarCode 'PHARMA' => 'PHARMA', 'PHARMA2T' => 'PHARMA2T' ); - + $tcpdf2dEncodingTypes = array( 'DATAMATRIX' => 'DATAMATRIX', 'PDF417' => 'PDF417', @@ -240,9 +240,9 @@ class modTcpdfbarcode extends ModeleBarCode 'QRCODE,L' => 'QRCODE,L', 'QRCODE,M' => 'QRCODE,M', 'QRCODE,Q' => 'QRCODE,Q', - 'QRCODE,H' => 'QRCODE,H' + 'QRCODE,H' => 'QRCODE,H' ); - + if (array_key_exists($dolEncodingType, $tcpdf1dEncodingTypes)) { $this->is2d = false; return $tcpdf1dEncodingTypes[$dolEncodingType]; @@ -251,6 +251,6 @@ class modTcpdfbarcode extends ModeleBarCode return $tcpdf2dEncodingTypes[$dolEncodingType]; } else { return ''; - } + } } } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index c159a7af925..991ae97e8a8 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -44,7 +44,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts function __construct($db) { global $conf,$langs,$mysoc; - + // Load traductions files requiredby by page $langs->loadLangs(array("main", "bills")); @@ -77,7 +77,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Fonction to generate document on disk * - * @param RemiseCheque $object Object RemiseCheque + * @param RemiseCheque $object Object RemiseCheque * @param string $_dir Directory * @param string $number Number * @param Translate $outputlangs Lang output object @@ -91,7 +91,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO $sav_charset_output=$outputlangs->charset_output; if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "companies", "bills", "products", "compta")); @@ -191,7 +191,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + $outputlangs->charset_output=$sav_charset_output; return 1; // Pas d'erreur } @@ -210,7 +210,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts { global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("compta", "banks")); @@ -384,7 +384,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts { $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); } - + return pdf_pagefoot($pdf,$outputlangs,$newfreetext,$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } } diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index bbf20761f5f..9ba039a6487 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -115,7 +115,7 @@ abstract class ModeleNumRefChequeReceipts /** * \class ModeleChequeReceipts - * \brief Classe mere des modeles de + * \brief Classe mere des modeles de */ abstract class ModeleChequeReceipts extends CommonDocGenerator { @@ -209,4 +209,3 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) return -1; } } - diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f43ec0907ca..62fa2c73138 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -43,17 +43,17 @@ class pdf_strato extends ModelePDFContract * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -63,8 +63,8 @@ class pdf_strato extends ModelePDFContract * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -75,32 +75,32 @@ class pdf_strato extends ModelePDFContract * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ @@ -177,7 +177,7 @@ class pdf_strato extends ModelePDFContract 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'; - + // Translations $outputlangs->loadLangs(array("main", "dict", "companies", "contracts")); @@ -537,9 +537,9 @@ class pdf_strato extends ModelePDFContract function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $conf,$langs; - + $default_font_size = pdf_getPDFFontSize($outputlangs); - + // Translations $outputlangs->loadLangs(array("main", "dict", "contract", "companies")); @@ -721,4 +721,3 @@ class pdf_strato extends ModelePDFContract } } - diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index c4c665de56d..63adf232c1b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Class to build sending documents with model Merou + * Class to build sending documents with model Merou */ class pdf_merou extends ModelePdfExpedition { @@ -41,17 +41,17 @@ class pdf_merou extends ModelePdfExpedition * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -61,8 +61,8 @@ class pdf_merou extends ModelePdfExpedition * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -73,37 +73,37 @@ class pdf_merou extends ModelePdfExpedition * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -162,10 +162,10 @@ class pdf_merou extends ModelePdfExpedition 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'; - + // Translations $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); - + if ($conf->expedition->dir_output) { $object->fetch_thirdparty(); @@ -331,7 +331,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetDrawColor(120,120,120); $pdf->Rect(10+3, $curY, 3, 3); $pdf->Rect(20+3, $curY, 3, 3); - + //Insertion de la reference du produit $pdf->SetXY(30, $curY); $pdf->SetFont('','B', $default_font_size - 3); @@ -424,7 +424,7 @@ class pdf_merou extends ModelePdfExpedition @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; } else @@ -456,7 +456,7 @@ class pdf_merou extends ModelePdfExpedition { global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); - + // Translations $langs->loadLangs(array("main", "bills")); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index aad7fd07c1b..84a9831223b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -40,17 +40,17 @@ class pdf_rouget extends ModelePdfExpedition * @var DoliDb Database handler */ public $db; - + /** * @var string model name */ public $name; - + /** * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -60,8 +60,8 @@ class pdf_rouget extends ModelePdfExpedition * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -72,37 +72,37 @@ class pdf_rouget extends ModelePdfExpedition * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -193,7 +193,7 @@ class pdf_rouget extends ModelePdfExpedition 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'; - + // Translations $outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch")); @@ -1100,4 +1100,3 @@ class pdf_rouget extends ModelePdfExpedition } } - diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 539830cdc71..2d6a8850ed8 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -52,7 +52,7 @@ class pdf_standard extends ModeleExpenseReport * @var string model description (short text) */ public $description; - + /** * @var string document type */ @@ -62,8 +62,8 @@ class pdf_standard extends ModeleExpenseReport * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -74,37 +74,37 @@ class pdf_standard extends ModeleExpenseReport * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -120,7 +120,7 @@ class pdf_standard extends ModeleExpenseReport function __construct($db) { global $conf, $langs, $mysoc; - + // Translations $langs->loadLangs(array("main", "trips", "projects")); @@ -208,7 +208,7 @@ class pdf_standard extends ModeleExpenseReport 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'; - + // Translations $outputlangs->loadLangs(array("main", "trips", "projects", "dict")); @@ -567,7 +567,7 @@ class pdf_standard extends ModeleExpenseReport function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { global $conf,$langs,$hookmanager; - + // Translations $outputlangs->loadLangs(array("main", "trips", "companies")); @@ -919,4 +919,3 @@ class pdf_standard extends ModeleExpenseReport } } - diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ba52759ea35..d9fc1ad5a2c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -71,8 +71,8 @@ class pdf_crabe extends ModelePDFFactures * @var array() Minimum version of PHP required by module. * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 4); - + public $phpmin = array(5, 4); + /** * Dolibarr version of the loaded document * @public string @@ -83,37 +83,37 @@ class pdf_crabe extends ModelePDFFactures * @var int page_largeur */ public $page_largeur; - + /** * @var int page_hauteur */ public $page_hauteur; - + /** * @var array format */ public $format; - + /** * @var int marge_gauche */ public $marge_gauche; - + /** * @var int marge_droite */ public $marge_droite; - + /** * @var int marge_haute */ public $marge_haute; - + /** * @var int marge_basse */ public $marge_basse; - + /** * Issuer * @var Societe @@ -1843,4 +1843,3 @@ class pdf_crabe extends ModelePDFFactures } } - diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index e826b18f0e0..86e7eb10521 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -78,7 +78,7 @@ class mod_facture_mercure extends ModeleNumRefFactures $texte.= '
  • '.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('',$tooltip,1,1).'
    '.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('',$tooltip,1,1).'
    -
    '; - + print ''; llxFooter(); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 8ba4eaaecc8..7ef17a4ddd1 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -340,7 +340,7 @@ class Products extends DolibarrApi } if ($result < 0) { - throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); + throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); } return $result; diff --git a/htdocs/product/inventory/ajax/ajax.inventory.php b/htdocs/product/inventory/ajax/ajax.inventory.php index 4884d7ab065..56459ab7be9 100644 --- a/htdocs/product/inventory/ajax/ajax.inventory.php +++ b/htdocs/product/inventory/ajax/ajax.inventory.php @@ -1,51 +1,50 @@ rights->stock->creer)) { echo -1; exit; } - + $fk_det_inventory = GETPOST('fk_det_inventory'); - + $det = new Inventorydet($db); if( $det->fetch( $fk_det_inventory)) { $det->qty_view+=GETPOST('qty'); $res = $det->update($user); - + echo $det->qty_view; } else { echo -2; - } - + } + break; - + case 'pmp': if (empty($user->rights->stock->creer) || empty($user->rights->stock->changePMP)) { echo -1; exit; } - + $fk_det_inventory = GETPOST('fk_det_inventory'); - + $det = new Inventorydet($db); if( $det->fetch( $fk_det_inventory)) { $det->new_pmp=price2num(GETPOST('pmp')); $det->update($user); - + echo $det->new_pmp; } else { echo -2; - } - + } + break; } - diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 8370e8ce080..bb3045e9c66 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -166,7 +166,7 @@ class Productlot extends CommonObject $error++; } } - + if (! $error && ! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you // want this action to call a trigger. @@ -234,7 +234,7 @@ class Productlot extends CommonObject //$this->ref = $obj->fk_product.'_'.$obj->batch; $this->batch = $obj->batch; - $this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity + $this->entity = (!empty($obj->entity)?$obj->entity:$conf->entity); // Prevent "null" entity $this->fk_product = $obj->fk_product; $this->eatby = $this->db->jdate($obj->eatby); $this->sellby = $this->db->jdate($obj->sellby); @@ -300,7 +300,7 @@ class Productlot extends CommonObject // Check parameters // Put here code to add a control on parameters values - + if (empty($this->oldcopy)) { $org=new self($this->db); @@ -340,7 +340,7 @@ class Productlot extends CommonObject $error++; } } - + if (!$error && !$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. @@ -582,4 +582,3 @@ class Productlot extends CommonObject } } - diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 7e15a4f86ac..d0c4b032057 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -1030,7 +1030,7 @@ if ($resql) print ''.'' .$objp->inventorycode @@ -1176,4 +1176,3 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) llxFooter(); $db->close(); - diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 7c18dc11281..2e59e90a280 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -83,7 +83,7 @@ if ($id > 0 || ! empty($ref)) } -if(empty($id) && !empty($object->id)) $id = $object->id; +if(empty($id) && !empty($object->id)) $id = $object->id; $modulepart='product'; @@ -989,8 +989,8 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) print ""; - if (!empty($user->rights->produit->creer)){ - print ''; + if (!empty($user->rights->produit->creer)){ + print ''; } } diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index fc7ffa828e0..d20df866f6a 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -118,14 +118,14 @@ if (! $rowid) { $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); } - foreach ($txn->data as $txn) + foreach ($txn->data as $txn) { //$charge = $txn; //var_dump($txn); - + // The metadata FULLTAG is defined by the online payment page /*$FULLTAG=$charge->metadata->FULLTAG; - + // Save into $tmparray all metadata $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); // Load origin object according to metadata @@ -145,7 +145,7 @@ if (! $rowid) { { $memberstatic->id = 0; }*/ - + $societestatic->fetch($charge->metadata->idcustomer); $societestatic->id = $charge->metadata->idcustomer; $societestatic->lastname = $obj->lastname; @@ -156,7 +156,7 @@ if (! $rowid) { $societestatic->societe_id = $obj->fk_soc; print ''; - + // Ref print "" . $txn->source . "\n"; // Stripe customer diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index 54383d04196..008d99e4cd4 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -18,7 +18,7 @@ CKEDITOR.editorConfig = function( config ) //config.extraPlugins = 'docprops,scayt,showprotected'; config.removeDialogTabs = 'flash:advanced'; // config.removeDialogTabs = 'flash:advanced;image:Link'; config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // Prevent PHP Code to be formatted - //config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea' + //config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea' //config.language = 'de'; //config.defaultLanguage = 'en'; //config.contentsLanguage = 'fr'; @@ -29,7 +29,7 @@ CKEDITOR.editorConfig = function( config ) //config.autoParagraph = false; //config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules //config.forcePasteAsPlainText = true; - + config.toolbar_Full = [ ['Templates','NewPage'], @@ -51,7 +51,7 @@ CKEDITOR.editorConfig = function( config ) ]; // Used for mailing fields - config.toolbar_dolibarr_mailings = + config.toolbar_dolibarr_mailings = [ ['Maximize','Preview'], ['SpellChecker', 'Scayt'], @@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'], ['Source'] ]; - + // Used for notes fields config.toolbar_dolibarr_notes = [ @@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'], ['Source'] ]; - + // Used for details lines config.toolbar_dolibarr_details = [ @@ -91,12 +91,12 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','SpecialChar'], ['Source'] ]; - + // Used for mailing fields config.toolbar_dolibarr_readonly = [ ['Maximize'], ['Find'], ['Source'] - ]; + ]; }; diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js index 54383d04196..008d99e4cd4 100644 --- a/htdocs/theme/md/ckeditor/config.js +++ b/htdocs/theme/md/ckeditor/config.js @@ -18,7 +18,7 @@ CKEDITOR.editorConfig = function( config ) //config.extraPlugins = 'docprops,scayt,showprotected'; config.removeDialogTabs = 'flash:advanced'; // config.removeDialogTabs = 'flash:advanced;image:Link'; config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // Prevent PHP Code to be formatted - //config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea' + //config.menu_groups = 'clipboard,table,anchor,link,image'; // for context menu 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea' //config.language = 'de'; //config.defaultLanguage = 'en'; //config.contentsLanguage = 'fr'; @@ -29,7 +29,7 @@ CKEDITOR.editorConfig = function( config ) //config.autoParagraph = false; //config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules //config.forcePasteAsPlainText = true; - + config.toolbar_Full = [ ['Templates','NewPage'], @@ -51,7 +51,7 @@ CKEDITOR.editorConfig = function( config ) ]; // Used for mailing fields - config.toolbar_dolibarr_mailings = + config.toolbar_dolibarr_mailings = [ ['Maximize','Preview'], ['SpellChecker', 'Scayt'], @@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'], ['Source'] ]; - + // Used for notes fields config.toolbar_dolibarr_notes = [ @@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'], ['Source'] ]; - + // Used for details lines config.toolbar_dolibarr_details = [ @@ -91,12 +91,12 @@ CKEDITOR.editorConfig = function( config ) ['Link','Unlink','SpecialChar'], ['Source'] ]; - + // Used for mailing fields config.toolbar_dolibarr_readonly = [ ['Maximize'], ['Find'], ['Source'] - ]; + ]; }; diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index d41eefcbd39..2ec4c16a8d7 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -117,7 +117,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupCreate - * + * * @return void */ public function testUserGroupCreate() @@ -139,7 +139,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupFetch - * + * * @param int $id Id of group * @return void * @depends testUserGroupCreate @@ -163,7 +163,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupUpdate - * + * * @param Object $localobject Group * @return void * @depends testUserGroupFetch @@ -187,7 +187,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupAddRight - * + * * @param Object $localobject Object to show * @return void * @depends testUserGroupUpdate @@ -210,7 +210,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupDelRight - * + * * @param Object $localobject Object * @return void * @depends testUserGroupAddRight @@ -233,7 +233,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupOther - * + * * @param Object $localobject Object * @return void * @depends testUserGroupDelRight @@ -261,7 +261,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupDelete - * + * * @param int $id Id of object * @return void * @depends testUserGroupOther From 526ea496ee3c0392af89e97802dbbdd9b27c4deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 26 Jul 2018 19:26:03 +0200 Subject: [PATCH 08/91] trim trailing --- htdocs/core/class/commonobjectline.class.php | 3 +- htdocs/core/class/vcard.class.php | 2 +- htdocs/core/js/lib_photosresize.js | 2 +- htdocs/core/js/listview.js | 76 ++++++++++---------- htdocs/core/js/timesheet.js | 58 ++++++++------- 5 files changed, 69 insertions(+), 72 deletions(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index bed227eb408..91d4245ff88 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -53,7 +53,7 @@ abstract class CommonObjectLine extends CommonObject /** * Returns the translation key from units dictionary. * A langs->trans() must be called on result to get translated value. - * + * * @param string $type Label type (long or short) * @return string|int <0 if ko, label if ok */ @@ -94,4 +94,3 @@ abstract class CommonObjectLine extends CommonObject // For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits. } - diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 8bdeb3e43b7..abd63fa5ef4 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -155,7 +155,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'); } diff --git a/htdocs/core/js/lib_photosresize.js b/htdocs/core/js/lib_photosresize.js index 9c4c6671b1e..35511746f21 100644 --- a/htdocs/core/js/lib_photosresize.js +++ b/htdocs/core/js/lib_photosresize.js @@ -22,7 +22,7 @@ /* Enable jcrop plugin onto id cropbox */ jQuery(function() { jQuery('#cropbox').Jcrop({ - onSelect: updateCoords, + onSelect: updateCoords, onChange: updateCoords }); }); diff --git a/htdocs/core/js/listview.js b/htdocs/core/js/listview.js index de3113d0fae..f5ee0af6568 100644 --- a/htdocs/core/js/listview.js +++ b/htdocs/core/js/listview.js @@ -22,28 +22,28 @@ var Listview_include = true; function Listview_OrderDown(idListe, column) { var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url = Listview_removeParam(base_url,'Listview['+encodeURIComponent(idListe)+'][orderBy]'); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][orderBy]["+encodeURIComponent(column)+"]","DESC"); } function Listview_OrderUp(idListe, column) { - + var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url = Listview_removeParam(base_url,'Listview['+encodeURIComponent(idListe)+'][orderBy]'); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][orderBy]["+encodeURIComponent(column)+"]","ASC"); } function Listview_modifyUrl(strURL,paramName,paramNewValue){ if (strURL.indexOf(paramName+'=')!=-1){ - + var strFirstPart=strURL.substring(0,strURL.indexOf(paramName+'=',0))+paramName+'='; var strLastPart=""; if (strURL.indexOf('&',strFirstPart.length-1)>0) @@ -56,55 +56,55 @@ function Listview_modifyUrl(strURL,paramName,paramNewValue){ else strURL+='?'+paramName+'='+paramNewValue; } - + return strURL; } function Listview_removeParam(strURL, paramMask) { var cpt=0; var url = ''; - + while(strURL.indexOf(paramMask)!=-1 && cpt++ <50){ var strFirstPart= strURL.substring(0,strURL.indexOf(paramMask)-1); - + var strLastPart=''; if (strURL.indexOf('&',strFirstPart.length+1)>0) { - strLastPart = strURL.substring(strURL.indexOf('&',strFirstPart.length+1),strURL.length); + strLastPart = strURL.substring(strURL.indexOf('&',strFirstPart.length+1),strURL.length); } - + url = strFirstPart+strLastPart; - + } - + if(url=='')url = strURL; - + return url; } function Listview_recup_form_param(idListe,base_url) { - + $('#'+idListe+' tr.barre-recherche [listviewtbs],#'+idListe+' tr.barre-recherche-head input,#'+idListe+' tr.barre-recherche-head select,#'+idListe+' div.tabsAction input[listviewtbs]').each(function(i,item) { if($(item).attr("name")) { base_url = Listview_modifyUrl(base_url, $(item).attr("name") , $(item).val()); } - + }); - + return base_url; } function Listview_GoToPage(idListe,pageNumber){ - + var base_url = document.location.href; - + base_url = Listview_recup_form_param(idListe,base_url); base_url =Listview_modifyUrl(base_url,"Listview["+encodeURIComponent(idListe)+"][page]",pageNumber); - + base_url = Listview_removeParam(base_url,'get-all-for-export'); - + document.location.href=base_url; } function Listview_submitSearch(obj) { - + $form = $(obj).closest('form'); console.log($form); if($form.length>0){ @@ -113,20 +113,20 @@ function Listview_submitSearch(obj) { } function Listview_launch_downloadAs(mode,url,token,session_name) { $('#listviewdAS_export_form').remove(); - + $form = $('
    '); $form.append(''); $form.append(''); $form.append(''); - + $('body').append($form); - + $('#listviewdAS_export_form').submit(); - + } function Listview_downloadAs(obj, mode,url,token,session_name) { - + $form = $(obj).closest('form'); $div = $form.find('div.tabsAction'); $div.append(''); @@ -134,33 +134,33 @@ function Listview_downloadAs(obj, mode,url,token,session_name) { $div.append(''); $div.append(''); $div.append(''); - + Listview_submitSearch(obj); } $(document).ready(function() { $('tr.barre-recherche input').keypress(function(e) { if(e.which == 13) { - + var id_list = $(this).closest('table').attr('id'); - + $('#'+id_list+' .list-search-link').click(); - + } }); - + var $_GET = {}; - + document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } - + $_GET[decode(arguments[1])] = decode(arguments[2]); }); - + if(typeof $_GET["get-all-for-export"] != "undefined") { Listview_launch_downloadAs($_GET['mode'],$_GET['url'],$_GET['token'],$_GET['session_name']); } - + }); diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index de8b24af96c..44180b42acb 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -24,9 +24,9 @@ function regexEvent(objet,evt,type) { case 'days': var regex= /^[0-9]{1}([.,]{1}[0-9]{1})?$/; - + if(regex.test(objet.value) ) - { + { var tmp=objet.value.replace(',','.'); if(tmp<=1.5){ var tmpint=parseInt(tmp); @@ -41,13 +41,13 @@ function regexEvent(objet,evt,type) }else{ objet.value= '0'; } - break; + break; case 'hours': var regex= /^[0-9]{1,2}:[0-9]{2}$/; var regex2=/^[0-9]{1,2}$/; var regex3= /^[0-9]{1}([.,]{1}[0-9]{1,2})?$/; if(!regex.test(objet.value)) - { + { if(regex2.test(objet.value)) objet.value=objet.value+':00'; else if(regex3.test(objet.value)) { @@ -63,25 +63,25 @@ function regexEvent(objet,evt,type) //var regex= /^[0-9:]{1}$/; //alert(event.charCode); var charCode = (evt.which) ? evt.which : event.keyCode; - + if(((charCode >= 48) && (charCode <= 57)) || //num (charCode===46) || (charCode===8)||// comma & periode (charCode === 58) || (charCode==44) )// : & all charcode { // ((charCode>=96) && (charCode<=105)) || //numpad return true; - + }else { return false; } - - break; + + break; default: break; } -} - +} + function pad(n) { return (n < 10) ? ("0" + n) : n; @@ -95,7 +95,7 @@ function parseTime(timeStr, dt) if (!dt) { dt = new Date(); } - + var time = timeStr.match(/(\d+)(?::(\d\d))?\s*(p?)/i); if (!time) { return -1; @@ -107,7 +107,7 @@ function parseTime(timeStr, dt) else { hours += (hours < 12 && time[3]) ? 12 : 0; } - + dt.setHours(hours); dt.setMinutes(parseInt(time[2], 10) || 0); dt.setSeconds(0, 0); @@ -122,10 +122,10 @@ function updateTotal(days,mode) { var total = new Date(0); total.setHours(0); - total.setMinutes(0); + total.setMinutes(0); var nbline = document.getElementById('numberOfLines').value; for (var i=-1; i Date: Thu, 26 Jul 2018 20:19:52 +0200 Subject: [PATCH 09/91] trim trailing --- dev/initdata/import-products.php | 40 +++++++++---------- dev/initdata/import-users.php | 20 +++++----- dev/initdemo/updatedemo.php | 10 ++--- htdocs/comm/mailing/advtargetemailing.php | 14 +++---- .../comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/core/class/dolreceiptprinter.class.php | 20 +++++----- .../core/triggers/dolibarrtriggers.class.php | 2 +- htdocs/don/tpl/linkedobjectblock.tpl.php | 4 +- htdocs/variants/generator.php | 12 +++--- test/phpunit/ChargeSocialesTest.php | 18 ++++----- 10 files changed, 71 insertions(+), 71 deletions(-) diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 942e6f8f5d7..0f4856aefb2 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-product.php - * \brief Script example to insert products from a csv file. + * \brief Script example to insert products from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $i++; $errorrecord=0; - + if ($startlinenb && $i < $startlinenb) continue; if ($endlinenb && $i > $endlinenb) continue; - + $nboflines++; - + $produit = new Product($db); $produit->type = 0; $produit->status = 1; $produit->ref = trim($fields[0]); - + print "Process line nb ".$i.", ref ".$produit->ref; $produit->label = trim($fields[2]); $produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : '')); $produit->volume = price2num($fields[8]); - $produit->volume_unit = 0; + $produit->volume_unit = 0; $produit->weight = price2num($fields[9]); $produit->weight_units = 0; // -3 = g @@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $produit->status = 1; $produit->status_buy = 1; - + $produit->finished = 1; - + $produit->price_min = null; $produit->price_min_ttc = null; $produit->price = price2num($fields[11]); @@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $produit->price_base_type = 'TTC'; $produit->tva_tx = price2num($fields[13]); $produit->tva_npr = 0; - + $produit->cost_price = price2num($fields[16]); - + // Extrafields $produit->array_options['options_ecotaxdeee']=price2num($fields[17]); - + $ret=$produit->create($user); if ($ret < 0) { print " - Error in create result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with ref ".$produit->ref." - id = ".$ret; } dol_syslog("Add prices"); - + // If we use price level, insert price for each level if (! $errorrecord && 1) { @@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - updatePrice OK"; } } - + dol_syslog("Add multilangs"); - + // Add alternative languages if (! $errorrecord && 1) { @@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString(); $errorrecord++; } - else + else { print " - setMultiLangs OK"; } } - + print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index 72a006bbe29..c94f74341f6 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -21,7 +21,7 @@ /** * \file dev/initdata/import-thirdparties.php - * \brief Script example to insert thirdparties from a csv file. + * \brief Script example to insert thirdparties from a csv file. * To purge data, you can have a look at purge-data.php */ @@ -118,15 +118,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $i++; $errorrecord=0; - + if ($startlinenb && $i < $startlinenb) continue; if ($endlinenb && $i > $endlinenb) continue; - + $nboflines++; - + $object = new User($db); $object->statut = 1; - + $tmp=explode(' ',$fields[3],2); $object->firstname = trim($tmp[0]); $object->lastname = trim($tmp[1]); @@ -134,23 +134,23 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) else $object->login=strtolower($object->firstname); $object->login=preg_replace('/ /','',$object->login); $object->password = 'init'; - + print "Process line nb ".$i.", login ".$object->login; - + $ret=$object->create($user); if ($ret < 0) { print " - Error in create result code = ".$ret." - ".$object->errorsToString(); $errorrecord++; } - else + else { print " - Creation OK with login ".$object->login." - id = ".$ret; } print "\n"; - - if ($errorrecord) + + if ($errorrecord) { fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n"); $error++; // $errorrecord will be reset diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index ef37e25c04f..53717314d5f 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * or see http://www.gnu.org/ - * + * * Get a distant dump file and load it into a mysql database */ @@ -74,7 +74,7 @@ $tables=array( $year=2010; $currentyear=$tmp['year']; -while ($year <= $currentyear) +while ($year <= $currentyear) { //$year=2021; $delta=($currentyear - $year); @@ -84,7 +84,7 @@ while ($year <= $currentyear) { foreach($tables as $tablekey => $tableval) { - print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." "; + print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." "; $sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)"; //$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()"; $resql = $db->query($sql); @@ -110,14 +110,14 @@ while ($year <= $currentyear) //print $sql2."\n"; $resql2 = $db->query($sql2); if (! $resql2) dol_print_error($db); - } + } $i++; } } else dol_print_error($db); } } - + $year++; } diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index b63ffac6efd..e0b451b1290 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -84,11 +84,11 @@ if (empty($template_id)) { $result = $advTarget->fetch($template_id); } -if ($result < 0) +if ($result < 0) { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); -} -else +} +else { if (! empty($advTarget->id)) { $array_query = json_decode($advTarget->filtervalue, true); @@ -225,7 +225,7 @@ if ($action == 'add') { } else { $advTarget->contact_lines = array (); } - + if ((count($advTarget->thirdparty_lines) > 0) || (count($advTarget->contact_lines) > 0)) { // Add targets into database $obj = new mailing_advthirdparties($db); @@ -359,7 +359,7 @@ if ($action == 'savefilter' || $action == 'createfilter') { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); } } elseif ($action == 'savefilter') { - + $result = $advTarget->update($user); if ($result < 0) { setEventMessages($advTarget->error, $advTarget->errors, 'errors'); @@ -465,9 +465,9 @@ if ($object->fetch($id) >= 0) { // Show email selectors if ($object->statut == 0 && $user->rights->mailing->creer) { - + include DOL_DOCUMENT_ROOT . '/core/tpl/advtarget.tpl.php'; - + } } diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index cd49ca863e6..724e0bcce15 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -57,7 +57,7 @@ foreach($linkedObjectBlock as $key => $objectlink) global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; - print ' '; + print ' '; } ?> diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 2499176b58b..c09aaad16e8 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -45,7 +45,7 @@ * Cut ticket partially * Open cash drawer * Activate buzzer - * + * * Code which can be placed everywhere * Print QR Code * Print date AAAA-MM-DD @@ -94,7 +94,7 @@ require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/Escpos.php'; - + /** * Class to manage Receipt Printers */ @@ -300,16 +300,16 @@ class dolReceiptPrinter extends Escpos function selectTypePrinter($selected='', $htmlname='printertypeid') { global $langs; - + $options = array( 1 => $langs->trans('CONNECTOR_DUMMY'), 2 => $langs->trans('CONNECTOR_FILE_PRINT'), 3 => $langs->trans('CONNECTOR_NETWORK_PRINT'), 4 => $langs->trans('CONNECTOR_WINDOWS_PRINT') ); - + $this->resprint = Form::selectarray($htmlname, $options, $selected); - + return 0; } @@ -324,7 +324,7 @@ class dolReceiptPrinter extends Escpos function selectProfilePrinter($selected='', $htmlname='printerprofileid') { global $langs; - + $options = array( 0 => $langs->trans('PROFILE_DEFAULT'), 1 => $langs->trans('PROFILE_SIMPLE'), @@ -332,7 +332,7 @@ class dolReceiptPrinter extends Escpos 3 => $langs->trans('PROFILE_P822D'), 4 => $langs->trans('PROFILE_STAR') ); - + $this->profileresprint = Form::selectarray($htmlname, $options, $selected); return 0; } @@ -520,11 +520,11 @@ class dolReceiptPrinter extends Escpos $ret = $this->InitPrinter($printerid); if ($ret>0) { setEventMessages($this->error, $this->errors, 'errors'); - } - else + } + else { $nboflines = count($vals); - for ($line=0; $line < $nboflines; $line++) + for ($line=0; $line < $nboflines; $line++) { switch ($vals[$line]['tag']) { case 'DOL_ALIGN_CENTER': diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php index 61a89b083f8..a93cb041c5b 100644 --- a/htdocs/core/triggers/dolibarrtriggers.class.php +++ b/htdocs/core/triggers/dolibarrtriggers.class.php @@ -84,7 +84,7 @@ abstract class DolibarrTriggers $this->db = $db; - if (empty($this->name)) + if (empty($this->name)) { $this->name = preg_replace('/^Interface/i', '', get_class($this)); } diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php index d7ad6587845..f8d51bb6e35 100644 --- a/htdocs/don/tpl/linkedobjectblock.tpl.php +++ b/htdocs/don/tpl/linkedobjectblock.tpl.php @@ -36,7 +36,7 @@ $total=0; $ilink=0; foreach($linkedObjectBlock as $key => $objectlink) { $ilink++; - + $trclass='oddeven'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; ?> @@ -66,7 +66,7 @@ if (count($linkedObjectBlock) > 1) - diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index 4daa2d8f45a..468b04ac392 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -103,7 +103,7 @@ if ($_POST) { $res = 1; - foreach (cartesianArray($adapted_values) as $currcomb) + foreach (cartesianArray($adapted_values) as $currcomb) { $res = $combination->createProductCombination($product, $currcomb, $sanitized_values, $price_var_percent); if ($res < 0) { @@ -146,17 +146,17 @@ if (! empty($id) || ! empty($ref)) { { $showbarcode=empty($conf->barcode->enabled)?0:1; if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) $showbarcode=0; - + $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); $picto=($object->type== Product::TYPE_SERVICE?'service':'product'); dol_fiche_head($head, 'combinations', $titre, 0, $picto); - + $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter=" fk_product_type = ".$object->type; - + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1); - + dol_fiche_end(); } @@ -375,4 +375,4 @@ if (! empty($id) || ! empty($ref)) { Date: Thu, 26 Jul 2018 20:21:33 +0200 Subject: [PATCH 10/91] trim trailing --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1a231eb3f1..31c720e58e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -291,11 +291,11 @@ script: - | echo "Checking coding style" # Ensure we catch errors - #set -e + set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . - #set +e + set +e echo # TODO: Check Javascript (jshint?) From 69321c47be54cb65e2d13d2646f500ca08de074a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 7 Aug 2018 17:11:41 +0200 Subject: [PATCH 11/91] correct space --- htdocs/public/ticket/create_ticket.php | 18 +++++------------- htdocs/public/ticket/list.php | 3 +-- htdocs/public/ticket/view.php | 3 +-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index c3c4979a843..d451d96d011 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -226,12 +226,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error || $mailfile->errors) - { + if ($mailfile->error || $mailfile->errors) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } - else - { + } else { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -290,12 +287,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error || $mailfile->errors) - { + if ($mailfile->error || $mailfile->errors) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } - else - { + } else { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { @@ -316,9 +310,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); } - } - else - { + } else { setEventMessages($object->error, $object->errors, 'errors'); } } diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index fe1dacbbbc7..5ab17fedba2 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -121,8 +121,7 @@ if ($action == "view_ticketlist") { } } - if ($error || $errors) - { + if ($error || $errors) { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 38fcb3c4991..b2bb0100d6d 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -112,8 +112,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" | } } - if ($error || $errors) - { + if ($error || $errors) { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } From 5f4d54ede58d012dcdb9cbe2bc3f502e41f72ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 7 Aug 2018 17:17:58 +0200 Subject: [PATCH 12/91] correct space --- .../triggers/interface_50_modTicket_TicketEmail.class.php | 7 ++----- htdocs/fourn/commande/card.php | 4 +--- htdocs/fourn/facture/card.php | 4 +--- htdocs/product/price.php | 8 ++------ htdocs/ticket/class/ticket.class.php | 7 ++----- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 3e28ea3e4ef..3d572d9fcbb 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -152,12 +152,9 @@ class InterfaceTicketEmail extends DolibarrTriggers } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); - if ($mailfile->error) - { + if ($mailfile->error) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } - else - { + } else { $result = $mailfile->sendfile(); } if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bab095fe6fa..6dd13b4cb7d 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -350,9 +350,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else - { + } else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index aefd04914ad..e8046aa9bd8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1160,9 +1160,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; - } - else - { + } else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error ++; } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e68730acf64..75bed6b0163 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -464,9 +464,7 @@ if (empty($reshook)) $sql .= " WHERE rowid = " . $rowid; $result = $db->query($sql); - } - else - { + } else { setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } @@ -479,9 +477,7 @@ if (empty($reshook)) $sql .= " WHERE fk_product_price = " . $priceid; $result = $db->query($sql); - } - else - { + } else { setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); } } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1fde15c5b29..b9fbfdb5979 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1614,12 +1614,9 @@ class Ticket extends CommonObject } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error || $mailfile->errors) - { + if ($mailfile->error || $mailfile->errors) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } - else - { + } else { $result = $mailfile->sendfile(); if ($result > 0) { $nb_sent++; From 6113b536a0428e5070c56eb800c1fccdc3dbb62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 12 Aug 2018 19:59:39 +0200 Subject: [PATCH 13/91] remove superfluous spaces --- htdocs/accountancy/admin/importaccounts.php | 12 ++++++------ htdocs/comm/action/class/actioncomm.class.php | 5 ++--- htdocs/core/js/blockUI.js | 8 ++++---- htdocs/core/tpl/advtarget.tpl.php | 6 +++--- htdocs/resource/list.php | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 8f6090d7c8f..752e1c18de9 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ */ /** - * \file htdocs/accountancy/admin/importaccounts.php + * \file htdocs/accountancy/admin/importaccounts.php * \ingroup Advanced accountancy * \brief Page import accounting account */ @@ -83,7 +83,7 @@ if ($_POST["action"] == 'import') { $accounting->pcg_type = $monType; $accounting->pcg_subtype = $monSubType; $accounting->active = 1; - + $result = $accounting->create($user); if ($result > 0) { setEventMessages($langs->trans("AccountingAccountAdd"), null, 'mesgs'); @@ -101,7 +101,7 @@ if ($_POST["action"] == 'import') { print '
    ' . $langs->trans("EndProcessing") . '
    '; } -// list accounting account from product +// list accounting account from product $sql = "(SELECT p.rowid as product_id, p.accountancy_code_sell as accounting "; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p "; @@ -172,9 +172,9 @@ if ($result) { print ''; $i ++; } - + print ' '; - + print ''; print ''; } else { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6c863580203..65b19c55387 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI - * + * * 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 @@ -1223,7 +1223,7 @@ class ActionComm extends CommonObject if ((!$user->rights->agenda->allactions->read && $this->author->id != $user->id) || (!$user->rights->agenda->myactions->read && $this->author->id == $user->id)) $option = 'nolink'; - + $label = $this->label; if (empty($label)) $label=$this->libelle; // For backward compatibility @@ -1679,4 +1679,3 @@ class ActionComm extends CommonObject } } - diff --git a/htdocs/core/js/blockUI.js b/htdocs/core/js/blockUI.js index 6abcc706e25..20c2bd348d4 100644 --- a/htdocs/core/js/blockUI.js +++ b/htdocs/core/js/blockUI.js @@ -41,7 +41,7 @@ $(document).ready(function() { '-moz-border-radius': '10px', 'border-radius': '10px' }, - + // styles applied when using $.growlUI dolEventErrorCSS: { width: '350px', @@ -60,7 +60,7 @@ $(document).ready(function() { } };*/ - + $.dolEventValid = function(title, message, timeout, onClose) { var $m = $('
    '); if (title) $m.append('

    '+title+'

    '); @@ -73,7 +73,7 @@ $(document).ready(function() { css: $.blockUI.events.dolEventValidCSS }); }; - + $.dolEventError = function(title, message, timeout, onClose) { var $m = $('
    '); if (title) $m.append('

    '+title+'

    '); @@ -87,7 +87,7 @@ $(document).ready(function() { }); $('.dolEventError').click($.unblockUI); }; - + $.pleaseBePatient = function(message) { $.blockUI({ message: message, diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index a25abbdde6a..05db2d46fd3 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -1,6 +1,6 @@ }); }); '; - - + + print_fiche_titre($langs->trans("AdvTgtTitle")); print '
    ' . "\n"; diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 7ca7ed21295..4bb3e0d0923 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2018 Nicolas ZABOURI - * + * * 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 From 5d0d8d10fc255d094fb363c0de88fb593c35ee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 13 Aug 2018 09:00:22 +0200 Subject: [PATCH 14/91] remove superfluous spaces --- htdocs/blockedlog/admin/blockedlog_list.php | 2 +- htdocs/public/stripe/ipn.php | 67 ++++++++++----------- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 7693063a517..3fd68b836f3 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -131,7 +131,7 @@ else if (GETPOST('downloadcsv','alpha')) { // Make the first fetch to get first line $obj = $db->fetch_object($res); - if ($obj) + if ($obj) { $previoushash = $block_static->getPreviousHash(0, $obj->rowid); $firstid = $obj->rowid; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index d088476ccc2..daa286b7e09 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -40,13 +40,13 @@ if (isset($_GET['connect'])){ { $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY; $service = 'StripeTest'; - $servicestatus = 0; + $servicestatus = 0; } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $service = 'StripeLive'; - $servicestatus = 1; + $servicestatus = 1; } } else { @@ -54,13 +54,13 @@ else { { $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY; $service = 'StripeTest'; - $servicestatus = 0; + $servicestatus = 0; } else { $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $service = 'StripeLive'; - $servicestatus = 1; + $servicestatus = 1; } } $payload = @file_get_contents("php://input"); @@ -228,35 +228,35 @@ elseif ($event->type == 'charge.failed') { } elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) { - $fulltag=$event->data->object->metadata->FULLTAG; + $fulltag=$event->data->object->metadata->FULLTAG; // Save into $tmptag all metadata $tmptag=dolExplodeIntoArray($fulltag,'.','='); - - if (! empty($tmptag['ORD'])){ - $order=new Commande($db); - $order->fetch('',$tmptag['ORD']); - $origin='order'; - $item=$order->id; - } elseif (! empty($tmptag['INV'])) { - $invoice = new Facture($db); - $invoice->fetch('',$tmptag['INV']); - $origin='invoice'; - $item=$invoice->id; - } - $stripe=new Stripe($db); - $stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here) - $stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_... + if (! empty($tmptag['ORD'])) { + $order=new Commande($db); + $order->fetch('',$tmptag['ORD']); + $origin='order'; + $item=$order->id; + } elseif (! empty($tmptag['INV'])) { + $invoice = new Facture($db); + $invoice->fetch('',$tmptag['INV']); + $origin='invoice'; + $item=$invoice->id; + } + + $stripe=new Stripe($db); + $stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here) + $stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_... $charge=$stripe->createPaymentStripe($event->data->object->amount/100,$event->data->object->currency,$origin,$item,$event->data->object->id,$stripecu,$stripeacc,$servicestatus); - - if (isset($charge->id) && $charge->statut=='error'){ + + if (isset($charge->id) && $charge->statut=='error') { $msg=$charge->message; $code=$charge->code; $error++; - } + } elseif (isset($charge->id) && $charge->statut=='success' && (! empty($tmptag['ORD']))) { - //$order=new Commande($db); - //$order->fetch('',$tmptag['ORD']); + //$order=new Commande($db); + //$order->fetch('',$tmptag['ORD']); $invoice = new Facture($db); $idinv=$invoice->createFromOrder($order,$user); @@ -272,17 +272,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type == $ifverif=$invoice->socid; $currency=$invoice->multicurrency_code; $total=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); - }else{ + } else { $msg=$invoice->error; $error++; } - }else{ + } else { $msg=$invoice->error; $error++; } } - if (!$error){ + if (!$error) { $datepaye = dol_now(); $paymentType ="CB"; $amounts=array(); @@ -298,10 +298,10 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type == $paiement->note = ''; } - if (! $error){ + if (! $error) { $paiement_id=$paiement->create($user, 0); - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)){ + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)) { $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); @@ -315,17 +315,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type == $invoice->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - if ($paiement_id < 0){ + if ($paiement_id < 0) { $msg=$paiement->errors; $error++; - }else{ + } else { if ($event->data->object->metadata->source=='order') { $order->classifyBilled($user); } } } - if (! $error){ + if (! $error) { $label='(CustomerInvoicePayment)'; if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)'; $paiement->addPaymentToBank($user,'payment',$label,$conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS,'',''); @@ -348,4 +348,3 @@ elseif ($event->type == 'customer.deleted') { $db->query($sql); $db->commit(); } - From 5146ab9177fc174608633ddd621262c43f6799c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Aug 2018 15:34:44 +0200 Subject: [PATCH 15/91] trim --- htdocs/admin/company.php | 4 +-- .../class/PSWebServiceLibrary.class.php | 7 ++-- htdocs/admin/ihm.php | 34 +++++++++--------- htdocs/admin/ldap_members.php | 4 +-- htdocs/admin/limits.php | 8 ++--- htdocs/admin/mails.php | 36 +++++++++---------- htdocs/admin/mails_emailing.php | 12 +++---- htdocs/admin/menus.php | 6 ++-- htdocs/admin/pdf.php | 36 +++++++++---------- htdocs/admin/sms.php | 8 ++--- htdocs/core/class/commonobject.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/public/members/new.php | 4 +-- test/phpunit/CoreTest.php | 16 ++++----- 14 files changed, 90 insertions(+), 89 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 4a006c56268..7bc968457f9 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -188,7 +188,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); } if($_POST["optionlocaltax2"]=="localtax2on") { @@ -200,7 +200,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); } if ($action != 'updateedit' && ! $error) diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index c6e33023e4c..b1bac5ce84a 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -70,8 +70,9 @@ class PrestaShopWebservice * @param mixed $debug Debug mode Activated (true) or deactivated (false) */ function __construct($url, $key, $debug = true) { - if (!extension_loaded('curl')) - throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library'); + if (!extension_loaded('curl')) { + throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library'); + } $this->url = $url; $this->key = $key; $this->debug = $debug; @@ -383,7 +384,7 @@ class PrestaShopWebservice else throw new PrestaShopWebserviceException('Bad parameters given'); - $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); + $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); self::checkStatusCode($request['status_code']);// check the response validity return self::parseXML($request['response']); } diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 2eddf30ab90..4cb5a907927 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -79,10 +79,10 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); @@ -133,21 +133,21 @@ if ($action == 'update') if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 240901ec04d..2f36f239257 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -80,9 +80,9 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"),'chaine',0,'',$conf->entity)) $error++; // Subscriptions - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT',GETPOST("fieldfirstsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; // This one must be after the others diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index d24891f80f6..f9fe219afef 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -66,11 +66,11 @@ if ($action == 'update') if (! $error) { - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 4ad7a74bcb9..3576ec845d1 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -65,27 +65,27 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity); // Send mode parameters - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY"), 'chaine', 0, '', $conf->entity); // Content parameters - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index dd123a70a00..59fc0ade0cd 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -61,12 +61,12 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { // Send mode parameters - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 225860e78ad..09907652df0 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -64,10 +64,10 @@ if ($action == 'update' && ! $cancel) { $_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer - dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); // Define list of menu handlers to initialize diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 9acea7e3955..52ffa53ad59 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -54,29 +54,29 @@ if ($cancel) { if ($action == 'update') { - dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"],'chaine',0,'', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'', $conf->entity); - dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'', $conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 9c4338416f6..45071117c89 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -48,12 +48,12 @@ $action=GETPOST('action','aZ09'); if ($action == 'update' && empty($_POST["cancel"])) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", $_POST["MAIN_DISABLE_ALL_SMS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", $_POST["MAIN_DISABLE_ALL_SMS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SMS_SENDMODE", $_POST["MAIN_SMS_SENDMODE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SMS_SENDMODE", $_POST["MAIN_SMS_SENDMODE"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"],'chaine',0,'',$conf->entity); - //dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"], 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 72ef472229d..7ce88151000 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1828,7 +1828,7 @@ abstract class CommonObject case 'order_supplier': $this->updateline( $line->id, ($line->description?$line->description:$line->desc), $line->subprice, $line->qty, $line->remise_percent, - $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false, + $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice ); break; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d19f8f86732..ea2d17075c5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3649,7 +3649,7 @@ class Product extends CommonObject $result.=$linkstart; if ($withpicto) { if ($this->type == Product::TYPE_PRODUCT) $result.=(img_object(($notooltip?'':$label), 'product', ($notooltip?'class="paddingright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); - if ($this->type == Product::TYPE_SERVICE) $result.=(img_object(($notooltip?'':$label), 'service', ($notooltip?'class="paddinright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); + if ($this->type == Product::TYPE_SERVICE) $result.=(img_object(($notooltip?'':$label), 'service', ($notooltip?'class="paddinright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); } $result.= $newref; $result.= $linkend; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index b92e84b8352..5edf85f9dac 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -546,7 +546,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) $isempty=1; if (count($listoftype)==1) { $defaulttype=$tmp[0]; $isempty=0; } print ''.$langs->trans("Type").' *'; - print $form->selectarray("type", $adht->liste_array(), GETPOST('type')?GETPOST('type'):$defaulttype, $isempty); + print $form->selectarray("type", $adht->liste_array(), GETPOST('type')?GETPOST('type'):$defaulttype, $isempty); print ''."\n"; } else @@ -561,7 +561,7 @@ $morphys["mor"] = $langs->trans("Moral"); if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''.$langs->trans('Nature').' *'."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print ''."\n"; } else diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 54ebca5ac67..31c682bafee 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -263,14 +263,14 @@ class CoreTest extends PHPUnit_Framework_TestCase // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) if ($type != 2) { - $inj += preg_match('/delete\s+from/i', $val); - $inj += preg_match('/create\s+table/i', $val); - $inj += preg_match('/update.+set.+=/i', $val); - $inj += preg_match('/insert\s+into/i', $val); - $inj += preg_match('/select.+from/i', $val); - $inj += preg_match('/union.+select/i', $val); - $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); - $inj += preg_match('/(\.\.%2f)+/i', $val); + $inj += preg_match('/delete\s+from/i', $val); + $inj += preg_match('/create\s+table/i', $val); + $inj += preg_match('/update.+set.+=/i', $val); + $inj += preg_match('/insert\s+into/i', $val); + $inj += preg_match('/select.+from/i', $val); + $inj += preg_match('/union.+select/i', $val); + $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); + $inj += preg_match('/(\.\.%2f)+/i', $val); } // For XSS Injection done by adding javascript with script // This is all cases a browser consider text is javascript: From 2bb4c30aace8605151c29a599dfa5a1dc24dc9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 14 Aug 2018 15:59:15 +0200 Subject: [PATCH 16/91] remove superfluous space --- htdocs/public/payment/newpayment.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2625cf6d438..45aeb0d1321 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -441,15 +441,15 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $service = 'StripeLive'; $servicestatus = 1; } - + $thirdparty = new Societe($db); $thirdparty->fetch($thirdparty_id); // Create Stripe customer include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; - $stripe = new Stripe($db); - $stripeacc = $stripe->getStripeAccount($service); + $stripe = new Stripe($db); + $stripeacc = $stripe->getStripeAccount($service); $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); // Create Stripe card from Token @@ -1694,4 +1694,3 @@ htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix,$object); llxFooter('', 'public'); $db->close(); - From c8c8af55a0be9d1ea624c8f512a31e9093f4b9b6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 18 Aug 2018 15:56:23 +0200 Subject: [PATCH 17/91] Typo --- .../comm/mailing/class/html.formadvtargetemailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 7408bb27d37..c59f5449e37 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -16,9 +16,9 @@ */ /** - * \file comm/mailing/class/html.formadvtragetemaling.class.php + * \file comm/mailing/class/html.formadvtragetemailing.class.php * \ingroup mailing - * \brief Fichier de la classe des fonctions predefinie de composants html advtargetemaling + * \brief Fichier de la classe des fonctions predefinies de composant html advtargetemailing */ /** From ccdae4c597b0439c52953fb826897db8bfe005d4 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 18 Aug 2018 19:15:25 +0200 Subject: [PATCH 18/91] Update html.formadvtargetemailing.class.php --- .../comm/mailing/class/html.formadvtargetemailing.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index c59f5449e37..13f8957df44 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -16,7 +16,7 @@ */ /** - * \file comm/mailing/class/html.formadvtragetemailing.class.php + * \file comm/mailing/class/html.formadvtargetemailing.class.php * \ingroup mailing * \brief Fichier de la classe des fonctions predefinies de composant html advtargetemailing */ @@ -460,4 +460,4 @@ class FormAdvTargetEmailing extends Form $this->db->free ( $resql ); return $out; } -} \ No newline at end of file +} From ca6461ea2d47244e44afb1cc4600bb6093a0fa73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Aug 2018 14:30:06 +0200 Subject: [PATCH 19/91] align parameters --- htdocs/website/class/websitepage.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index d816d1564bb..4aa83670a48 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -126,8 +126,8 @@ class WebsitePage extends CommonObject * Load object in memory from the database * * @param int $id Id object. - * If this is 0, the value into $page will be used. If not found of $page not defined, the default page of website_id will be used or the first page found if not set. - * If value is < 0, we must exclude this ID. + * - If this is 0, the value into $page will be used. If not found of $page not defined, the default page of website_id will be used or the first page found if not set. + * - If value is < 0, we must exclude this ID. * @param string $website_id Web site id (page name must also be filled if this parameter is used) * @param string $page Page name (website id must also be filled if this parameter is used) * @param string $aliasalt Alternative alias to search page (slow) From c76a33fb4f61317676b857dc38068e9a78f687fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Aug 2018 20:12:27 +0200 Subject: [PATCH 20/91] remove superfluous spaces --- .../doc/doc_generic_project_odt.modules.php | 36 +++++++++---------- htdocs/index.php | 2 +- htdocs/product/list.php | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 62898fc40a3..5bede258b07 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -932,109 +932,109 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propale->lire + 'test' => $conf->propal->enabled && $user->rights->propale->lire ), 'order' => array( 'title' => "ListOrdersAssociatedProject", 'class' => 'Commande', 'table' => 'commande', - 'test' => $conf->commande->enabled && $user->rights->commande->lire + 'test' => $conf->commande->enabled && $user->rights->commande->lire ), 'invoice' => array( 'title' => "ListInvoicesAssociatedProject", 'class' => 'Facture', 'table' => 'facture', - 'test' => $conf->facture->enabled && $user->rights->facture->lire + 'test' => $conf->facture->enabled && $user->rights->facture->lire ), 'invoice_predefined' => array( 'title' => "ListPredefinedInvoicesAssociatedProject", 'class' => 'FactureRec', 'table' => 'facture_rec', - 'test' => $conf->facture->enabled && $user->rights->facture->lire + 'test' => $conf->facture->enabled && $user->rights->facture->lire ), 'proposal_supplier' => array( 'title' => "ListSupplierProposalsAssociatedProject", 'class' => 'SupplierProposal', 'table' => 'supplier_proposal', - 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire + 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire ), 'order_supplier' => array( 'title' => "ListSupplierOrdersAssociatedProject", 'table' => 'commande_fournisseur', 'class' => 'CommandeFournisseur', - 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire + 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire ), 'invoice_supplier' => array( 'title' => "ListSupplierInvoicesAssociatedProject", 'table' => 'facture_fourn', 'class' => 'FactureFournisseur', - 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire + 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire ), 'contract' => array( 'title' => "ListContractAssociatedProject", 'class' => 'Contrat', 'table' => 'contrat', - 'test' => $conf->contrat->enabled && $user->rights->contrat->lire + 'test' => $conf->contrat->enabled && $user->rights->contrat->lire ), 'intervention' => array( 'title' => "ListFichinterAssociatedProject", 'class' => 'Fichinter', 'table' => 'fichinter', 'disableamount' => 1, - 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire + 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire ), 'shipping' => array( 'title' => "ListShippingAssociatedProject", 'class' => 'Expedition', 'table' => 'expedition', 'disableamount' => 1, - 'test' => $conf->expedition->enabled && $user->rights->expedition->lire + 'test' => $conf->expedition->enabled && $user->rights->expedition->lire ), 'trip' => array( 'title' => "ListTripAssociatedProject", 'class' => 'Deplacement', 'table' => 'deplacement', 'disableamount' => 1, - 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire + 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire ), 'expensereport' => array( 'title' => "ListExpenseReportsAssociatedProject", 'class' => 'ExpenseReportLine', 'table' => 'expensereport_det', - 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire + 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire ), 'donation' => array( 'title' => "ListDonationsAssociatedProject", 'class' => 'Don', 'table' => 'don', - 'test' => $conf->don->enabled && $user->rights->don->lire + 'test' => $conf->don->enabled && $user->rights->don->lire ), 'loan' => array( 'title' => "ListLoanAssociatedProject", 'class' => 'Loan', 'table' => 'loan', - 'test' => $conf->loan->enabled && $user->rights->loan->read + 'test' => $conf->loan->enabled && $user->rights->loan->read ), 'chargesociales' => array( 'title' => "ListSocialContributionAssociatedProject", 'class' => 'ChargeSociales', 'table' => 'chargesociales', 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id, - 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire + 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire ), 'stock_mouvement' => array( 'title' => "ListMouvementStockProject", 'class' => 'MouvementStock', 'table' => 'stock_mouvement', - 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)) + 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)) ), 'agenda' => array( 'title' => "ListActionsAssociatedProject", 'class' => 'ActionComm', 'table' => 'actioncomm', 'disableamount' => 1, - 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire - ) + 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire + ) ); //Insert reference diff --git a/htdocs/index.php b/htdocs/index.php index df1c18176e7..bbdac41aad6 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -568,7 +568,7 @@ if (! empty($valid_dashboardlines)) if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { $boxwork .= ' / '.price($board->total) .''; - } + } $boxwork .= '
    '; if ($board->nbtodolate > 0) { diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 9b26eecc426..28f08035198 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -748,8 +748,8 @@ if ($resql) if (! empty($arrayfields['p.duration']['checked'])) { print ''; - - if (preg_match('/([^a-z]+)[a-z]$/i',$obj->duration)) + + if (preg_match('/([^a-z]+)[a-z]$/i',$obj->duration)) { $duration_value = substr($obj->duration,0,dol_strlen($obj->duration)-1); $duration_unit = substr($obj->duration,-1); From a66983042703182b351fccf3a8528216ee51e1b5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 10:37:16 +0200 Subject: [PATCH 21/91] Update and standardize code --- htdocs/compta/bank/class/account.class.php | 6 +++++- htdocs/compta/facture/class/paymentterm.class.php | 6 +++++- .../canvas/actions_contactcard_common.class.php | 7 +++++-- htdocs/core/class/antivir.class.php | 5 ++++- htdocs/core/class/canvas.class.php | 6 +++++- htdocs/core/class/ccountry.class.php | 6 +++++- htdocs/core/class/cstate.class.php | 6 +++++- htdocs/core/class/ctypent.class.php | 6 +++++- htdocs/core/class/dolgraph.class.php | 6 +++++- htdocs/core/class/dolreceiptprinter.class.php | 6 +++++- htdocs/core/class/events.class.php | 5 ++++- htdocs/core/class/extrafields.class.php | 6 +++++- htdocs/core/class/google.class.php | 6 +++++- htdocs/core/class/hookmanager.class.php | 6 +++++- htdocs/core/class/html.form.class.php | 7 ++++++- htdocs/core/class/html.formaccounting.class.php | 6 +++++- htdocs/core/class/html.formactions.class.php | 6 +++++- htdocs/core/class/html.formadmin.class.php | 6 +++++- htdocs/core/class/html.formbank.class.php | 6 +++++- htdocs/core/class/html.formbarcode.class.php | 6 +++++- htdocs/core/class/html.formcompany.class.php | 6 +++++- htdocs/core/class/html.formcontract.class.php | 6 +++++- htdocs/core/class/html.formcron.class.php | 6 +++++- htdocs/core/class/html.formintervention.class.php | 6 +++++- htdocs/core/class/html.formmail.class.php | 5 ++++- htdocs/core/class/html.formmargin.class.php | 6 +++++- htdocs/core/class/html.formprojet.class.php | 6 +++++- htdocs/core/class/html.formpropal.class.php | 6 +++++- htdocs/core/class/html.formsms.class.php | 5 ++++- htdocs/core/class/html.formsocialcontrib.class.php | 6 +++++- htdocs/core/class/ldap.class.php | 5 ++++- htdocs/core/class/notify.class.php | 6 +++++- htdocs/core/class/rssparser.class.php | 6 +++++- htdocs/core/modules/mailings/modules_mailings.php | 7 ++++++- htdocs/core/modules/printing/modules_printing.php | 6 +++++- htdocs/core/modules/printing/printgcp.modules.php | 10 +++++++--- htdocs/core/modules/printing/printipp.modules.php | 10 +++++++--- htdocs/ecm/class/htmlecm.form.class.php | 6 +++++- htdocs/expensereport/class/expensereport.class.php | 6 +++++- htdocs/fichinter/class/fichinter.class.php | 6 +++++- htdocs/fourn/class/fournisseur.product.class.php | 6 +++++- htdocs/imports/class/import.class.php | 5 ++++- htdocs/mailmanspip/class/mailmanspip.class.php | 6 +++++- htdocs/product/class/html.formproduct.class.php | 6 +++++- .../dynamic_price/class/price_expression.class.php | 6 +++++- .../class/price_global_variable.class.php | 10 +++++++--- .../class/price_global_variable_updater.class.php | 10 +++++++--- htdocs/resource/class/html.formresource.class.php | 5 ++++- .../class/supplier_proposal.class.php | 6 +++++- 49 files changed, 248 insertions(+), 58 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 247cecb2eea..205b59bedf2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1633,7 +1633,11 @@ class Account extends CommonObject */ class AccountLine extends CommonObject { - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; + var $db; var $element='bank'; var $table_element='bank'; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 61d477522dc..763c4705db5 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -29,7 +29,11 @@ class PaymentTerm // extends CommonObject { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 921c9e60580..7398b427055 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -37,8 +37,11 @@ abstract class ActionsContactCardCommon var $tpl = array(); //! Object container var $object; - //! Error string - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index a530da66e3d..e82b97c73ba 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -30,7 +30,10 @@ */ class AntiVir { - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 3fed7cb722e..1a5573a7279 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -29,7 +29,11 @@ class Canvas { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 43d63ebb1d9..be5a7f2e490 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -33,7 +33,11 @@ class Ccountry // extends CommonObject { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 7a853cdf18a..e94d00bcb07 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -33,7 +33,11 @@ class Cstate // extends CommonObject { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index c69b70c7c35..35643a0733b 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -28,7 +28,11 @@ class Ctypent // extends CommonObject { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f40d30f389e..444f9b3ea53 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -69,7 +69,11 @@ class DolGraph var $showpercent=0; var $combine=0; // 0.05 if you want to combine records < 5% into "other" var $graph; // Objet Graph (Artichow, Phplot...) - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; var $bordercolor; // array(R,G,B) var $bgcolor; // array(R,G,B) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index fbf05c99358..8aacdba4a6b 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -109,7 +109,11 @@ class dolReceiptPrinter extends Escpos var $tags; var $printer; var $template; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index abdbb1689f8..e11830aca12 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -40,7 +40,10 @@ class Events // extends CommonObject var $id; var $db; - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; var $tms; var $type; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 62122ed636c..44b38afc351 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -88,7 +88,11 @@ class ExtraFields // New array to store extrafields definition var $attributes; - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; + var $errno; diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index e923ec12252..1e2e2438114 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -27,7 +27,11 @@ class GoogleAPI { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; var $key; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 2ba7f966712..8d37d7b5c9b 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -30,7 +30,11 @@ class HookManager { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6fe2dffd3d3..77d55794a3c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -48,7 +48,12 @@ class Form { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; + var $num; // Cache arrays diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index b6030809d6f..a2e1dcc9ad9 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -36,7 +36,11 @@ class FormAccounting extends Form private $options_cache = array(); var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * Constructor diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 451ee0d700d..01316d9b452 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -30,7 +30,11 @@ class FormActions { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index fd0470c63f4..1b6266fb6e3 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -30,7 +30,11 @@ class FormAdmin { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formbank.class.php b/htdocs/core/class/html.formbank.class.php index 4ee00555b85..36eeaaacdf0 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -30,7 +30,11 @@ class FormBank { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index dba8c5d24e5..3d8f40bb2e8 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -29,7 +29,11 @@ class FormBarCode { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index f04cfad54bc..c03764c2f34 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -32,7 +32,11 @@ class FormCompany { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index a3a3696e5f4..b011d7e1b14 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -28,7 +28,11 @@ class FormContract { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 255868f02a5..99ca3924c3c 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -29,7 +29,11 @@ class FormCron extends Form { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * Constructor diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index b675ba6e674..4a65fc7eac1 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -28,7 +28,11 @@ class FormIntervention { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 4ce4bfee824..fd8940674e2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -85,7 +85,10 @@ class FormMail extends Form public $withtouser=array(); public $withtoccuser=array(); - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; public $lines_model; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index da8acce83d4..ee88110038b 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -29,7 +29,11 @@ class FormMargin { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index dcc282794b9..e7b91e8c82d 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -30,7 +30,11 @@ class FormProjets { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 14e1a466275..1f4d94f649a 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -28,7 +28,11 @@ class FormPropal { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 6db6f200136..850704fe42e 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -56,7 +56,10 @@ class FormSms var $substit=array(); var $param=array(); - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 83886e63af8..636cf489d7d 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -28,7 +28,11 @@ class FormSocialContrib { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index cd1f4a64c17..71635a89233 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -29,7 +29,10 @@ */ class Ldap { - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; /** * Tableau des serveurs (IP addresses ou nom d'hotes) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index f3beece9794..22a22008d74 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -32,7 +32,11 @@ class Notify { var $id; var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 32a5842d410..d2ce6d6d5c2 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -27,7 +27,11 @@ class RssParser { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; private $_format=''; private $_urlRSS; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 1a97f3502b7..d3ea299a86e 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; class MailingTargets // This can't be abstract as it is used for some method { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; + var $tooltip=''; diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index 4a6560b47fa..f0d96c8aea7 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; class PrintingDriver { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 8e4eafeb7b8..8e868c19a1c 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -42,12 +42,16 @@ class printing_printgcp extends PrintingDriver var $conf = array(); var $google_id = ''; var $google_secret = ''; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; + /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); var $db; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 168c411ec29..e2354870cf9 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -40,12 +40,16 @@ class printing_printipp extends PrintingDriver var $userid; /* user login */ var $user; var $password; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; + /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); var $db; diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 3139c5f9986..db3355bce2b 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -28,7 +28,11 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; class FormEcm { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 19417d6e552..6271ef7ffdb 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2379,7 +2379,11 @@ class ExpenseReport extends CommonObject class ExpenseReportLine { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; var $rowid; var $comments; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 789a351c776..d7c2d871824 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1310,7 +1310,11 @@ class Fichinter extends CommonObject class FichinterLigne extends CommonObjectLine { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; // From llx_fichinterdet var $fk_fichinter; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index e7b3a292df1..4180ecaf3d0 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -38,7 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class. class ProductFournisseur extends Product { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; var $product_fourn_price_id; // id of ligne product-supplier diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 875efc27410..ae7cc240695 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -43,7 +43,10 @@ class Import var $array_import_convertvalue; var $array_import_run_sql_after; - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index f7ae2608da5..1630e61ce33 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -39,7 +39,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; class MailmanSpip { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; var $mladded_ok; var $mladded_ko; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index b34f4a88b2d..53368c0a114 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; class FormProduct { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; // Cache arrays var $cache_warehouses=array(); diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 039f74302e8..958647da0a6 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -30,7 +30,11 @@ class PriceExpression { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 1432afcfdeb..f09fbd2643f 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -30,12 +30,16 @@ class PriceGlobalVariable { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; + /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); var $id; var $code; diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 37a3e116683..1cd6318494b 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -30,12 +30,16 @@ class PriceGlobalVariableUpdater { var $db; //!< To store db handler - var $error; //!< To return error code (or message) + + /** + * @var string Error code (or message) + */ + public $error=''; + /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); var $types=array(0, 1); //!< Updater types var $update_min = 5; //!< Minimal update rate diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index ed667fad8ab..8a6f9d96c28 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -38,7 +38,10 @@ class FormResource var $substit=array(); var $param=array(); - var $error; + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 16727a781fc..1ffe4465d86 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2637,7 +2637,11 @@ class SupplierProposal extends CommonObject class SupplierProposalLine extends CommonObjectLine { var $db; - var $error; + + /** + * @var string Error code (or message) + */ + public $error=''; public $element='supplier_proposaldet'; public $table_element='supplier_proposaldet'; From 29f15b4ae6a7ba0936ad4a464f983e87723a4d6b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 10:51:55 +0200 Subject: [PATCH 22/91] Update and standardize code --- htdocs/accountancy/class/accountancysystem.class.php | 6 +++++- htdocs/accountancy/class/accountingaccount.class.php | 5 ++++- .../canvas/actions_adherentcard_common.class.php | 10 +++++----- htdocs/bookmarks/class/bookmark.class.php | 5 ++++- htdocs/comm/action/class/cactioncomm.class.php | 5 ++++- htdocs/comm/mailing/class/advtargetemailing.class.php | 10 ++++++---- .../mailing/class/html.formadvtargetemailing.class.php | 6 +++++- htdocs/compta/bank/class/account.class.php | 6 +++++- htdocs/compta/facture/class/paymentterm.class.php | 5 ++++- .../prelevement/class/ligneprelevement.class.php | 6 +++++- .../prelevement/class/rejetprelevement.class.php | 6 +++++- .../canvas/actions_contactcard_common.class.php | 6 +++++- htdocs/core/boxes/box_actions.php | 6 +++++- htdocs/core/boxes/box_activity.php | 6 +++++- htdocs/core/boxes/box_bookmarks.php | 6 +++++- htdocs/core/boxes/box_clients.php | 6 +++++- htdocs/core/boxes/box_commandes.php | 6 +++++- htdocs/core/boxes/box_comptes.php | 6 +++++- htdocs/core/boxes/box_contacts.php | 6 +++++- htdocs/core/boxes/box_contracts.php | 6 +++++- htdocs/core/boxes/box_external_rss.php | 6 +++++- htdocs/core/boxes/box_factures.php | 6 +++++- htdocs/core/boxes/box_factures_fourn.php | 6 +++++- htdocs/core/boxes/box_factures_fourn_imp.php | 6 +++++- htdocs/core/boxes/box_factures_imp.php | 6 +++++- htdocs/core/boxes/box_ficheinter.php | 6 +++++- htdocs/core/boxes/box_fournisseurs.php | 6 +++++- htdocs/core/boxes/box_goodcustomers.php | 6 +++++- htdocs/core/boxes/box_graph_invoices_permonth.php | 5 ++++- .../boxes/box_graph_invoices_supplier_permonth.php | 5 ++++- htdocs/core/boxes/box_graph_orders_permonth.php | 5 ++++- .../core/boxes/box_graph_orders_supplier_permonth.php | 5 ++++- htdocs/core/boxes/box_graph_product_distribution.php | 6 +++++- htdocs/core/boxes/box_graph_propales_permonth.php | 5 ++++- htdocs/core/boxes/box_lastlogin.php | 6 +++++- htdocs/core/boxes/box_members.php | 6 +++++- htdocs/core/boxes/box_produits.php | 6 +++++- htdocs/core/boxes/box_produits_alerte_stock.php | 6 +++++- htdocs/core/boxes/box_project.php | 7 ++++++- htdocs/core/boxes/box_propales.php | 6 +++++- htdocs/core/boxes/box_prospect.php | 6 +++++- htdocs/core/boxes/box_services_contracts.php | 6 +++++- htdocs/core/boxes/box_services_expired.php | 6 +++++- htdocs/core/boxes/box_supplier_orders.php | 6 +++++- htdocs/core/boxes/box_task.php | 7 ++++++- 45 files changed, 219 insertions(+), 52 deletions(-) diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index ef13b84b4bb..7ac8c0881f9 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -28,7 +28,11 @@ */ class AccountancySystem { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + /** * @var string Error code (or message) */ diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 4eac5546d1d..4ffadb799ac 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -45,7 +45,10 @@ class AccountingAccount extends CommonObject */ public $restrictiononfksoc = 1; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index e746a4a45c3..0e9bdd326da 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -28,10 +28,10 @@ abstract class ActionsAdherentCardCommon { /** - * Database handler - * @var DoliDB + * @var DoliDB Database handler. */ - var $db; + public $db; + var $dirmodule; var $targetmodule; var $canvas; @@ -41,11 +41,11 @@ abstract class ActionsAdherentCardCommon var $tpl = array(); //! Object container var $object; + /** * @var string Error code (or message) */ - public $error=''; - + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 1beb4b36871..264f4ce9aec 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -33,7 +33,10 @@ class Bookmark extends CommonObject public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $id; var $fk_user; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 22b7b6fa26c..f0b78ca2684 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -33,7 +33,10 @@ class CActionComm */ public $error=''; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $id; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 9ef7ba75a9f..702af86708e 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -28,13 +28,15 @@ */ class AdvanceTargetingMailing extends CommonObject { - - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; + /** * @var string Error code (or message) */ - public $error=''; - + public $error=''; /** * @var string[] Error codes (or messages) diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 76054a95879..f365b231159 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -26,7 +26,11 @@ */ class FormAdvTargetEmailing extends Form { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + /** * @var string Error code (or message) */ diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 205b59bedf2..aaf525a29d8 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1638,7 +1638,11 @@ class AccountLine extends CommonObject */ public $error=''; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $element='bank'; var $table_element='bank'; var $picto = 'generic'; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 763c4705db5..a44ea24711e 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -28,7 +28,10 @@ */ class PaymentTerm // extends CommonObject { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index fa8545c4ea2..4087e1c6020 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -32,7 +32,11 @@ class LignePrelevement { var $id; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; var $statuts = array(); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 87de138e63a..f0b6916b6fa 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -31,7 +31,11 @@ class RejetPrelevement { var $id; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 7398b427055..1276e501dc6 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -27,7 +27,11 @@ */ abstract class ActionsContactCardCommon { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $dirmodule; var $targetmodule; var $canvas; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index f6d9d03dccf..6ccf61690ed 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -37,7 +37,11 @@ class box_actions extends ModeleBoxes var $boxlabel="BoxLastActions"; var $depends = array("agenda"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 4fb8cc19c82..bd3163268ac 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -35,7 +35,11 @@ class box_activity extends ModeleBoxes var $boxlabel='BoxGlobalActivity'; var $depends = array("facture"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $enabled = 1; diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index e2a45ffab22..50cebe91b1f 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -33,7 +33,11 @@ class box_bookmarks extends ModeleBoxes var $boxlabel="BoxMyLastBookmarks"; var $depends = array("bookmark"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 7ab2de66a7b..fc31baee716 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -37,7 +37,11 @@ class box_clients extends ModeleBoxes var $boxlabel="BoxLastCustomers"; var $depends = array("societe"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $enabled = 1; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 9bbde140dbe..86660258cd0 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -37,7 +37,11 @@ class box_commandes extends ModeleBoxes var $boxlabel="BoxLastCustomerOrders"; var $depends = array("commande"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 52f8e6c7d9e..b951e0fe79b 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -38,7 +38,11 @@ class box_comptes extends ModeleBoxes var $boxlabel="BoxCurrentAccounts"; var $depends = array("banque"); // Box active if module banque active - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $enabled = 1; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index a8dc7f1231d..37e32d07198 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -39,7 +39,11 @@ class box_contacts extends ModeleBoxes var $boxlabel="BoxLastContacts"; var $depends = array("societe"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 49d6df67d7f..027fa2cc84a 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -36,7 +36,11 @@ class box_contracts extends ModeleBoxes var $boxlabel="BoxLastContracts"; var $depends = array("contrat"); // conf->contrat->enabled - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 01eb4ac8893..4c2ca4236ca 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -39,7 +39,11 @@ class box_external_rss extends ModeleBoxes var $boxlabel="BoxLastRssInfos"; var $depends = array("externalrss"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $paramdef; // Params of box definition (not user params) var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index a5da051d9d7..84f27257889 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -35,7 +35,11 @@ class box_factures extends ModeleBoxes var $boxlabel="BoxLastCustomerBills"; var $depends = array("facture"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 00df80f334b..011942b9cc4 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -36,7 +36,11 @@ class box_factures_fourn extends ModeleBoxes var $boxlabel="BoxLastSupplierBills"; var $depends = array("facture","fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 1f894be3309..9f696eac2b9 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -35,7 +35,11 @@ class box_factures_fourn_imp extends ModeleBoxes var $boxlabel = "BoxOldestUnpaidSupplierBills"; var $depends = array("facture","fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index ea483e223c1..1faeb789337 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -38,7 +38,11 @@ class box_factures_imp extends ModeleBoxes var $boxlabel="BoxOldestUnpaidCustomerBills"; var $depends = array("facture"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index ef7ba62c15c..a831bc163ce 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -36,7 +36,11 @@ class box_ficheinter extends ModeleBoxes var $boxlabel="BoxFicheInter"; var $depends = array("ficheinter"); // conf->contrat->enabled - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 32ffd1f5618..1bfd7d7ac16 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -36,7 +36,11 @@ class box_fournisseurs extends ModeleBoxes var $boxlabel="BoxLastSuppliers"; var $depends = array("fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 8e4ec988144..334cbc0fc56 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -38,7 +38,11 @@ class box_goodcustomers extends ModeleBoxes var $boxlabel="BoxGoodCustomers"; var $depends = array("societe"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $enabled = 1; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index abbdc7b7c71..4eb91d36e60 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -33,7 +33,10 @@ class box_graph_invoices_permonth extends ModeleBoxes var $boxlabel="BoxCustomersInvoicesPerMonth"; var $depends = array("facture"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 53d9ce08059..337b4283e94 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -33,7 +33,10 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes var $boxlabel="BoxSuppliersInvoicesPerMonth"; var $depends = array("fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 05a0ff498ec..b05395169fa 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -33,7 +33,10 @@ class box_graph_orders_permonth extends ModeleBoxes var $boxlabel="BoxCustomersOrdersPerMonth"; var $depends = array("commande"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index e88ed46be72..86a813407a6 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -33,7 +33,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes var $boxlabel="BoxSuppliersOrdersPerMonth"; var $depends = array("fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 39a7a3984d2..9ed59422466 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -33,7 +33,11 @@ class box_graph_product_distribution extends ModeleBoxes var $boxlabel="BoxProductDistribution"; var $depends = array("product|service","facture|propal|commande"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index bddf4a27e64..d608a1d1dcf 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -33,7 +33,10 @@ class box_graph_propales_permonth extends ModeleBoxes var $boxlabel="BoxProposalsPerMonth"; var $depends = array("propal"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index 05bd3043b0a..38745616aa4 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -35,7 +35,11 @@ class box_lastlogin extends ModeleBoxes var $boxlabel='BoxLoginInformation'; var $depends = array("user"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $enabled = 1; diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index e5819f0f14c..063a7390808 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -37,7 +37,11 @@ class box_members extends ModeleBoxes var $boxlabel="BoxLastMembers"; var $depends = array("adherent"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $enabled = 1; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 53449afceeb..f6e91169eae 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -38,7 +38,11 @@ class box_produits extends ModeleBoxes var $boxlabel="BoxLastProducts"; var $depends = array("produit"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index ee49e9e4534..0bd7a5e2ad7 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -40,7 +40,11 @@ class box_produits_alerte_stock extends ModeleBoxes var $boxlabel="BoxProductsAlertStock"; var $depends = array("produit"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 29bc4410b82..6c959deb303 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -34,7 +34,12 @@ class box_project extends ModeleBoxes var $boximg="object_projectpub"; var $boxlabel; //var $depends = array("projet"); - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 8dad41f64a1..a208671835f 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -37,7 +37,11 @@ class box_propales extends ModeleBoxes var $boxlabel="BoxLastProposals"; var $depends = array("propal"); // conf->propal->enabled - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 3186d0d30ce..912d0191e8d 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -39,7 +39,11 @@ class box_prospect extends ModeleBoxes var $boxlabel="BoxLastProspects"; var $depends = array("societe"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $enabled = 1; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 44a1ca020b5..38532ca3d2f 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -37,7 +37,11 @@ class box_services_contracts extends ModeleBoxes var $boxlabel="BoxLastProductsInContract"; var $depends = array("service","contrat"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 72d4390a2e2..ab5ad0c54a7 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -35,7 +35,11 @@ class box_services_expired extends ModeleBoxes var $boxlabel="BoxOldestExpiredServices"; var $depends = array("contrat"); // conf->propal->enabled - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 895f411e3d6..934be175c15 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -36,7 +36,11 @@ class box_supplier_orders extends ModeleBoxes var $boxlabel="BoxLatestSupplierOrders"; var $depends = array("fournisseur"); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $info_box_head = array(); var $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 802195ca445..7d40ee8482d 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -35,7 +35,12 @@ class box_task extends ModeleBoxes var $boximg="object_projecttask"; var $boxlabel; //var $depends = array("projet"); - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; + var $param; var $enabled = 0; // Disabled because bugged. From d91b1fd895797d4729ee9eaa71e266350297e721 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 11:06:34 +0200 Subject: [PATCH 23/91] Update and standardize code --- htdocs/core/class/antivir.class.php | 6 +++++- htdocs/core/class/canvas.class.php | 5 ++++- htdocs/core/class/ccountry.class.php | 5 ++++- htdocs/core/class/conf.class.php | 8 ++++++-- htdocs/core/class/cstate.class.php | 5 ++++- htdocs/core/class/ctypent.class.php | 5 ++++- htdocs/core/class/dolreceiptprinter.class.php | 7 ++++++- htdocs/core/class/events.class.php | 6 +++++- htdocs/core/class/extrafields.class.php | 5 ++++- htdocs/core/class/google.class.php | 5 ++++- htdocs/core/class/hookmanager.class.php | 5 ++++- htdocs/core/class/html.form.class.php | 5 ++++- htdocs/core/class/html.formaccounting.class.php | 7 +++++-- htdocs/core/class/html.formactions.class.php | 5 ++++- htdocs/core/class/html.formadmin.class.php | 5 ++++- htdocs/core/class/html.formbank.class.php | 5 ++++- htdocs/core/class/html.formbarcode.class.php | 5 ++++- htdocs/core/class/html.formcompany.class.php | 6 ++++-- htdocs/core/class/html.formcontract.class.php | 5 ++++- htdocs/core/class/html.formcron.class.php | 5 ++++- htdocs/core/class/html.formintervention.class.php | 5 ++++- htdocs/core/class/html.formmail.class.php | 5 ++++- htdocs/core/class/html.formmargin.class.php | 5 ++++- htdocs/core/class/html.formprojet.class.php | 5 ++++- htdocs/core/class/html.formpropal.class.php | 5 ++++- htdocs/core/class/html.formsms.class.php | 5 ++++- htdocs/core/class/html.formsocialcontrib.class.php | 5 ++++- htdocs/core/class/interfaces.class.php | 12 ++++++++---- htdocs/core/class/notify.class.php | 6 +++++- htdocs/core/class/rssparser.class.php | 5 ++++- htdocs/core/class/utils.class.php | 5 ++++- htdocs/core/menus/standard/auguria_menu.php | 6 +++++- htdocs/core/menus/standard/eldy_menu.php | 6 +++++- htdocs/core/menus/standard/empty.php | 6 +++++- htdocs/core/modules/action/rapport.pdf.php | 6 +++++- htdocs/core/modules/import/import_csv.modules.php | 6 +++++- htdocs/core/modules/import/import_xlsx.modules.php | 9 ++++++--- .../modules/mailings/advthirdparties.modules.php | 6 +++++- htdocs/core/modules/mailings/contacts1.modules.php | 5 ++++- htdocs/core/modules/mailings/example.modules.php | 6 +++++- htdocs/core/modules/mailings/fraise.modules.php | 5 ++++- htdocs/core/modules/mailings/modules_mailings.php | 5 ++++- htdocs/core/modules/mailings/pomme.modules.php | 5 ++++- .../core/modules/mailings/thirdparties.modules.php | 6 +++++- .../thirdparties_services_expired.modules.php | 7 ++++++- htdocs/core/modules/printing/modules_printing.php | 5 ++++- htdocs/core/modules/printing/printgcp.modules.php | 5 ++++- htdocs/core/modules/printing/printipp.modules.php | 5 ++++- .../security/generate/modGeneratePassNone.class.php | 6 +++++- .../security/generate/modGeneratePassPerso.class.php | 6 +++++- .../generate/modGeneratePassStandard.class.php | 6 +++++- 51 files changed, 231 insertions(+), 59 deletions(-) diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index e82b97c73ba..950d857000d 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -41,7 +41,11 @@ class AntiVir public $errors = array(); var $output; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** * Constructor diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 1a5573a7279..8a9b9d2f005 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -28,7 +28,10 @@ */ class Canvas { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index be5a7f2e490..01b176da165 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -32,7 +32,10 @@ */ class Ccountry // extends CommonObject { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 3b33b1f16f1..c86051d7088 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -35,8 +35,12 @@ class Conf /** \public */ //! To store properties found in conf file var $file; - //! Object with database handler - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; + //! To store properties found into database var $global; //! To store browser info diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index e94d00bcb07..e841fc581d8 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -32,7 +32,10 @@ */ class Cstate // extends CommonObject { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 35643a0733b..546b182a336 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -27,7 +27,10 @@ */ class Ctypent // extends CommonObject { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 8aacdba4a6b..78a9b2479eb 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -105,7 +105,12 @@ class dolReceiptPrinter extends Escpos const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_WINDOWS_PRINT = 4; //const CONNECTOR_JAVA = 5; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; + var $tags; var $printer; var $template; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index e11830aca12..f300d5c49e7 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -38,7 +38,11 @@ class Events // extends CommonObject public $table_element='events'; //!< Name of table without prefix where object is stored var $id; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 44b38afc351..2d0398dae16 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -37,7 +37,10 @@ */ class ExtraFields { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; // type of element (for what object is the extrafield) // @deprecated diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index 1e2e2438114..5756acd90e0 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -26,7 +26,10 @@ */ class GoogleAPI { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 8d37d7b5c9b..9e2bd344171 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -29,7 +29,10 @@ */ class HookManager { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 77d55794a3c..52abde0c14e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -47,7 +47,10 @@ */ class Form { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index a2e1dcc9ad9..8a0073e0351 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -35,14 +35,17 @@ class FormAccounting extends Form private $options_cache = array(); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) */ public $error=''; - /** + /** * Constructor * * @param DoliDB $db Database handler diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 01316d9b452..a0468da2726 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -29,7 +29,10 @@ */ class FormActions { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 1b6266fb6e3..b52da95f967 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -29,7 +29,10 @@ */ class FormAdmin { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formbank.class.php b/htdocs/core/class/html.formbank.class.php index 36eeaaacdf0..9cf60cc45b1 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -29,7 +29,10 @@ */ class FormBank { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 3d8f40bb2e8..34d56cee853 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -28,7 +28,10 @@ */ class FormBarCode { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index c03764c2f34..d422fa379c4 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -31,7 +31,10 @@ */ class FormCompany { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) @@ -39,7 +42,6 @@ class FormCompany public $error=''; - /** * Constructor * diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index b011d7e1b14..2c45ef0266c 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -27,7 +27,10 @@ */ class FormContract { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 99ca3924c3c..92cbcc52334 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -28,7 +28,10 @@ */ class FormCron extends Form { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 4a65fc7eac1..62950626e2d 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -27,7 +27,10 @@ */ class FormIntervention { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index fd8940674e2..73c4b036711 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -35,7 +35,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; */ class FormMail extends Form { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $withform; // 1=Include HTML form tag and show submit button, 0=Do not include form tag and submit button, -1=Do not include form tag but include submit button diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index ee88110038b..e891e3dacbe 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -28,7 +28,10 @@ */ class FormMargin { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index e7b91e8c82d..7a022c4cf52 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -29,7 +29,10 @@ */ class FormProjets { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index 1f4d94f649a..712460f530f 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -27,7 +27,10 @@ */ class FormPropal { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 850704fe42e..9db197d41b2 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -32,7 +32,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; */ class FormSms { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $fromname; var $fromsms; diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 636cf489d7d..8c940c3898b 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -27,7 +27,10 @@ */ class FormSocialContrib { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index e6325df8836..ceb4d0c657c 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -31,13 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class Interfaces { - var $db; - var $dir; // Directory with all core and external triggers files /** - * + * @var DoliDB Database handler. + */ + public $db; + + var $dir; // Directory with all core and external triggers files + + /** * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); /** * Constructor diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 22a22008d74..e77978fd62e 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/CMailFile.class.php'; class Notify { var $id; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index d2ce6d6d5c2..34738c09bf7 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -26,7 +26,10 @@ */ class RssParser { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index b9a9ad6f4bf..b7ae66da36c 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -27,7 +27,10 @@ */ class Utils { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $output; // Used by Cron method to return message var $result; // Used by Cron method to return data diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index df31b9c9d8f..33c02ce5f1c 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -28,7 +28,11 @@ */ class MenuManager { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $type_user; // Put 0 for internal users, 1 for external users var $atarget=""; // To store default target to use onto links var $name="auguria"; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 11f1de43a1f..dd919fd20a3 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -27,7 +27,11 @@ */ class MenuManager { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $type_user; // Put 0 for internal users, 1 for external users var $atarget=""; // To store default target to use onto links var $name="eldy"; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index f761b593fb7..a9d8e2f9a41 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -25,7 +25,11 @@ */ class MenuManager { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $type_user=0; // Put 0 for internal users, 1 for external users var $atarget=""; // To store default target to use onto links diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 7dec29e5189..fe7be7f3052 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -35,7 +35,11 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; */ class CommActionRapport { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $description; var $date_edition; var $year; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index aeaa6e58db2..9ea8ee25438 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php'; */ class ImportCsv extends ModeleImports { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $datatoimport; /** diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 0c610f469b0..d9400f2738d 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php'; */ class ImportXlsx extends ModeleImports { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $datatoimport; /** @@ -42,10 +46,9 @@ class ImportXlsx extends ModeleImports public $error=''; /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); var $id; // Id of driver var $label; // Label of driver diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 78aab1a5bd7..08249104909 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -32,7 +32,11 @@ class mailing_advthirdparties extends MailingTargets var $require_module=array("none"); // This module should not be displayed as Selector in mailling var $picto='company'; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 90d81dca4a5..af0d1103e4e 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -39,7 +39,10 @@ class mailing_contacts1 extends MailingTargets var $require_admin=0; // Module mailing actif pour user admin ou non var $picto='contact'; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index 548510f81a0..fb7b6c94519 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -37,7 +37,11 @@ class mailing_example extends MailingTargets var $require_module=array(); var $picto=''; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; // CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index f71b6b925f0..9d6e2505f92 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -41,7 +41,10 @@ class mailing_fraise extends MailingTargets var $require_module=array('adherent'); var $picto='user'; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * Constructor diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index d3ea299a86e..1035d3bf765 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; */ class MailingTargets // This can't be abstract as it is used for some method { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 5824f456365..b3265ac35f7 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -37,7 +37,10 @@ class mailing_pomme extends MailingTargets var $require_admin=1; // Module mailing actif pour user admin ou non var $picto='user'; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 57a69475000..f7a2ed5bc3c 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -31,7 +31,11 @@ class mailing_thirdparties extends MailingTargets var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated var $picto='company'; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 08473f3cb6d..0135227b461 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -29,7 +29,12 @@ class mailing_thirdparties_services_expired extends MailingTargets var $require_module=array('contrat'); var $picto='company'; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; + var $arrayofproducts=array(); diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index f0d96c8aea7..8205dc5a705 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; */ class PrintingDriver { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 8e868c19a1c..b85e4823bba 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -53,7 +53,10 @@ class printing_printgcp extends PrintingDriver */ public $errors = array(); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; private $OAUTH_SERVICENAME_GOOGLE = 'Google'; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index e2354870cf9..e51aa4e5c63 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -51,7 +51,10 @@ class printing_printipp extends PrintingDriver */ public $errors = array(); - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index 79cbd1ff629..e0c7714f8bb 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -34,7 +34,11 @@ class modGeneratePassNone extends ModeleGenPassword var $id; var $length; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $conf; var $lang; var $user; diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 39b3d54ea30..f4734cd5a54 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -42,7 +42,11 @@ class modGeneratePassPerso extends ModeleGenPassword var $NbRepeat; var $WithoutAmbi; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $conf; var $lang; var $user; diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index acb44256537..4103a9cced8 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -34,7 +34,11 @@ class modGeneratePassStandard extends ModeleGenPassword var $id; var $length; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $conf; var $lang; var $user; From a36061079b99d3315e7fd0fd2d941b40878010f2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 11:11:59 +0200 Subject: [PATCH 24/91] Update and standardize code --- htdocs/ecm/class/htmlecm.form.class.php | 5 ++++- htdocs/expedition/class/expedition.class.php | 5 ++++- htdocs/expensereport/class/expensereport.class.php | 5 ++++- htdocs/exports/class/export.class.php | 5 ++++- htdocs/fichinter/class/fichinter.class.php | 5 ++++- htdocs/fourn/class/fournisseur.product.class.php | 5 ++++- htdocs/livraison/class/livraison.class.php | 5 ++++- htdocs/mailmanspip/class/mailmanspip.class.php | 5 ++++- .../mailings/mailinglist_mymodule_myobject.modules.php | 6 +++++- htdocs/product/class/html.formproduct.class.php | 5 ++++- .../product/dynamic_price/class/price_expression.class.php | 5 ++++- .../dynamic_price/class/price_global_variable.class.php | 5 ++++- .../class/price_global_variable_updater.class.php | 5 ++++- htdocs/resource/class/html.formresource.class.php | 5 ++++- htdocs/societe/canvas/actions_card_common.class.php | 6 +++++- htdocs/stripe/class/actions_stripe.class.php | 6 ++++-- htdocs/supplier_proposal/class/supplier_proposal.class.php | 5 ++++- 17 files changed, 70 insertions(+), 18 deletions(-) diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index db3355bce2b..b6000cad923 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -27,7 +27,10 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; */ class FormEcm { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 448b13f43fa..e9246cbe751 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2278,7 +2278,10 @@ class ExpeditionLigne extends CommonObjectLine */ public $fk_expedition; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; // From llx_expeditiondet var $qty; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 6271ef7ffdb..821590365d8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2378,7 +2378,10 @@ class ExpenseReport extends CommonObject */ class ExpenseReportLine { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 050318944d6..4725ea758d5 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -30,7 +30,10 @@ */ class Export { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $array_export_code=array(); // Tableau de "idmodule_numlot" var $array_export_module=array(); // Tableau de "nom de modules" diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index d7c2d871824..2c6c8fef402 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1309,7 +1309,10 @@ class Fichinter extends CommonObject */ class FichinterLigne extends CommonObjectLine { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 4180ecaf3d0..da9549bb4ce 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -37,7 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class. */ class ProductFournisseur extends Product { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 46b3c113ff2..bac832f013e 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -1057,7 +1057,10 @@ class Livraison extends CommonObject */ class LivraisonLigne extends CommonObjectLine { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; // From llx_expeditiondet var $qty; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 1630e61ce33..683e8c25414 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -38,7 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class MailmanSpip { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index cd8612cb7d1..533f07b3ba2 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -27,7 +27,11 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets var $enabled=0; var $require_module=array(); var $picto='mymodule@mymodule'; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 53368c0a114..9161581eaae 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; */ class FormProduct { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 958647da0a6..282c1eadf45 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -29,7 +29,10 @@ */ class PriceExpression { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index f09fbd2643f..923c957f051 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -29,7 +29,10 @@ */ class PriceGlobalVariable { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 1cd6318494b..b4fa966119b 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -29,7 +29,10 @@ */ class PriceGlobalVariableUpdater { - var $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 8a6f9d96c28..2aa19ac66b5 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php"; */ class FormResource { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; var $substit=array(); var $param=array(); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 0243bc7d719..61e0a09f556 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -27,7 +27,11 @@ */ abstract class ActionsCardCommon { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $dirmodule; var $targetmodule; var $canvas; diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 141efcf7a47..4fa83f5fe0e 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -36,8 +36,10 @@ $langs->load("stripe@stripe"); */ class ActionsStripeconnect { - /** @var DoliDB */ - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; private $config=array(); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 1ffe4465d86..16aad03cee3 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2636,7 +2636,10 @@ class SupplierProposal extends CommonObject */ class SupplierProposalLine extends CommonObjectLine { - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) From 0ffad50974eeebc3880a1ece9445b85b1c9e3a3f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 11:24:31 +0200 Subject: [PATCH 25/91] Update and standardize code --- htdocs/accountancy/class/accountingaccount.class.php | 9 ++++++--- htdocs/bookmarks/class/bookmark.class.php | 6 +++++- htdocs/comm/action/class/actioncomm.class.php | 4 +++- htdocs/comm/action/class/cactioncomm.class.php | 5 ++++- htdocs/comm/mailing/class/advtargetemailing.class.php | 5 ++++- htdocs/compta/bank/class/account.class.php | 6 +++++- htdocs/compta/bank/class/paymentvarious.class.php | 6 +++++- htdocs/compta/facture/class/paymentterm.class.php | 5 ++++- .../compta/prelevement/class/ligneprelevement.class.php | 5 ++++- .../compta/prelevement/class/rejetprelevement.class.php | 5 ++++- htdocs/contrat/class/contrat.class.php | 6 +++++- htdocs/core/class/ccountry.class.php | 6 +++++- htdocs/core/class/cstate.class.php | 6 +++++- htdocs/core/class/ctypent.class.php | 6 +++++- htdocs/core/class/events.class.php | 5 ++++- htdocs/core/class/notify.class.php | 5 ++++- htdocs/core/modules/export/export_csv.modules.php | 6 +++++- htdocs/core/modules/export/export_excel.modules.php | 6 +++++- htdocs/core/modules/export/export_excel2007.modules.php | 6 +++++- htdocs/core/modules/export/export_tsv.modules.php | 6 +++++- htdocs/core/modules/import/import_csv.modules.php | 6 +++++- htdocs/core/modules/import/import_xlsx.modules.php | 6 +++++- .../security/generate/modGeneratePassNone.class.php | 6 +++++- .../security/generate/modGeneratePassPerso.class.php | 6 +++++- .../security/generate/modGeneratePassStandard.class.php | 6 +++++- htdocs/ecm/class/ecmdirectory.class.php | 5 ++++- htdocs/fourn/class/fournisseur.product.class.php | 6 +++++- htdocs/product/class/productcustomerprice.class.php | 6 +++++- htdocs/product/class/propalmergepdfproduct.class.php | 5 ++++- .../dynamic_price/class/price_expression.class.php | 6 +++++- .../dynamic_price/class/price_global_variable.class.php | 6 +++++- .../class/price_global_variable_updater.class.php | 7 ++++++- .../supplier_proposal/class/supplier_proposal.class.php | 7 ++++++- 33 files changed, 157 insertions(+), 35 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 4ffadb799ac..438c7a2312a 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -53,15 +53,18 @@ class AccountingAccount extends CommonObject /** * @var string Error code (or message) */ - public $error=''; - + public $error=''; /** * @var string[] Error codes (or messages) */ public $errors = array(); - var $id; + /** + * @var int ID + */ + public $id; + var $rowid; var $datec; // Creation date var $fk_pcg_version; diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 264f4ce9aec..737ecf717d8 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -38,7 +38,11 @@ class Bookmark extends CommonObject */ public $db; - var $id; + /** + * @var int ID + */ + public $id; + var $fk_user; var $datec; var $url; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c73216bbc22..ae4fa4d70ee 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -38,11 +38,13 @@ class ActionComm extends CommonObject public $table_element = 'actioncomm'; public $table_rowid = 'id'; public $picto='action'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty * @var integer @@ -53,7 +55,7 @@ class ActionComm extends CommonObject * Id of the event * @var int */ - var $id; + public $id; /** * Id of the event. Use $id as possible diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f0b78ca2684..19f970ab9ba 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -38,7 +38,10 @@ class CActionComm */ public $db; - var $id; + /** + * @var int ID + */ + public $id; var $code; var $type; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 702af86708e..e6111038742 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -46,7 +46,10 @@ class AdvanceTargetingMailing extends CommonObject var $element='advtargetemailing'; //!< Id that identify managed objects var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var int ID + */ + public $id; var $name; var $entity; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index aaf525a29d8..e36c87ed67c 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1647,7 +1647,11 @@ class AccountLine extends CommonObject var $table_element='bank'; var $picto = 'generic'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $datec; var $dateo; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index fe56ea99504..05373f502a1 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -34,7 +34,11 @@ class PaymentVarious extends CommonObject public $table_element='payment_various'; //!< Name of table without prefix where object is stored public $picto = 'bill'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $tms; var $datep; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index a44ea24711e..18a43d6d68d 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -47,7 +47,10 @@ class PaymentTerm // extends CommonObject //public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored var $context =array(); - var $id; + /** + * @var int ID + */ + public $id; var $code; var $sortorder; diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 4087e1c6020..10a7f6d23ee 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -31,7 +31,10 @@ */ class LignePrelevement { - var $id; + /** + * @var int ID + */ + public $id; /** * @var DoliDB Database handler. diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index f0b6916b6fa..606208b5193 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -30,7 +30,10 @@ */ class RejetPrelevement { - var $id; + /** + * @var int ID + */ + public $id; /** * @var DoliDB Database handler. diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 1fb2bb3afa6..9fe66648411 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2454,7 +2454,11 @@ class ContratLigne extends CommonObjectLine public $element='contratdet'; public $table_element='contratdet'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $tms; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 01b176da165..90164bf99fe 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -50,7 +50,11 @@ class Ccountry // extends CommonObject //var $element='ccountry'; //!< Id that identify managed objects //var $table_element='ccountry'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var int ID + */ + public $id; + var $code; var $code_iso; var $label; diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index e841fc581d8..bb75a36de96 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -50,7 +50,11 @@ class Cstate // extends CommonObject //var $element='cstate'; //!< Id that identify managed objects //var $table_element='cstate'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var int ID + */ + public $id; + var $code_departement; var $nom; var $active; diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 546b182a336..184f5f26a2c 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -45,7 +45,11 @@ class Ctypent // extends CommonObject //var $element='ctypent'; //!< Id that identify managed objects //var $table_element='ctypent'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var int ID + */ + public $id; + var $code; var $libelle; var $active; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index f300d5c49e7..eb054792beb 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -37,7 +37,10 @@ class Events // extends CommonObject public $element='events'; //!< Id that identify managed objects public $table_element='events'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var int ID + */ + public $id; /** * @var DoliDB Database handler. diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e77978fd62e..f5c0020bac1 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/CMailFile.class.php'; */ class Notify { - var $id; + /** + * @var int ID + */ + public $id; /** * @var DoliDB Database handler. diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 8d35ff63225..6ee453160c7 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; */ class ExportCsv extends ModeleExports { - var $id; + /** + * @var int ID + */ + public $id; + var $label; var $extension; var $version; diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 00d06e8511a..659a65edc9b 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class ExportExcel extends ModeleExports { - var $id; + /** + * @var int ID + */ + public $id; + var $label; var $extension; var $version; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index df9fd9d5705..91757a7d2a1 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class ExportExcel2007 extends ExportExcel { - var $id; + /** + * @var int ID + */ + public $id; + var $label; var $extension; var $version; diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index 2945c5095b8..15e93493dc0 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; */ class ExportTsv extends ModeleExports { - var $id; + /** + * @var int ID + */ + public $id; + var $label; var $extension; var $version; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 9ea8ee25438..7435e72c595 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -51,7 +51,11 @@ class ImportCsv extends ModeleImports */ public $errors = array (); - var $id; // Id of driver + /** + * @var int ID + */ + public $id; + var $label; // Label of driver var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d9400f2738d..bdb9e8d2949 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -50,7 +50,11 @@ class ImportXlsx extends ModeleImports */ public $errors = array(); - var $id; // Id of driver + /** + * @var int ID + */ + public $id; + var $label; // Label of driver var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index e0c7714f8bb..384b956e85d 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpass */ class modGeneratePassNone extends ModeleGenPassword { - var $id; + /** + * @var int ID + */ + public $id; + var $length; /** diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index f4734cd5a54..60537bca1d3 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpass */ class modGeneratePassPerso extends ModeleGenPassword { - var $id; + /** + * @var int ID + */ + public $id; + var $length; var $length2; // didn't overright display var $NbMaj; diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 4103a9cced8..87a792672fb 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpass */ class modGeneratePassStandard extends ModeleGenPassword { - var $id; + /** + * @var int ID + */ + public $id; + var $length; /** diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index a3669f909e9..1ae48f2a619 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -31,7 +31,10 @@ class EcmDirectory // extends CommonObject //public $table_element='ecm_directories'; //!< Name of table without prefix where object is stored var $picto = 'dir'; - var $id; + /** + * @var int ID + */ + public $id; var $label; var $fk_parent; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index da9549bb4ce..b109a5e6c71 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -49,7 +49,11 @@ class ProductFournisseur extends Product var $product_fourn_price_id; // id of ligne product-supplier - var $id; // product id + /** + * @var int ID + */ + public $id; + /** * @deprecated * @see ref_supplier diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 56b5004d31b..37c945e3e62 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -950,7 +950,11 @@ class Productcustomerprice extends CommonObject */ class PriceByCustomerLine { - var $id; + /** + * @var int ID + */ + public $id; + var $entity; var $datec = ''; var $tms = ''; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 641a8f155b7..d69efd3b14d 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -636,7 +636,10 @@ class Propalmergepdfproduct extends CommonObject */ class PropalmergepdfproductLine { - var $id; + /** + * @var int ID + */ + public $id; var $fk_product; var $file_name; diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 282c1eadf45..5e9abd4c241 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -44,7 +44,11 @@ class PriceExpression */ public $errors = array(); - var $id; + /** + * @var int ID + */ + public $id; + var $title; var $expression; public $table_element = "c_price_expression"; diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 923c957f051..a5b02af8061 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -44,7 +44,11 @@ class PriceGlobalVariable */ public $errors = array(); - var $id; + /** + * @var int ID + */ + public $id; + var $code; var $description; var $value; diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index b4fa966119b..f807ac267f3 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -46,7 +46,12 @@ class PriceGlobalVariableUpdater var $types=array(0, 1); //!< Updater types var $update_min = 5; //!< Minimal update rate - var $id; + + /** + * @var int ID + */ + public $id; + var $type; var $description; var $parameters; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 16aad03cee3..f2945ccc308 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2653,7 +2653,12 @@ class SupplierProposalLine extends CommonObjectLine // From llx_supplier_proposaldet var $rowid; // deprecated - var $id; + + /** + * @var int ID + */ + public $id; + var $fk_supplier_proposal; var $fk_parent_line; var $desc; // Description ligne From 95349365ba5345a3436f90210e583eb799cee8f1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 11:39:37 +0200 Subject: [PATCH 26/91] Update and standardize code --- htdocs/accountancy/class/accountancysystem.class.php | 7 ++++++- htdocs/accountancy/class/accountingaccount.class.php | 7 ++++++- htdocs/comm/action/class/actioncomm.class.php | 5 ++++- htdocs/comm/action/class/cactioncomm.class.php | 7 ++++++- htdocs/commande/class/commande.class.php | 7 ++++++- htdocs/compta/bank/class/account.class.php | 7 ++++++- htdocs/compta/bank/class/paymentvarious.class.php | 7 ++++++- htdocs/compta/localtax/class/localtax.class.php | 7 ++++++- htdocs/compta/tva/class/tva.class.php | 7 ++++++- htdocs/core/class/ccountry.class.php | 7 ++++++- htdocs/core/class/fiscalyear.class.php | 6 +++++- htdocs/core/modules/export/export_csv.modules.php | 6 +++++- htdocs/core/modules/export/export_excel.modules.php | 6 +++++- htdocs/core/modules/export/export_excel2007.modules.php | 6 +++++- htdocs/core/modules/export/export_tsv.modules.php | 6 +++++- htdocs/core/modules/import/import_csv.modules.php | 6 +++++- htdocs/core/modules/import/import_xlsx.modules.php | 6 +++++- htdocs/ecm/class/ecmdirectory.class.php | 6 +++++- htdocs/livraison/class/livraison.class.php | 7 ++++++- htdocs/projet/class/task.class.php | 7 ++++++- 20 files changed, 110 insertions(+), 20 deletions(-) diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index 7ac8c0881f9..a755c3c0602 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -42,7 +42,12 @@ class AccountancySystem var $fk_pcg_version; var $pcg_type; var $pcg_subtype; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $account_number; var $account_parent; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 438c7a2312a..7837533bfa6 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -73,7 +73,12 @@ class AccountingAccount extends CommonObject var $account_number; var $account_parent; var $account_category; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $fk_user_author; var $fk_user_modif; var $active; // duplicate with status diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ae4fa4d70ee..78caa56b503 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -69,7 +69,10 @@ class ActionComm extends CommonObject var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set) var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) - var $label; + /** + * @var string proper name for given parameter + */ + public $label; /** * @var string diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 19f970ab9ba..a0403c0a0a4 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -46,7 +46,12 @@ class CActionComm var $code; var $type; var $libelle; // deprecated - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $active; var $color; var $picto; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8ee90b6d583..6c5a9db68ac 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3801,7 +3801,12 @@ class OrderLine extends CommonOrderLine // From llx_commandedet var $fk_parent_line; var $fk_facture; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $fk_remise_except; var $rang = 0; var $fk_fournprice; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e36c87ed67c..28eb0a94443 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1661,7 +1661,12 @@ class AccountLine extends CommonObject */ var $datev; var $amount; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $note; var $fk_user_author; var $fk_user_rappro; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 05373f502a1..f08694e72b6 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -47,7 +47,12 @@ class PaymentVarious extends CommonObject var $amount; var $type_payment; var $num_payment; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $accountancy_code; var $fk_project; var $fk_bank; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index a75de537724..5d2045740bf 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -38,7 +38,12 @@ class Localtax extends CommonObject var $datep; var $datev; var $amount; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index af330910cdf..3ff8df88600 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -43,7 +43,12 @@ class Tva extends CommonObject var $amount; var $type_payment; var $num_payment; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 90164bf99fe..f49d39e8fdd 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -57,7 +57,12 @@ class Ccountry // extends CommonObject var $code; var $code_iso; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $active; diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 987033d35e3..482b647a3df 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -36,7 +36,11 @@ class Fiscalyear extends CommonObject var $rowid; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $date_start; var $date_end; var $datec; diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 6ee453160c7..10014eb6d6c 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -35,7 +35,11 @@ class ExportCsv extends ModeleExports */ public $id; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; var $version; diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 659a65edc9b..216f45b0148 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -37,7 +37,11 @@ class ExportExcel extends ModeleExports */ public $id; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; var $version; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 91757a7d2a1..5196561f099 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -38,7 +38,11 @@ class ExportExcel2007 extends ExportExcel */ public $id; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; var $version; diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index 15e93493dc0..57a074af550 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -36,7 +36,11 @@ class ExportTsv extends ModeleExports */ public $id; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; var $version; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 7435e72c595..1841cac9895 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -56,7 +56,11 @@ class ImportCsv extends ModeleImports */ public $id; - var $label; // Label of driver + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index bdb9e8d2949..f260c255465 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -55,7 +55,11 @@ class ImportXlsx extends ModeleImports */ public $id; - var $label; // Label of driver + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 1ae48f2a619..1ae5f980017 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -36,7 +36,11 @@ class EcmDirectory // extends CommonObject */ public $id; - var $label; + /** + * @var string proper name for given parameter + */ + public $label; + var $fk_parent; var $description; var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index bac832f013e..f8874b72e3f 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -1069,7 +1069,12 @@ class LivraisonLigne extends CommonObjectLine var $price; var $fk_product; var $origin_id; - var $label; // Label produit + + /** + * @var string proper name for given parameter + */ + public $label; + var $description; // Description produit /** * @deprecated diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 46f04b08932..8fc55605e1f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -38,7 +38,12 @@ class Task extends CommonObject protected $childtables=array('projet_task_time'); // To test if we can delete object var $fk_task_parent; - var $label; + + /** + * @var string proper name for given parameter + */ + public $label; + var $description; var $duration_effective; // total of time spent on this task var $planned_workload; From e0462b975bf115cfe3838ef93260e7dff0ca9d9b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 11:48:26 +0200 Subject: [PATCH 27/91] Update and standardize code --- htdocs/comm/mailing/class/advtargetemailing.class.php | 6 +++++- htdocs/compta/bank/class/account.class.php | 6 +++++- htdocs/expedition/class/expeditionbatch.class.php | 6 +++++- htdocs/expensereport/class/expensereport.class.php | 6 +++++- htdocs/product/class/productbatch.class.php | 6 +++++- htdocs/product/class/productcustomerprice.class.php | 6 +++++- htdocs/product/class/propalmergepdfproduct.class.php | 6 +++++- 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index e6111038742..b36e0463b9e 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -43,7 +43,11 @@ class AdvanceTargetingMailing extends CommonObject */ public $errors = array(); - var $element='advtargetemailing'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='advtargetemailing'; + var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored /** diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 28eb0a94443..a62592aaf2e 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1643,7 +1643,11 @@ class AccountLine extends CommonObject */ public $db; - var $element='bank'; + /** + * @var string ID to identify managed object + */ + public $element='bank'; + var $table_element='bank'; var $picto = 'generic'; diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index d94baee2a43..540b584590b 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -28,7 +28,11 @@ */ class ExpeditionLineBatch extends CommonObject { - var $element='expeditionlignebatch'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='expeditionlignebatch'; + private static $_table_element='expeditiondet_batch'; //!< Name of table without prefix where object is stored var $sellby; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 821590365d8..5e9d11c9c86 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport_rule.class.p */ class ExpenseReport extends CommonObject { - var $element='expensereport'; + /** + * @var string ID to identify managed object + */ + public $element='expensereport'; + var $table_element='expensereport'; var $table_element_line = 'expensereport_det'; var $fk_element = 'fk_expensereport'; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index b52514a4195..4533013d6b6 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class Productbatch extends CommonObject { - var $element='productbatch'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='productbatch'; + private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored var $tms=''; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 37c945e3e62..3c281ee88b7 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -28,7 +28,11 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; */ class Productcustomerprice extends CommonObject { - var $element = 'product_customer_price'; // !< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element = 'product_customer_price'; + var $table_element = 'product_customer_price'; // !< Name of table without prefix where object is stored var $entity; var $datec = ''; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index d69efd3b14d..2894cfff60b 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class Propalmergepdfproduct extends CommonObject { - var $element='propal_merge_pdf_product'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='propal_merge_pdf_product'; + var $table_element='propal_merge_pdf_product'; //!< Name of table without prefix where object is stored var $fk_product; From d1d6d81f8f66a6a590affd140ec44700fb53f82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 11:53:08 +0200 Subject: [PATCH 28/91] Update antivir.class.php --- htdocs/core/class/antivir.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index a530da66e3d..aab69d452dc 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -66,7 +66,7 @@ class AntiVir if (preg_match('/\.virus$/i', $file)) { - $this->errors='File has an extension saying file is a virus'; + $this->errors[] = 'File has an extension saying file is a virus'; return -97; } From 6542dcf0bd662ecad90f163af5f680ac6debd981 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 12:04:50 +0200 Subject: [PATCH 29/91] Update and standardize code --- htdocs/accountancy/class/accountancycategory.class.php | 6 +++++- htdocs/accountancy/class/accountingaccount.class.php | 5 +++++ htdocs/accountancy/class/accountingjournal.class.php | 5 +++++ htdocs/comm/mailing/class/advtargetemailing.class.php | 5 ++++- htdocs/compta/bank/class/account.class.php | 6 +++++- htdocs/expensereport/class/expensereport.class.php | 6 +++++- htdocs/product/class/productcustomerprice.class.php | 6 +++++- htdocs/product/class/propalmergepdfproduct.class.php | 5 ++++- 8 files changed, 38 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 7420ae8a982..127e220d3d1 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -34,7 +34,11 @@ class AccountancyCategory // extends CommonObject public $error; //!< To return error code (or message) public $errors=array(); //!< To return several error codes (or messages) public $element='c_accounting_category'; //!< Id that identify managed objects - public $table_element='c_accounting_category'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='c_accounting_category'; public $id; public $code; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 7837533bfa6..fb2d1d477ed 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -31,7 +31,12 @@ class AccountingAccount extends CommonObject { public $element='accounting_account'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='accounting_account'; + public $picto = 'billr'; /** diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2291028ddf3..4edc4e3f99a 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -27,7 +27,12 @@ class AccountingJournal extends CommonObject { public $element='accounting_journal'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='accounting_journal'; + public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'generic'; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index b36e0463b9e..396c020b7b6 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -48,7 +48,10 @@ class AdvanceTargetingMailing extends CommonObject */ public $element='advtargetemailing'; - var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='advtargetemailing'; /** * @var int ID diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index a62592aaf2e..26e9527c7f3 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1648,7 +1648,11 @@ class AccountLine extends CommonObject */ public $element='bank'; - var $table_element='bank'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='bank'; + var $picto = 'generic'; /** diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 5e9d11c9c86..b223174a6f8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -38,7 +38,11 @@ class ExpenseReport extends CommonObject */ public $element='expensereport'; - var $table_element='expensereport'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='expensereport'; + var $table_element_line = 'expensereport_det'; var $fk_element = 'fk_expensereport'; var $picto = 'trip'; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 3c281ee88b7..c0f645b66b2 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -33,7 +33,11 @@ class Productcustomerprice extends CommonObject */ public $element = 'product_customer_price'; - var $table_element = 'product_customer_price'; // !< Name of table without prefix where object is stored + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'product_customer_price'; + var $entity; var $datec = ''; var $tms = ''; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 2894cfff60b..771a60be60e 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -36,7 +36,10 @@ class Propalmergepdfproduct extends CommonObject */ public $element='propal_merge_pdf_product'; - var $table_element='propal_merge_pdf_product'; //!< Name of table without prefix where object is stored + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='propal_merge_pdf_product'; var $fk_product; var $file_name; From 96f16b74975b2b7730056012ff54ffa58e7e74ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 17:29:05 +0200 Subject: [PATCH 30/91] Update commondocgenerator.class.php --- .../core/class/commondocgenerator.class.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 78e13a92b5f..e4cc748f4f2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -578,15 +578,15 @@ abstract class CommonDocGenerator } // Retrieve extrafields - /*if(is_array($object->array_options) && count($object->array_options)) + if(is_array($object->array_options) && count($object->array_options)) { require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label('shipment',true); + $extralabels = $extrafields->fetch_name_optionals_label('expedition',true); $object->fetch_optionals($object->id,$extralabels); $array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs); - }*/ + } return $array_shipment; } @@ -603,7 +603,7 @@ abstract class CommonDocGenerator global $conf; dol_include_once('/core/lib/product.lib.php'); - return array( + $resarray = array( 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), 'line_product_ref'=>$line->product_ref, 'line_product_label'=>$line->product_label, @@ -622,6 +622,18 @@ abstract class CommonDocGenerator 'line_surface'=>empty($line->surface) ? '' : $line->surface*$line->qty_shipped.' '.measuring_units_string($line->surface_units, 'surface'), 'line_volume'=>empty($line->volume) ? '' : $line->volume*$line->qty_shipped.' '.measuring_units_string($line->volume_units, 'volume'), ); + + // Retrieve extrafields + $extrafieldkey = $line->element; + $array_key = "line"; + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true); + $line->fetch_optionals($line->rowid, $extralabels); + + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); + + return $resarray; } From 449ef9c4641cbe90cf3992294682a4356004efe1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 18:12:44 +0200 Subject: [PATCH 31/91] Update and standardize code --- htdocs/accountancy/class/bookkeeping.class.php | 5 ++++- htdocs/adherents/class/adherent.class.php | 5 +++++ htdocs/adherents/class/adherent_type.class.php | 4 ++++ htdocs/adherents/class/adherentstats.class.php | 5 ++++- htdocs/adherents/class/subscription.class.php | 5 +++++ htdocs/asset/class/asset.class.php | 4 ++++ htdocs/asset/class/asset_type.class.php | 4 ++++ htdocs/bookmarks/class/bookmark.class.php | 7 ++++++- htdocs/categories/class/categorie.class.php | 4 ++++ htdocs/comm/action/class/actioncomm.class.php | 7 ++++++- htdocs/comm/action/class/actioncommreminder.class.php | 3 +++ htdocs/comm/mailing/class/mailing.class.php | 5 +++++ htdocs/comm/propal/class/propal.class.php | 11 +++++++++++ htdocs/comm/propal/class/propalestats.class.php | 5 ++++- htdocs/commande/class/commande.class.php | 7 ++++++- htdocs/commande/class/commandestats.class.php | 3 +++ 16 files changed, 78 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2d9e2fa4fdb..a3a91cdc8e5 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -35,14 +35,17 @@ class BookKeeping extends CommonObject * @var string Error code (or message) */ public $error; + /** * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); + /** * @var string Id to identify managed objects */ public $element = 'accountingbookkeeping'; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6b7462ba42a..9ced11e7d5d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -42,7 +42,12 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; class Adherent extends CommonObject { public $element='member'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='adherent'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $mesgs; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ca8372c04ed..3af6206d274 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class AdherentType extends CommonObject { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'adherent_type'; + public $element = 'adherent_type'; public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 59c51cb1d21..aef2f275c89 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -32,7 +32,10 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/subscription.class.php'; */ class AdherentStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 1c4007780b9..71c304e5765 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -33,7 +33,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class Subscription extends CommonObject { public $element='subscription'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='subscription'; + public $picto='payment'; var $datec; // Date creation diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 4ab05ce675c..002dca8bf56 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -35,18 +35,22 @@ class Asset extends CommonObject * @var string ID to identify managed object */ public $element = 'asset'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'asset'; + /** * @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var int Does asset support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png */ diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 51ea3a0c799..8922701d698 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -29,7 +29,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class AssetType extends CommonObject { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'asset_type'; + public $element = 'asset_type'; public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 737ecf717d8..a78c75a43db 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -29,7 +29,12 @@ class Bookmark extends CommonObject { public $element='bookmark'; - public $table_element='bookmark'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='bookmark'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 70b2108dd4c..1fccadc0a53 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -149,6 +149,10 @@ class Categorie extends CommonObject ); public $element='category'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='categorie'; public $fk_parent; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 78caa56b503..34478c0b6b2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class ActionComm extends CommonObject { public $element='action'; - public $table_element = 'actioncomm'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'actioncomm'; + public $table_rowid = 'id'; public $picto='action'; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 4873db461f6..ce32234be56 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -34,14 +34,17 @@ class ActionCommReminder extends CommonObject * @var string ID to identify managed object */ public $element = 'actioncomm_reminder'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm_reminder'; + /** * @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png */ diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 63fc0a2caab..f5c1fd84d9e 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Mailing extends CommonObject { public $element='mailing'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='mailing'; + public $picto='email'; var $titre; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 848ac60d822..02ab37c626a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -46,15 +46,22 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class Propal extends CommonObject { public $element='propal'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='propal'; + public $table_element_line='propaldet'; public $fk_element='fk_propal'; public $picto='propal'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -3650,6 +3657,10 @@ class Propal extends CommonObject class PropaleLigne extends CommonObjectLine { public $element='propaldet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='propaldet'; var $oldline; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index d6e9ee3b103..bb4e0ab56f4 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -35,7 +35,10 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class PropaleStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c5a9db68ac..6ff85f51ca5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -43,7 +43,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class Commande extends CommonOrder { public $element='commande'; - public $table_element='commande'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='commande'; + public $table_element_line = 'commandedet'; public $class_element_line = 'OrderLine'; public $fk_element = 'fk_commande'; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 6d9dde94bc4..6ab9965f307 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -34,6 +34,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class CommandeStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid; From 504b0e3d162eb0b3193e395e852d5d3ab086bdd3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 18:34:50 +0200 Subject: [PATCH 32/91] Update and standardize code --- htdocs/compta/bank/class/account.class.php | 5 +++ .../bank/class/paymentvarious.class.php | 7 +++- .../deplacement/class/deplacement.class.php | 5 +++ .../class/deplacementstats.class.php | 5 ++- .../facture/class/facture-rec.class.php | 9 +++++ htdocs/compta/facture/class/facture.class.php | 11 ++++- .../facture/class/facturestats.class.php | 6 ++- .../compta/localtax/class/localtax.class.php | 7 +++- .../cheque/class/remisecheque.class.php | 5 +++ .../compta/paiement/class/cpaiement.class.php | 8 +--- .../compta/paiement/class/paiement.class.php | 7 +++- .../class/bonprelevement.class.php | 5 +++ .../salaries/class/paymentsalary.class.php | 7 +++- .../salaries/class/salariesstats.class.php | 3 ++ .../sociales/class/cchargesociales.class.php | 7 +--- .../sociales/class/chargesociales.class.php | 7 +++- .../class/paymentsocialcontribution.class.php | 7 +++- htdocs/compta/tva/class/tva.class.php | 7 +++- htdocs/contact/class/contact.class.php | 5 +++ htdocs/contrat/class/contrat.class.php | 13 +++++- htdocs/core/class/comment.class.php | 6 ++- htdocs/core/class/commonobject.class.php | 40 ++++++++++++++++++- htdocs/core/class/ctyperesource.class.php | 7 +--- .../core/class/emailsenderprofile.class.php | 3 ++ htdocs/core/class/events.class.php | 6 ++- htdocs/core/class/fiscalyear.class.php | 5 +++ htdocs/core/class/link.class.php | 6 ++- 27 files changed, 174 insertions(+), 35 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 26e9527c7f3..9895de511fe 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -37,7 +37,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Account extends CommonObject { public $element = 'bank_account'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'bank_account'; + public $picto = 'account'; /** diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index f08694e72b6..6215858dd6d 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class PaymentVarious extends CommonObject { public $element='variouspayment'; //!< Id that identify managed objects - public $table_element='payment_various'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_various'; + public $picto = 'bill'; /** diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 05664080ed3..6a51244529a 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Deplacement extends CommonObject { public $element='deplacement'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='deplacement'; + public $table_element_line = ''; public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 75ac39a7cca..9d99063e726 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -30,7 +30,10 @@ include_once DOL_DOCUMENT_ROOT . '/compta/deplacement/class/deplacement.class.ph */ class DeplacementStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 06f33f3f69a..385224e10d7 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -40,7 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; class FactureRec extends CommonInvoice { public $element='facturerec'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='facture_rec'; + public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; public $picto='bill'; @@ -1640,6 +1645,10 @@ class FactureRec extends CommonInvoice class FactureLigneRec extends CommonInvoiceLine { public $element='facturedetrec'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='facturedet_rec'; var $date_start_fill; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index af3597de447..f05c7302ef0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -54,7 +54,12 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accoun class Facture extends CommonInvoice { public $element='facture'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='facture'; + public $table_element_line = 'facturedet'; public $fk_element = 'fk_facture'; public $picto='bill'; @@ -4232,7 +4237,11 @@ class Facture extends CommonInvoice class FactureLigne extends CommonInvoiceLine { public $element='facturedet'; - public $table_element='facturedet'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='facturedet'; var $oldline; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index a23d5bdc2c2..e8d8d30e1b5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -35,7 +35,11 @@ class FactureStats extends Stats var $socid; var $userid; - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; + var $from; var $field; var $where; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 5d2045740bf..717e251f841 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -30,7 +30,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Localtax extends CommonObject { public $element='localtax'; //!< Id that identify managed objects - public $table_element='localtax'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='localtax'; + public $picto='payment'; var $ltt; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 189afeda59f..8981a760864 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; class RemiseCheque extends CommonObject { public $element='chequereceipt'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='bordereau_cheque'; + public $picto = 'payment'; var $num; diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 59f13023b24..1919b5fa94c 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -34,15 +34,12 @@ class Cpaiement * @var string Id to identify managed objects */ public $element = 'cpaiement'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_paiement'; - - /** - */ - public $code; public $libelle; public $type; @@ -50,9 +47,6 @@ class Cpaiement public $accountancy_code; public $module; - /** - */ - /** * Constructor diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 53a17830c09..e8057853952 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -37,7 +37,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class Paiement extends CommonObject { public $element='payment'; - public $table_element='paiement'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='paiement'; + public $picto = 'payment'; var $facid; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 94d5a764a38..523117b8351 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -40,7 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; class BonPrelevement extends CommonObject { public $element='widthdraw'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='prelevement_bons'; + public $picto = 'payment'; var $date_echeance; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 31c616ac00d..edb316674b3 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class PaymentSalary extends CommonObject { public $element='payment_salary'; //!< Id that identify managed objects - public $table_element='payment_salary'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_salary'; + public $picto='payment'; public $tms; diff --git a/htdocs/compta/salaries/class/salariesstats.class.php b/htdocs/compta/salaries/class/salariesstats.class.php index 647dc27f4a5..82a8d094148 100644 --- a/htdocs/compta/salaries/class/salariesstats.class.php +++ b/htdocs/compta/salaries/class/salariesstats.class.php @@ -29,6 +29,9 @@ include_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php */ class SalariesStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid; diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index a44b820c8ea..de382423cc5 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -38,14 +38,12 @@ class Cchargesociales * @var string Id to identify managed objects */ public $element = 'cchargesociales'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_chargesociales'; - /** - */ - public $libelle; public $deductible; public $active; @@ -53,9 +51,6 @@ class Cchargesociales public $fk_pays; public $module; public $accountancy_code; - - /** - */ /** diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 65e6085a650..023dd334583 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -34,7 +34,12 @@ class ChargeSociales extends CommonObject { public $element='chargesociales'; public $table='chargesociales'; - public $table_element='chargesociales'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='chargesociales'; + public $picto = 'bill'; /** diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 114a2e78cf1..26d8094acbd 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' class PaymentSocialContribution extends CommonObject { public $element='paiementcharge'; //!< Id that identify managed objects - public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='paiementcharge'; + public $picto = 'payment'; var $fk_charge; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 3ff8df88600..d3b7c42b86b 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Tva extends CommonObject { public $element='tva'; //!< Id that identify managed objects - public $table_element='tva'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='tva'; + public $picto='payment'; var $tms; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 92ebbfaeedb..d7d95de2795 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -38,7 +38,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Contact extends CommonObject { public $element='contact'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='socpeople'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'contact'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9fe66648411..b857cad8e2e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -42,15 +42,22 @@ require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php'; class Contrat extends CommonObject { public $element='contrat'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='contrat'; + public $table_element_line='contratdet'; public $fk_element='fk_contrat'; public $picto='contract'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -2452,7 +2459,11 @@ class Contrat extends CommonObject class ContratLigne extends CommonObjectLine { public $element='contratdet'; - public $table_element='contratdet'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='contratdet'; /** * @var int ID diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 9aeebd575bf..cad33316b68 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -5,7 +5,11 @@ class Comment extends CommonObject { public $element='comment'; //!< Id that identify managed objects - public $table_element='comment'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='comment'; public $fk_element; public $element_type; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 05de2d6d789..9d8462274cb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -46,47 +46,58 @@ abstract class CommonObject * @var DoliDb Database handler (result of a new DoliDB) */ public $db; + /** * @var int The object identifier */ public $id; + /** * @var string Error string * @see errors */ public $error; + /** * @var string[] Array of error strings */ public $errors=array(); + /** * @var string */ public $element; + /** - * @var string + * @var string Name of table without prefix where object is stored */ - public $table_element; + public $table_element + /** * @var */ public $table_element_line; + /** * @var string Key value used to track if data is coming from import wizard */ public $import_key; + /** * @var mixed Contains data to manage extrafields */ public $array_options=array(); + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ public $linkedObjectsIds; + /** * @var mixed Array of linked objects. Loaded by ->fetchObjectLinked */ public $linkedObjects; + /** * @var Object To store a cloned copy of object before to edit it and keep track of old properties */ @@ -116,11 +127,13 @@ abstract class CommonObject * @see fetch_projet() */ public $project; + /** * @var int The related project ID * @see setProject(), project */ public $fk_project; + /** * @deprecated * @see project @@ -132,6 +145,7 @@ abstract class CommonObject * @see fetch_contact() */ public $contact; + /** * @var int The related contact ID * @see fetch_contact() @@ -165,14 +179,17 @@ abstract class CommonObject * @var string The object's reference */ public $ref; + /** * @var string The object's previous reference */ public $ref_previous; + /** * @var string The object's next reference */ public $ref_next; + /** * @var string An external reference for the object */ @@ -189,36 +206,43 @@ abstract class CommonObject * @see getFullAddress() */ public $country; + /** * @var int * @see getFullAddress(), country */ public $country_id; + /** * @var string * @see getFullAddress(), isInEEC(), country */ public $country_code; + /** * @var string * @see getFullAddress() */ public $state; + /** * @var int * @see getFullAddress(), state */ public $state_id; + /** * @var string * @see getFullAddress(), state */ public $state_code; + /** * @var string * @see getFullAddress(), region */ public $region; + /** * @var string * @see getFullAddress(), region @@ -230,16 +254,19 @@ abstract class CommonObject * @see fetch_barcode() */ public $barcode_type; + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_code; + /** * @var string * @see fetch_barcode(), barcode_type */ public $barcode_type_label; + /** * @var string * @see fetch_barcode(), barcode_type @@ -257,6 +284,7 @@ abstract class CommonObject * @see setPaymentTerms() */ public $cond_reglement_id; + /** * @var int Payment terms ID * @deprecated Kept for compatibility @@ -294,11 +322,13 @@ abstract class CommonObject * @see update_note() */ public $note_public; + /** * @var string Private note * @see update_note() */ public $note_private; + /** * @deprecated * @see note_public @@ -310,21 +340,25 @@ abstract class CommonObject * @see update_price() */ public $total_ht; + /** * @var float Total VAT amount * @see update_price() */ public $total_tva; + /** * @var float Total local tax 1 amount * @see update_price() */ public $total_localtax1; + /** * @var float Total local tax 2 amount * @see update_price() */ public $total_localtax2; + /** * @var float Total amount with taxes * @see update_price() @@ -347,11 +381,13 @@ abstract class CommonObject * @see setIncoterms() */ public $fk_incoterms; + /** * @var string * @see SetIncoterms() */ public $libelle_incoterms; + /** * @var string * @see display_incoterms() diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index a5a6ea879ce..9e0e5b90377 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -36,6 +36,7 @@ class Ctyperesource * @var string Id to identify managed objects */ public $element = 'ctyperesource'; + /** * @var string Name of table without prefix where object is stored */ @@ -46,16 +47,10 @@ class Ctyperesource */ public $lines = array(); - /** - */ - public $code; public $label; public $active; - /** - */ - /** * Constructor diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 7f34165030b..e0ff56d6736 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -39,14 +39,17 @@ class EmailSenderProfile extends CommonObject * @var string ID to identify managed object */ public $element = 'emailsenderprofile'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_email_senderprofile'; + /** * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; + /** * @var string String with name of icon for emailsenderprofile */ diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index eb054792beb..7f77f99f183 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -35,7 +35,11 @@ class Events // extends CommonObject { public $element='events'; //!< Id that identify managed objects - public $table_element='events'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='events'; /** * @var int ID diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 482b647a3df..640ad2ed5ac 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -29,7 +29,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Fiscalyear extends CommonObject { public $element='fiscalyear'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='accounting_fiscalyear'; + public $table_element_line = ''; public $fk_element = ''; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 0441c04a86e..4896a1919d7 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -29,7 +29,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class Link extends CommonObject { public $element = 'link'; - public $table_element = 'links'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'links'; public $entity; public $datea; From 06da7f54a2ac42e7dc60049cc78fb5600cfb984a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 18:48:53 +0200 Subject: [PATCH 33/91] Update and standardize code --- htdocs/cron/class/cronjob.class.php | 7 ++++++- htdocs/don/class/don.class.php | 7 ++++++- htdocs/don/class/donstats.class.php | 3 +++ htdocs/don/class/paymentdonation.class.php | 7 ++++++- htdocs/ecm/class/ecmdirectory.class.php | 7 ++++++- htdocs/ecm/class/ecmfiles.class.php | 9 +++------ htdocs/expedition/class/expedition.class.php | 9 +++++++++ .../class/expeditionstats.class.php | 3 +++ .../class/expensereport_ik.class.php | 5 +++++ .../class/expensereport_rule.class.php | 5 +++++ .../class/expensereportstats.class.php | 5 ++++- .../class/paymentexpensereport.class.php | 7 ++++++- htdocs/fichinter/class/fichinter.class.php | 10 ++++++++++ .../fichinter/class/fichinterstats.class.php | 3 +++ .../class/fournisseur.commande.class.php | 14 +++++++++++++- .../fourn/class/fournisseur.facture.class.php | 19 ++++++++++++++++++- htdocs/fourn/class/paiementfourn.class.php | 5 +++++ htdocs/holiday/class/holiday.class.php | 5 +++++ htdocs/hrm/class/establishment.class.php | 5 +++++ htdocs/livraison/class/livraison.class.php | 9 +++++++++ htdocs/loan/class/loan.class.php | 4 ++++ htdocs/loan/class/loanschedule.class.php | 6 +++++- htdocs/loan/class/paymentloan.class.php | 6 +++++- 23 files changed, 144 insertions(+), 16 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 3ccf27ee676..88d9fc706e1 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; class Cronjob extends CommonObject { public $element='cronjob'; //!< Id that identify managed objects - public $table_element='cronjob'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='cronjob'; + public $picto = 'cron'; public $entity; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 2fa0ee44178..71c8bbd3abb 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Don extends CommonObject { public $element='don'; // Id that identify managed objects - public $table_element='don'; // Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='don'; + public $fk_element = 'fk_donation'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $picto = 'generic'; diff --git a/htdocs/don/class/donstats.class.php b/htdocs/don/class/donstats.class.php index dfe74b7f691..52cff09c67e 100644 --- a/htdocs/don/class/donstats.class.php +++ b/htdocs/don/class/donstats.class.php @@ -34,6 +34,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class DonationStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid; diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 8d31c292155..939c4e33780 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -30,7 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class PaymentDonation extends CommonObject { public $element='payment_donation'; //!< Id that identify managed objects - public $table_element='payment_donation'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_donation'; + public $picto = 'payment'; public $rowid; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 1ae5f980017..4eb31ee134b 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -28,7 +28,12 @@ class EcmDirectory // extends CommonObject { public $element='ecm_directories'; //!< Id that identify managed objects - //public $table_element='ecm_directories'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + //public $table_element='ecm_directories'; + var $picto = 'dir'; /** diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index df76bac3e9b..d6eff8e697b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -40,14 +40,14 @@ class EcmFiles extends CommonObject * @var string Id to identify managed objects */ public $element = 'ecmfiles'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ecm_files'; + public $picto = 'generic'; - /** - */ public $ref; // hash of file path public $label; // hash of file content (md5_file(dol_osencode($destfull)) public $share; // hash for file sharing, empty by default (example: getRandomPassword(true)) @@ -68,10 +68,7 @@ class EcmFiles extends CommonObject public $acl; public $src_object_type; public $src_object_id; - - /** - */ - + /** * Constructor diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e9246cbe751..da911520ead 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -46,7 +46,12 @@ class Expedition extends CommonObject { public $element="shipping"; public $fk_element="fk_expedition"; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element="expedition"; + public $table_element_line="expeditiondet"; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'sending'; @@ -2268,6 +2273,10 @@ class Expedition extends CommonObject class ExpeditionLigne extends CommonObjectLine { public $element='expeditiondet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='expeditiondet'; public $fk_origin_line; diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php index 5303d6d8b7b..dcdf9c97617 100644 --- a/htdocs/expedition/class/expeditionstats.class.php +++ b/htdocs/expedition/class/expeditionstats.class.php @@ -34,6 +34,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class ExpeditionStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid; diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index a93d4e9062c..849d688ba2a 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -30,7 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; class ExpenseReportIk extends CoreObject { public $element='expenseik'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='expensereport_ik'; + public $fk_element='fk_expense_ik'; /** diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 11bc480bf4f..2d2dddb1f66 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -30,7 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; class ExpenseReportRule extends CoreObject { public $element='expenserule'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='expensereport_rules'; + public $fk_element='fk_expense_rule'; /** diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php index 2c15b1ffed5..bc306d27e4b 100644 --- a/htdocs/expensereport/class/expensereportstats.class.php +++ b/htdocs/expensereport/class/expensereportstats.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; */ class ExpenseReportStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 781b22d27e7..d8c5f51647b 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class PaymentExpenseReport extends CommonObject { public $element='payment_expensereport'; //!< Id that identify managed objects - public $table_element='payment_expensereport'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_expensereport'; + public $picto = 'payment'; var $rowid; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 2c6c8fef402..e235ec1ea12 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -36,7 +36,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php'; class Fichinter extends CommonObject { public $element='fichinter'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='fichinter'; + public $fk_element='fk_fichinter'; public $table_element_line='fichinterdet'; public $picto = 'intervention'; @@ -1327,7 +1332,12 @@ class FichinterLigne extends CommonObjectLine var $rang = 0; public $element='fichinterdet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='fichinterdet'; + public $fk_element='fk_fichinter'; /** diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index b435398fec2..aa6d85d0c3f 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -33,6 +33,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; */ class FichinterStats extends Stats { + /** + * @var string Name of table without prefix where object is stored + */ public $table_element; var $socid; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dfceb8d4e73..6ffc8ebc9b3 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -41,15 +41,22 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; class CommandeFournisseur extends CommonOrder { public $element='order_supplier'; - public $table_element='commande_fournisseur'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='commande_fournisseur'; + public $table_element_line = 'commande_fournisseurdet'; public $fk_element = 'fk_commande'; public $picto='order'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -68,6 +75,7 @@ class CommandeFournisseur extends CommonOrder * @var string */ public $ref; + public $ref_supplier; public $brouillon; public $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Ordered/Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially @@ -3085,6 +3093,10 @@ class CommandeFournisseur extends CommonOrder class CommandeFournisseurLigne extends CommonOrderLine { public $element='commande_fournisseurdet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='commande_fournisseurdet'; public $oldline; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8ce8b796892..813b2a468c4 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -42,15 +42,22 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; class FactureFournisseur extends CommonInvoice { public $element='invoice_supplier'; - public $table_element='facture_fourn'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='facture_fourn'; + public $table_element_line='facture_fourn_det'; public $fk_element='fk_facture_fourn'; public $picto='bill'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -100,11 +107,13 @@ class FactureFournisseur extends CommonInvoice public $total_localtax1=0; public $total_localtax2=0; public $total_ttc=0; + /** * @deprecated * @see note_private, note_public */ public $note; + public $note_private; public $note_public; public $propalid; @@ -2557,6 +2566,10 @@ class FactureFournisseur extends CommonInvoice class SupplierInvoiceLine extends CommonObjectLine { public $element='facture_fourn_det'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='facture_fourn_det'; public $oldline; @@ -2566,6 +2579,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see product_ref */ public $ref; + /** * Internal ref * @var string @@ -2584,6 +2598,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see label */ public $libelle; + /** * Product description * @var string @@ -2597,6 +2612,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see subprice */ public $pu_ht; + public $subprice; /** @@ -2612,6 +2628,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see total_tva */ public $tva; + public $total_tva; /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 494196e9c2d..d1c71a2cd98 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -36,7 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; class PaiementFourn extends Paiement { public $element='payment_supplier'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='paiementfourn'; + public $picto = 'payment'; var $statut; //Status of payment. 0 = unvalidated; 1 = validated diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index e5c4faf4d12..5a1078aad82 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -33,7 +33,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Holiday extends CommonObject { public $element='holiday'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='holiday'; + public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $fk_element = 'fk_holiday'; public $picto = 'holiday'; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 8a99788d040..a39e6a20b08 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -29,7 +29,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class Establishment extends CommonObject { public $element='establishment'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='establishment'; + public $table_element_line = ''; public $fk_element = 'fk_establishment'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index f8874b72e3f..dcb560653ea 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -41,7 +41,12 @@ class Livraison extends CommonObject { public $element="delivery"; public $fk_element="fk_livraison"; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element="livraison"; + public $table_element_line="livraisondet"; var $brouillon; @@ -1091,6 +1096,10 @@ class LivraisonLigne extends CommonObjectLine public $product_label; public $element='livraisondet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='livraisondet'; /** diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 7843694585f..1e75aa063cf 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -31,6 +31,10 @@ class Loan extends CommonObject { public $element='loan'; public $table='loan'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='loan'; public $picto = 'bill'; diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index a430f79366e..dbf3f3f3e46 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class LoanSchedule extends CommonObject { public $element='loan_schedule'; //!< Id that identify managed objects - public $table_element='loan_schedule'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='loan_schedule'; var $fk_loan; var $datec=''; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 595aead109e..9d845b7a1cd 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class PaymentLoan extends CommonObject { public $element='payment_loan'; //!< Id that identify managed objects - public $table_element='payment_loan'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_loan'; var $fk_loan; var $datec=''; From 0c75c41e7bb37e48775535c025b7a1ab576366f2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 22 Aug 2018 19:56:24 +0200 Subject: [PATCH 34/91] Update and standardize code --- .../class/fournisseur.commande.dispatch.class.php | 4 ++++ .../template/class/myobject.class.php | 8 ++++++++ htdocs/multicurrency/class/multicurrency.class.php | 14 ++++++++++++++ .../opensurvey/class/opensurveysondage.class.php | 7 ++++++- htdocs/product/class/product.class.php | 5 +++++ .../dynamic_price/class/price_expression.class.php | 6 +++++- .../class/price_global_variable.class.php | 6 +++++- .../class/price_global_variable_updater.class.php | 6 +++++- htdocs/product/inventory/class/inventory.class.php | 6 ++++++ htdocs/product/stock/class/entrepot.class.php | 5 +++++ .../product/stock/class/mouvementstock.class.php | 1 + htdocs/product/stock/class/productlot.class.php | 1 + .../stock/class/productstockentrepot.class.php | 7 +------ htdocs/projet/class/project.class.php | 7 ++++++- htdocs/projet/class/task.class.php | 7 ++++++- htdocs/resource/class/dolresource.class.php | 7 ++++++- htdocs/societe/class/companypaymentmode.class.php | 4 ++++ htdocs/societe/class/societe.class.php | 5 +++++ htdocs/societe/class/societeaccount.class.php | 3 +++ .../class/supplier_proposal.class.php | 13 +++++++++++-- htdocs/ticket/class/ticket.class.php | 5 +++++ htdocs/ticket/class/ticketlogs.class.php | 6 +++++- htdocs/ticket/class/ticketstats.class.php | 5 ++++- htdocs/user/class/user.class.php | 5 +++++ htdocs/user/class/usergroup.class.php | 5 +++++ htdocs/website/class/website.class.php | 10 ++++++++++ htdocs/website/class/websitepage.class.php | 5 ++--- 27 files changed, 143 insertions(+), 20 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 910115d8822..f84bc7e5f31 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -38,6 +38,10 @@ class CommandeFournisseurDispatch extends CommonObject public $error; //!< To return error code (or message) public $errors=array(); //!< To return several error codes (or messages) public $element='commandefournisseurdispatch'; //!< Id that identify managed objects + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored public $lines=array(); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index c6cd6fae901..24ff8d8ee8f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -36,18 +36,22 @@ class MyObject extends CommonObject * @var string ID to identify managed object */ public $element = 'myobject'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'mymodule_myobject'; + /** * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var int Does myobject support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ @@ -117,18 +121,22 @@ class MyObject extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'myobjectdet'; + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_myobject'; + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'MyObjectline'; + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('myobjectdet'); + /** * @var MyObjectLine[] Array of subtable lines */ diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 926fb20098b..eda61f27b98 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -42,10 +42,12 @@ class MultiCurrency extends CommonObject * @var string Id to identify managed objects */ public $element = 'multicurrency'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency'; + /** * @var string Name of table without prefix where object is stored */ @@ -60,26 +62,32 @@ class MultiCurrency extends CommonObject * @var mixed Sample property 1 */ public $id; + /** * @var mixed Sample property 1 */ public $code; + /** * @var mixed Sample property 2 */ public $name; + /** * @var mixed Sample property 2 */ public $entity; + /** * @var mixed Sample property 2 */ public $date_create; + /** * @var mixed Sample property 2 */ public $fk_user; + /** * @var mixed Sample property 2 */ @@ -687,26 +695,32 @@ class CurrencyRate extends CommonObjectLine * @var string Id to identify managed objects */ public $element = 'multicurrency_rate'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency_rate'; + /** * @var int ID */ public $id; + /** * @var double Rate */ public $rate; + /** * @var date Date synchronisation */ public $date_sync; + /** * @var int Id of currency */ public $fk_multicurrency; + /** * @var int Id of entity */ diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index d80bac70b79..f62fd69c781 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -35,7 +35,12 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; class Opensurveysondage extends CommonObject { public $element='opensurvey_sondage'; //!< Id that identify managed objects - public $table_element='opensurvey_sondage'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='opensurvey_sondage'; + public $picto = 'opensurvey'; public $id_sondage; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a6db67c7709..b02da68cc12 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -44,7 +44,12 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; class Product extends CommonObject { public $element='product'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='product'; + public $fk_element='fk_product'; protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 5e9abd4c241..b06bdfe211e 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -51,7 +51,11 @@ class PriceExpression var $title; var $expression; - public $table_element = "c_price_expression"; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = "c_price_expression"; /** * Constructor diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index a5b02af8061..f30260a30c0 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -52,7 +52,11 @@ class PriceGlobalVariable var $code; var $description; var $value; - public $table_element = "c_price_global_variable"; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = "c_price_global_variable"; /** * Constructor diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index f807ac267f3..7ca18f36b5d 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -59,7 +59,11 @@ class PriceGlobalVariableUpdater var $update_interval; //!< Interval in mins var $next_update; //!< Next update timestamp var $last_status; - public $table_element = "c_price_global_variable_updater"; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = "c_price_global_variable_updater"; /** * Constructor diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index dc4f600b529..7ba2d5cf5f1 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -38,6 +38,7 @@ class Inventory extends CommonObject * @var string ID to identify managed object */ public $element = 'inventory'; + /** * @var string Name of table without prefix where object is stored */ @@ -47,6 +48,7 @@ class Inventory extends CommonObject * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; + /** * @var string String with name of icon for inventory */ @@ -121,18 +123,22 @@ class Inventory extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'inventorydet'; + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_inventory'; + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'Inventoryline'; + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('inventorydet'); + /** * @var InventoryLine[] Array of subtable lines */ diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index bae42639d28..edae2d19f05 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -34,7 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class Entrepot extends CommonObject { public $element='stock'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='entrepot'; + public $picto='stock'; /** diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 41c00b7361c..7cb06de918e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -34,6 +34,7 @@ class MouvementStock extends CommonObject * @var string Id to identify managed objects */ public $element = 'stockmouvement'; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 8370e8ce080..bb9072b485d 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -39,6 +39,7 @@ class Productlot extends CommonObject * @var string Id to identify managed objects */ public $element = 'productlot'; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index cbca4e5854d..01379e8859c 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -44,14 +44,12 @@ class ProductStockEntrepot extends CommonObject * @var string Id to identify managed objects */ public $element = 'ProductStockEntrepot'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'product_warehouse_properties'; - /** - */ - public $tms = ''; public $fk_product; public $fk_entrepot; @@ -59,9 +57,6 @@ class ProductStockEntrepot extends CommonObject public $desiredstock; public $import_key; - /** - */ - /** * Constructor diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index dbd2ee57103..16c187e1842 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -34,7 +34,12 @@ class Project extends CommonObject { public $element = 'project'; //!< Id that identify managed objects - public $table_element = 'projet'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'projet'; + public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 8fc55605e1f..e7546048950 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; class Task extends CommonObject { public $element='project_task'; //!< Id that identify managed objects - public $table_element='projet_task'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='projet_task'; + public $fk_element='fk_task'; public $picto = 'task'; protected $childtables=array('projet_task_time'); // To test if we can delete object diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 229faccff9a..4e580fd6e26 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -31,7 +31,12 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; class Dolresource extends CommonObject { public $element='dolresource'; //!< Id that identify managed objects - public $table_element='resource'; //!< Name of table without prefix where object is stored + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='resource'; + public $picto = 'resource'; public $resource_id; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 4403d5b8fde..15a254844f0 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -36,18 +36,22 @@ class CompanyPaymentMode extends CommonObject * @var string ID to identify managed object */ public $element = 'companypaymentmode'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_rib'; + /** * @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 2; + /** * @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 0; + /** * @var string String with name of icon for companypaymentmode. Must be the part after the 'object_' into object_companypaymentmode.png */ diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c70d0a1a3e2..39fa367e26a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -42,7 +42,12 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; class Societe extends CommonObject { public $element='societe'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'societe'; + public $fk_element='fk_soc'; public $fieldsforcombobox='nom,name_alias'; protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 7340a319534..e6620657956 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -39,14 +39,17 @@ class SocieteAccount extends CommonObject * @var string ID to identify managed object */ public $element = 'societeaccount'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_account'; + /** * @var array Does societeaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index f2945ccc308..34485e0b4fe 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -46,7 +46,12 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; class SupplierProposal extends CommonObject { public $element='supplier_proposal'; - public $table_element='supplier_proposal'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='supplier_proposal'; + public $table_element_line='supplier_proposaldet'; public $fk_element='fk_supplier_proposal'; public $picto='propal'; @@ -2647,7 +2652,11 @@ class SupplierProposalLine extends CommonObjectLine public $error=''; public $element='supplier_proposaldet'; - public $table_element='supplier_proposaldet'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='supplier_proposaldet'; var $oldline; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4430ae3e0f0..17cead40826 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -38,22 +38,27 @@ class Ticket extends CommonObject * @var string ID to identify managed object */ public $element = 'ticket'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ticket'; + /** * @var string Name of field for link to tickets */ public $fk_element='fk_ticket'; + /** * @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; + /** * @var int Does ticketcore support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; + /** * @var string String with name of icon for ticketcore. Must be the part after the 'object_' into object_ticketcore.png */ diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index b4a464f6a17..792d5e55196 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -35,8 +35,12 @@ class Ticketlogs// extends CommonObject public $db; //!< To store db handler public $error; //!< To return error code (or message) public $errors = array(); //!< To return several error codes (or messages) + public $element = 'ticketlogs'; //!< Id that identify managed objects - public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored public $id; diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index 6b65f25016a..28a49a3bd8f 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.php @@ -29,7 +29,10 @@ require_once 'ticket.class.php'; */ class TicketStats extends Stats { - public $table_element; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element; public $socid; public $userid; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 93a51cc9da0..90b5d477180 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -41,7 +41,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; class User extends CommonObject { public $element='user'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='user'; + public $fk_element='fk_user'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 9c2f3437fa4..7bcfa05ab28 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -36,7 +36,12 @@ if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/l class UserGroup extends CommonObject { public $element='usergroup'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='usergroup'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='group'; public $entity; // Entity of group diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index ed49d4a43d7..be6770743bc 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -39,14 +39,17 @@ class Website extends CommonObject * @var string Id to identify managed objects */ public $element = 'website'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website'; + /** * @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; + /** * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png */ @@ -56,30 +59,37 @@ class Website extends CommonObject * @var int */ public $entity; + /** * @var string */ public $ref; + /** * @var string */ public $description; + /** * @var int */ public $status; + /** * @var mixed */ public $date_creation; + /** * @var mixed */ public $tms = ''; + /** * @var integer */ public $fk_default_home; + /** * @var string */ diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 17ad6e31c87..c4253683151 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -39,18 +39,17 @@ class WebsitePage extends CommonObject * @var string Id to identify managed objects */ public $element = 'websitepage'; + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website_page'; + /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'label'; - /** - */ - public $fk_website; public $pageurl; public $aliasalt; From 137b715868f7dbec2c5cd237a46aeb6e26e266c6 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:28:33 +0200 Subject: [PATCH 35/91] Update deplacementstats.class.php --- htdocs/compta/deplacement/class/deplacementstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 9d99063e726..e490c90f1ed 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -31,9 +31,9 @@ include_once DOL_DOCUMENT_ROOT . '/compta/deplacement/class/deplacement.class.ph class DeplacementStats extends Stats { /** - * @var string Name of table without prefix where object is stored - */ - public $table_element; + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; From 25b1b08d922964f2844495e0f44292defc30808f Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:30:09 +0200 Subject: [PATCH 36/91] Update accountancysystem.class.php --- htdocs/accountancy/class/accountancysystem.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index a755c3c0602..8b30070317a 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -28,7 +28,7 @@ */ class AccountancySystem { - /** + /** * @var DoliDB Database handler. */ public $db; @@ -43,7 +43,7 @@ class AccountancySystem var $pcg_type; var $pcg_subtype; - /** + /** * @var string proper name for given parameter */ public $label; From ec8422af73ac7f7251631a41e80678bb21000ca5 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:31:54 +0200 Subject: [PATCH 37/91] Update accountingaccount.class.php --- htdocs/accountancy/class/accountingaccount.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index fb2d1d477ed..ad55862e6a2 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -51,9 +51,9 @@ class AccountingAccount extends CommonObject public $restrictiononfksoc = 1; /** - * @var DoliDB Database handler. - */ - public $db; + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) @@ -80,9 +80,9 @@ class AccountingAccount extends CommonObject var $account_category; /** - * @var string proper name for given parameter - */ - public $label; + * @var string proper name for given parameter + */ + public $label; var $fk_user_author; var $fk_user_modif; From 92cb9c42047b4205e8e7391dfa0394c19e1daed1 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:35:04 +0200 Subject: [PATCH 38/91] Update adherentstats.class.php --- htdocs/adherents/class/adherentstats.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index aef2f275c89..bfa990a04c0 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -33,9 +33,9 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/subscription.class.php'; class AdherentStats extends Stats { /** - * @var string Name of table without prefix where object is stored - */ - public $table_element; + * @var string Name of table without prefix where object is stored + */ + public $table_element; var $socid; var $userid; From d03900c6f8e00dec8239bf8a1417a12c4ad6a51a Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:36:07 +0200 Subject: [PATCH 39/91] Update bookmark.class.php --- htdocs/bookmarks/class/bookmark.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index a78c75a43db..da76cac7a0a 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -31,9 +31,9 @@ class Bookmark extends CommonObject public $element='bookmark'; /** - * @var string Name of table without prefix where object is stored - */ - public $table_element='bookmark'; + * @var string Name of table without prefix where object is stored + */ + public $table_element='bookmark'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; From 4066af99e06576ee68ddf3014dae1d1986a9ecac Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:37:02 +0200 Subject: [PATCH 40/91] Update bookmark.class.php --- htdocs/bookmarks/class/bookmark.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index da76cac7a0a..3bbdf293f37 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -44,9 +44,9 @@ class Bookmark extends CommonObject public $db; /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; var $fk_user; var $datec; From c626dcb7107811250692a37f8bd4bf2efc5043ed Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:38:00 +0200 Subject: [PATCH 41/91] Update actioncomm.class.php --- htdocs/comm/action/class/actioncomm.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 34478c0b6b2..32a442885f8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -37,9 +37,9 @@ class ActionComm extends CommonObject public $element='action'; /** - * @var string Name of table without prefix where object is stored - */ - public $table_element = 'actioncomm'; + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'actioncomm'; public $table_rowid = 'id'; public $picto='action'; From eeaa257f1118879d8b1a337f0d2a40ad6771f88f Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:39:51 +0200 Subject: [PATCH 42/91] Update cactioncomm.class.php --- htdocs/comm/action/class/cactioncomm.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index a0403c0a0a4..cdccca9968b 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -29,9 +29,9 @@ class CActionComm { /** - * @var string Error code (or message) - */ - public $error=''; + * @var string Error code (or message) + */ + public $error=''; /** * @var DoliDB Database handler. @@ -39,9 +39,9 @@ class CActionComm public $db; /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; var $code; var $type; From 9b2e754b466790eaaab4bf585503dd6693a88332 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:41:22 +0200 Subject: [PATCH 43/91] Update advtargetemailing.class.php --- htdocs/comm/mailing/class/advtargetemailing.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 396c020b7b6..1f4968ef6b2 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -29,9 +29,9 @@ class AdvanceTargetingMailing extends CommonObject { /** - * @var DoliDB Database handler. - */ - public $db; + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) @@ -972,4 +972,4 @@ class AdvanceTargetingMailing extends CommonObject } -} \ No newline at end of file +} From 3309badd8ddedc747e5ac396d2de138bd7a2313b Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Wed, 22 Aug 2018 22:43:17 +0200 Subject: [PATCH 44/91] Update accountingaccount.class.php --- htdocs/accountancy/class/accountingaccount.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index ad55862e6a2..6a72b881aab 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -44,6 +44,7 @@ class AccountingAccount extends CommonObject * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer From f81591531831d8c8f000a5b3d647e24ebc6b6227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 22:51:09 +0200 Subject: [PATCH 45/91] Update actions_ticket.class.php --- htdocs/ticket/class/actions_ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index fdfe342f35d..c88994a4ca2 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -951,7 +951,7 @@ class ActionsTicket * Print statut * * @param int $mode Display mode - * @return void + * @return string */ public function getLibStatut($mode = 0) { From 692352e0e45f31daaaf47455cb191cf7e7627bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 22:55:12 +0200 Subject: [PATCH 46/91] Update propal.lib.php --- htdocs/core/lib/propal.lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 5f207999cd8..aec26236113 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -32,9 +32,7 @@ function propal_prepare_head($object) { global $db, $langs, $conf, $user; - $langs->load("propal"); - $langs->load("compta"); - $langs->load("companies"); + $langs->loadLangs(array('propal', 'compta', 'companies')); $h = 0; $head = array(); From e09f7bedd026085b0b81858aca0146bd5a23ac39 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 23 Aug 2018 09:57:19 +0200 Subject: [PATCH 47/91] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9d8462274cb..97ba1f814d0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -71,7 +71,7 @@ abstract class CommonObject /** * @var string Name of table without prefix where object is stored */ - public $table_element + public $table_element; /** * @var From 0e3c9ffd512dd90f4ceb9f32b4080a5a74fed505 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 23 Aug 2018 10:05:02 +0200 Subject: [PATCH 48/91] Update fournisseur.facture.class.php --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 813b2a468c4..b3d62a4f6b8 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -44,9 +44,9 @@ class FactureFournisseur extends CommonInvoice public $element='invoice_supplier'; /** - * @var string Name of table without prefix where object is stored - */ - public $table_element='facture_fourn'; + * @var string Name of table without prefix where object is stored + */ + public $table_element='facture_fourn'; public $table_element_line='facture_fourn_det'; public $fk_element='fk_facture_fourn'; From b2a438b384ad5bdc7cf9ad5da80bdfc508a23042 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 23 Aug 2018 10:06:32 +0200 Subject: [PATCH 49/91] fix sync user/member add more fields to sync --- htdocs/adherents/class/adherent.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6b7462ba42a..76cea4d34e0 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -531,6 +531,13 @@ class Adherent extends CommonObject $luser->pass=$this->pass; $luser->societe_id=$this->societe; + $luser->birth=$this->birth; + $luser->address=$this->address; + $luser->zip=$this->zip; + $luser->town=$this->town; + $luser->country_id=$this->country_id; + $luser->state_id=$this->state_id; + $luser->email=$this->email; $luser->skype=$this->skype; $luser->office_phone=$this->phone; From b81751799732aa217e6c9c7a43d096ba49fa4f74 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 23 Aug 2018 10:08:17 +0200 Subject: [PATCH 50/91] Update fournisseur.product.class.php --- .../fourn/class/fournisseur.product.class.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index b109a5e6c71..8f77d152036 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -43,21 +43,21 @@ class ProductFournisseur extends Product public $db; /** - * @var string Error code (or message) - */ - public $error=''; + * @var string Error code (or message) + */ + public $error=''; var $product_fourn_price_id; // id of ligne product-supplier /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; - /** - * @deprecated - * @see ref_supplier - */ + /** + * @deprecated + * @see ref_supplier + */ var $fourn_ref; var $delivery_time_days; var $ref_supplier; // ref supplier (can be set by get_buyprice) @@ -89,9 +89,9 @@ class ProductFournisseur extends Product var $fourn_multicurrency_unitprice; /** - * Constructor - * - * @param DoliDB $db Database handler + * Constructor + * + * @param DoliDB $db Database handler */ function __construct($db) { From 20e7fc09696c3f502e35dee7ffa5a3689ae65c40 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 23 Aug 2018 10:11:40 +0200 Subject: [PATCH 51/91] Update livraison.class.php --- htdocs/livraison/class/livraison.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index dcb560653ea..f61c8eabb2a 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -3,8 +3,8 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2011-2012 Philippe Grand - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -1062,7 +1062,7 @@ class Livraison extends CommonObject */ class LivraisonLigne extends CommonObjectLine { - /** + /** * @var DoliDB Database handler. */ public $db; @@ -1075,7 +1075,7 @@ class LivraisonLigne extends CommonObjectLine var $fk_product; var $origin_id; - /** + /** * @var string proper name for given parameter */ public $label; From bcd7833af080986295130861d2aac3486380e8c4 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 23 Aug 2018 10:16:33 +0200 Subject: [PATCH 52/91] Fix sync user->member add more fields --- htdocs/user/class/user.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 93a51cc9da0..345d15fbc59 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1528,6 +1528,12 @@ class User extends CommonObject $adh->societe=(empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe); + $adh->address=$this->address; + $adh->town=$this->town; + $adh->zip=$this->zip; + $adh->state_id=$this->state_id; + $adh->country_id=$this->country_id; + $adh->email=$this->email; $adh->skype=$this->skype; $adh->phone=$this->office_phone; From aafa16afa5fc664b52ead32c8acb5b914d972a34 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 11:11:46 +0200 Subject: [PATCH 53/91] Update and standardize code --- htdocs/accountancy/class/accountancycategory.class.php | 6 +++++- htdocs/core/boxes/box_last_modified_ticket.php | 5 +++++ htdocs/core/boxes/box_last_ticket.php | 5 +++++ htdocs/core/class/discount.class.php | 4 ++++ htdocs/core/class/html.formticket.class.php | 3 +++ htdocs/core/class/menubase.class.php | 6 +++++- htdocs/core/modules/import/modules_import.php | 4 ++++ .../triggers/interface_50_modTicket_TicketEmail.class.php | 3 +++ .../core/triggers/interface_80_modStripe_Stripe.class.php | 3 +++ htdocs/fourn/class/fournisseur.commande.dispatch.class.php | 6 +++++- htdocs/ticket/class/actions_ticket.class.php | 4 ++++ htdocs/ticket/class/ticketlogs.class.php | 6 +++++- 12 files changed, 51 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 127e220d3d1..4cb11b78d44 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // extends CommonObject { - public $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; + public $error; //!< To return error code (or message) public $errors=array(); //!< To return several error codes (or messages) public $element='c_accounting_category'; //!< Id that identify managed objects diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index a0613d58f3e..9ce7dd91605 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -34,7 +34,12 @@ class box_last_modified_ticket extends ModeleBoxes public $boximg = "ticket"; public $boxlabel; public $depends = array("ticket"); + + /** + * @var DoliDB Database handler. + */ public $db; + public $param; public $info_box_head = array(); public $info_box_contents = array(); diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 2dfa71af904..a824a707168 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -34,7 +34,12 @@ class box_last_ticket extends ModeleBoxes public $boximg = "ticket"; public $boxlabel; public $depends = array("ticket"); + + /** + * @var DoliDB Database handler. + */ public $db; + public $param; public $info_box_head = array(); public $info_box_contents = array(); diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 9fc1921aa60..aa6c6eb9b5c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -28,7 +28,11 @@ */ class DiscountAbsolute { + /** + * @var DoliDB Database handler. + */ public $db; + public $error; public $id; // Id discount diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 9c3daefd62a..5da6f4fe439 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -39,6 +39,9 @@ if (!class_exists('FormCompany')) { */ class FormTicket { + /** + * @var DoliDB Database handler. + */ public $db; public $track_id; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 48880633563..e0ea1d57378 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -28,7 +28,11 @@ */ class Menubase { - public $db; // To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; + public $error; // To return error code (or message) public $errors=array(); // To return several error codes (or messages) diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 548bb128193..7c26fdb68d3 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -30,7 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; */ class ModeleImports { + /** + * @var DoliDB Database handler. + */ public $db; + public $datatoimport; public $error=''; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 3e28ea3e4ef..317cb6a22c6 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -30,6 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class InterfaceTicketEmail extends DolibarrTriggers { + /** + * @var DoliDB Database handler. + */ public $db; /** diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 79ef62675e9..ab0cd62eb82 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -35,6 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class InterfaceStripe { + /** + * @var DoliDB Database handler. + */ public $db; /** diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index f84bc7e5f31..d957d0969cd 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -34,7 +34,11 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class CommandeFournisseurDispatch extends CommonObject { - public $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; + public $error; //!< To return error code (or message) public $errors=array(); //!< To return several error codes (or messages) public $element='commandefournisseurdispatch'; //!< Id that identify managed objects diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index fdfe342f35d..27dbf9ff942 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -35,7 +35,11 @@ require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; */ class ActionsTicket { + /** + * @var DoliDB Database handler. + */ public $db; + public $dao; public $mesg; diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index 792d5e55196..448d3cc7c41 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php"; */ class Ticketlogs// extends CommonObject { - public $db; //!< To store db handler + /** + * @var DoliDB Database handler. + */ + public $db; + public $error; //!< To return error code (or message) public $errors = array(); //!< To return several error codes (or messages) From 80b7229174f92d8c9fe99db92b8bbbae7b40e705 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 11:34:55 +0200 Subject: [PATCH 54/91] Standardize and update code --- htdocs/accountancy/class/accountancycategory.class.php | 7 ++++++- htdocs/core/class/discount.class.php | 5 ++++- htdocs/core/class/html.formfile.class.php | 4 ++++ htdocs/core/class/html.formother.class.php | 6 +++++- htdocs/core/class/html.formticket.class.php | 5 ++++- htdocs/core/class/html.formwebsite.class.php | 6 +++++- htdocs/core/class/menubase.class.php | 6 +++++- htdocs/ecm/class/ecmdirectory.class.php | 4 ++++ htdocs/fourn/class/fournisseur.commande.dispatch.class.php | 6 +++++- htdocs/ticket/class/actions_ticket.class.php | 7 ++++++- htdocs/ticket/class/ticketlogs.class.php | 6 +++++- 11 files changed, 53 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 4cb11b78d44..6bbe6e08dfb 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -35,7 +35,12 @@ class AccountancyCategory // extends CommonObject */ public $db; - public $error; //!< To return error code (or message) + /** + * @var string Error string + * @see errors + */ + public $error; + public $errors=array(); //!< To return several error codes (or messages) public $element='c_accounting_category'; //!< Id that identify managed objects diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index aa6c6eb9b5c..b3cfb73654b 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -33,7 +33,10 @@ class DiscountAbsolute */ public $db; - public $error; + /** + * @var string Error code (or message) + */ + public $error; public $id; // Id discount public $fk_soc; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 117ec484c15..15e22944d83 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -36,7 +36,11 @@ class FormFile { private $db; + /** + * @var string Error code (or message) + */ public $error; + public $numoffiles; public $infofiles; // Used to return informations by function getDocumentsLink diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 69fe03ecaa1..6982a8a6971 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -38,7 +38,11 @@ class FormOther { private $db; - public $error; + + /** + * @var string Error code (or message) + */ + public $error; /** diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 5da6f4fe439..c0f4a3f75d2 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -83,7 +83,10 @@ class FormTicket public $substit = array(); public $param = array(); - public $error; + /** + * @var string Error code (or message) + */ + public $error; /** diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index fc863c4d069..5b883835fd3 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -28,7 +28,11 @@ class FormWebsite { private $db; - public $error; + + /** + * @var string Error code (or message) + */ + public $error; /** diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index e0ea1d57378..64589e0db65 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -33,7 +33,11 @@ class Menubase */ public $db; - public $error; // To return error code (or message) + /** + * @var string Error code (or message) + */ + public $error; + public $errors=array(); // To return several error codes (or messages) public $id; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 4eb31ee134b..cdaaa67b794 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -63,7 +63,11 @@ class EcmDirectory // extends CommonObject public $full_arbo_loaded; + /** + * @var string Error code (or message) + */ public $error; + public $errors; diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index d957d0969cd..1f6929614aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -39,7 +39,11 @@ class CommandeFournisseurDispatch extends CommonObject */ public $db; - public $error; //!< To return error code (or message) + /** + * @var string Error code (or message) + */ + public $error; + public $errors=array(); //!< To return several error codes (or messages) public $element='commandefournisseurdispatch'; //!< Id that identify managed objects diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 27dbf9ff942..b4aaf17e9d8 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -43,7 +43,12 @@ class ActionsTicket public $dao; public $mesg; - public $error; + + /** + * @var string Error code (or message) + */ + public $error; + public $errors = array(); //! Numero de l'erreur public $errno = 0; diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index 448d3cc7c41..fd996d4e3c4 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -37,7 +37,11 @@ class Ticketlogs// extends CommonObject */ public $db; - public $error; //!< To return error code (or message) + /** + * @var string Error code (or message) + */ + public $error; + public $errors = array(); //!< To return several error codes (or messages) public $element = 'ticketlogs'; //!< Id that identify managed objects From 343e6ce8b3ba610f4199421d9d1b35cfa54c8b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Aug 2018 14:34:27 +0200 Subject: [PATCH 55/91] typo --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f5209421694..1adcf7376c5 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -894,7 +894,7 @@ class ActionComm extends CommonObject $val=array('id'=>$val); } $sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; - $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; + $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; $resql = $this->db->query($sql); if (! $resql) From 58d339597b581e8933b80b0d5abe0eea9d3316f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Aug 2018 15:44:33 +0200 Subject: [PATCH 56/91] Create index.html --- htdocs/dav/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/dav/index.html diff --git a/htdocs/dav/index.html b/htdocs/dav/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/dav/index.html @@ -0,0 +1 @@ + From 74ce0bfea6ae285589f63bc083235880f8e07e1b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 16:54:24 +0200 Subject: [PATCH 57/91] Standardize and update code --- htdocs/accountancy/class/accountancycategory.class.php | 6 +++++- htdocs/blockedlog/class/blockedlog.class.php | 4 ++++ htdocs/core/class/dolreceiptprinter.class.php | 4 ++-- htdocs/core/class/html.formmailing.class.php | 5 ++++- htdocs/core/class/menubase.class.php | 5 ++++- htdocs/core/modules/import/import_csv.modules.php | 3 +-- htdocs/ecm/class/ecmdirectory.class.php | 5 ++++- htdocs/fourn/class/fournisseur.commande.dispatch.class.php | 6 +++++- htdocs/ticket/class/actions_ticket.class.php | 6 +++++- htdocs/ticket/class/ticketlogs.class.php | 5 ++++- 10 files changed, 38 insertions(+), 11 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 6bbe6e08dfb..14fedab9b16 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -41,7 +41,11 @@ class AccountancyCategory // extends CommonObject */ public $error; - public $errors=array(); //!< To return several error codes (or messages) + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + public $element='c_accounting_category'; //!< Id that identify managed objects /** diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 4d7c5e5c3c4..654709cec6f 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -46,6 +46,10 @@ class BlockedLog public $entity; public $error = ''; + + /** + * @var string[] Error codes (or messages) + */ public $errors = array(); /** diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 78a9b2479eb..34f725b8258 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -119,11 +119,11 @@ class dolReceiptPrinter extends Escpos * @var string Error code (or message) */ public $error=''; + /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index c0cadfba460..067692f5094 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -27,7 +27,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; */ class FormMailing extends Form { - public $errors=array(); + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); /** * Output a select with destinaries status diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 64589e0db65..715f17b5a92 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -38,7 +38,10 @@ class Menubase */ public $error; - public $errors=array(); // To return several error codes (or messages) + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); public $id; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1841cac9895..09b33aea877 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -46,10 +46,9 @@ class ImportCsv extends ModeleImports public $error=''; /** - * * @var string[] Error codes (or messages) */ - public $errors = array (); + public $errors = array(); /** * @var int ID diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index cdaaa67b794..6f3aefbc9d8 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -68,7 +68,10 @@ class EcmDirectory // extends CommonObject */ public $error; - public $errors; + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); /** diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 1f6929614aa..0ff73d0d8e3 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -44,7 +44,11 @@ class CommandeFournisseurDispatch extends CommonObject */ public $error; - public $errors=array(); //!< To return several error codes (or messages) + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + public $element='commandefournisseurdispatch'; //!< Id that identify managed objects /** diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index b4aaf17e9d8..dbce6d75f3b 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -49,7 +49,11 @@ class ActionsTicket */ public $error; - public $errors = array(); + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + //! Numero de l'erreur public $errno = 0; diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index fd996d4e3c4..f511cc1900b 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -42,7 +42,10 @@ class Ticketlogs// extends CommonObject */ public $error; - public $errors = array(); //!< To return several error codes (or messages) + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); public $element = 'ticketlogs'; //!< Id that identify managed objects /** From 2fa82edd3980bfaa3e671143d6dd29129c68c52e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 17:07:27 +0200 Subject: [PATCH 58/91] Standardize and update code --- htdocs/accountancy/class/accountancycategory.class.php | 5 ++++- htdocs/accountancy/class/accountingjournal.class.php | 3 +++ htdocs/adherents/class/adherent.class.php | 3 +++ htdocs/adherents/class/adherent_type.class.php | 4 ++++ htdocs/adherents/class/subscription.class.php | 3 +++ htdocs/asset/class/asset_type.class.php | 4 ++++ htdocs/bookmarks/class/bookmark.class.php | 5 ++++- htdocs/categories/class/categorie.class.php | 3 +++ htdocs/comm/action/class/actioncomm.class.php | 5 ++++- htdocs/comm/mailing/class/mailing.class.php | 3 +++ htdocs/comm/propal/class/propal.class.php | 6 ++++++ htdocs/commande/class/commande.class.php | 9 ++++++++- htdocs/compta/bank/class/account.class.php | 3 +++ htdocs/compta/bank/class/paymentvarious.class.php | 5 ++++- htdocs/compta/deplacement/class/deplacement.class.php | 3 +++ htdocs/compta/facture/class/facture-rec.class.php | 6 ++++++ htdocs/compta/facture/class/facture.class.php | 8 +++++++- htdocs/compta/localtax/class/localtax.class.php | 5 ++++- .../compta/paiement/cheque/class/remisecheque.class.php | 3 +++ htdocs/compta/paiement/class/paiement.class.php | 5 ++++- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 +++ htdocs/compta/salaries/class/paymentsalary.class.php | 5 ++++- htdocs/compta/sociales/class/chargesociales.class.php | 6 +++++- .../sociales/class/paymentsocialcontribution.class.php | 5 ++++- htdocs/compta/tva/class/tva.class.php | 5 ++++- 25 files changed, 103 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 14fedab9b16..7f0b2be0071 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -46,7 +46,10 @@ class AccountancyCategory // extends CommonObject */ public $errors = array(); - public $element='c_accounting_category'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='c_accounting_category'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 4edc4e3f99a..c908b4ccb7c 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -26,6 +26,9 @@ */ class AccountingJournal extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='accounting_journal'; /** diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 9ced11e7d5d..c6a643350dd 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -41,6 +41,9 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; */ class Adherent extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='member'; /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 3af6206d274..937d3e197a8 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -37,7 +37,11 @@ class AdherentType extends CommonObject */ public $table_element = 'adherent_type'; + /** + * @var string ID to identify managed object + */ public $element = 'adherent_type'; + public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 71c304e5765..240aa617233 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Subscription extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='subscription'; /** diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 8922701d698..5455eb4c7ea 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -34,7 +34,11 @@ class AssetType extends CommonObject */ public $table_element = 'asset_type'; + /** + * @var string ID to identify managed object + */ public $element = 'asset_type'; + public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 3bbdf293f37..9491b10c267 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -28,7 +28,10 @@ */ class Bookmark extends CommonObject { - public $element='bookmark'; + /** + * @var string ID to identify managed object + */ + public $element='bookmark'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1fccadc0a53..3736ce58d5b 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -148,6 +148,9 @@ class Categorie extends CommonObject 'project' => 'projet', ); + /** + * @var string ID to identify managed object + */ public $element='category'; /** diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 32a442885f8..70c38205eac 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ActionComm extends CommonObject { - public $element='action'; + /** + * @var string ID to identify managed object + */ + public $element='action'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index f5c1fd84d9e..1078ea84c94 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -31,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Mailing extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='mailing'; /** diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 02ab37c626a..2808a501112 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -45,6 +45,9 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Propal extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='propal'; /** @@ -3656,6 +3659,9 @@ class Propal extends CommonObject */ class PropaleLigne extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ public $element='propaldet'; /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6ff85f51ca5..68f45f7e12e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -42,7 +42,10 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Commande extends CommonOrder { - public $element='commande'; + /** + * @var string ID to identify managed object + */ + public $element='commande'; /** * @var string Name of table without prefix where object is stored @@ -3784,7 +3787,11 @@ class Commande extends CommonOrder */ class OrderLine extends CommonOrderLine { + /** + * @var string ID to identify managed object + */ public $element='commandedet'; + public $table_element='commandedet'; var $oldline; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 9895de511fe..46c3e168a1b 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -36,6 +36,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Account extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element = 'bank_account'; /** diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 6215858dd6d..90ec1558981 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class PaymentVarious extends CommonObject { - public $element='variouspayment'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='variouspayment'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 6a51244529a..d9172219abe 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -31,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Deplacement extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='deplacement'; /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 385224e10d7..59966827ae5 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class FactureRec extends CommonInvoice { + /** + * @var string ID to identify managed object + */ public $element='facturerec'; /** @@ -1644,6 +1647,9 @@ class FactureRec extends CommonInvoice */ class FactureLigneRec extends CommonInvoiceLine { + /** + * @var string ID to identify managed object + */ public $element='facturedetrec'; /** diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f05c7302ef0..5e5eca7337f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -53,6 +53,9 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accoun */ class Facture extends CommonInvoice { + /** + * @var string ID to identify managed object + */ public $element='facture'; /** @@ -4236,7 +4239,10 @@ class Facture extends CommonInvoice */ class FactureLigne extends CommonInvoiceLine { - public $element='facturedet'; + /** + * @var string ID to identify managed object + */ + public $element='facturedet'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 717e251f841..7e9691f9b3a 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Localtax extends CommonObject { - public $element='localtax'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='localtax'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 8981a760864..ceb376f7a37 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -33,6 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; */ class RemiseCheque extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='chequereceipt'; /** diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index e8057853952..fa824375793 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Paiement extends CommonObject { - public $element='payment'; + /** + * @var string ID to identify managed object + */ + public $element='payment'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 523117b8351..76224451c0a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; */ class BonPrelevement extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='widthdraw'; /** diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index edb316674b3..babd5323fce 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class PaymentSalary extends CommonObject { - public $element='payment_salary'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='payment_salary'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 023dd334583..229cbef2442 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='chargesociales'; + /** + * @var string ID to identify managed object + */ + public $element='chargesociales'; + public $table='chargesociales'; /** diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 26d8094acbd..560e47abe7c 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' */ class PaymentSocialContribution extends CommonObject { - public $element='paiementcharge'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='paiementcharge'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d3b7c42b86b..538c33152ea 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Tva extends CommonObject { - public $element='tva'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='tva'; /** * @var string Name of table without prefix where object is stored From 6abd5d478aeed6738685feea0e3508389e0f1293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Aug 2018 17:15:14 +0200 Subject: [PATCH 59/91] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 92cab65b7b2..8a06a0d7764 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6146,7 +6146,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray=array_merge($substitutionarray, array( '__DAY__' => (string) $tmp['mday'], + '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), + '__DAY_TEXT_SHORT__' => $outputlangs->trans('Short'.$tmp['weekday']), + '__DAY_TEXT_MIN__' => $outputlangs->trans($tmp['weekday'].'Min'), '__MONTH__' => (string) $tmp['mon'], + '__MONTH_TEXT__' => $outputlangs->trans($tmp['month']), + '__MONTH_TEXT_MIN__' => $outputlangs->trans($tmp['month'].'Min'), '__YEAR__' => (string) $tmp['year'], '__PREVIOUS_DAY__' => (string) $tmp2['day'], '__PREVIOUS_MONTH__' => (string) $tmp3['month'], From 92b0668e3ed28d6086b1a39230a5d37072d6492f Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Thu, 23 Aug 2018 17:40:40 +0200 Subject: [PATCH 60/91] There is a begin transaction without rollback In this Select, there is no need of this Begin Transaction on my understanding. Don't know why this line code is here for. --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a6db67c7709..cfdbcc630bb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4424,7 +4424,7 @@ class Product extends CommonObject $langs->load('products'); - $this->db->begin(); + //$this->db->begin(); $label_type = 'label'; From 215677c972bb4707e107e947eadefef236c8cff1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 18:17:09 +0200 Subject: [PATCH 61/91] Standardize and update code --- htdocs/contact/class/contact.class.php | 3 +++ htdocs/contrat/class/contrat.class.php | 8 +++++++- htdocs/core/class/comment.class.php | 5 ++++- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/events.class.php | 5 ++++- htdocs/core/class/fiscalyear.class.php | 3 +++ htdocs/core/class/link.class.php | 5 ++++- htdocs/cron/class/cronjob.class.php | 5 ++++- 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d7d95de2795..1c34a64f986 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Contact extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='contact'; /** diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index b857cad8e2e..13a52ac22ef 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -41,6 +41,9 @@ require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php'; */ class Contrat extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='contrat'; /** @@ -2458,7 +2461,10 @@ class Contrat extends CommonObject */ class ContratLigne extends CommonObjectLine { - public $element='contratdet'; + /** + * @var string ID to identify managed object + */ + public $element='contratdet'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index cad33316b68..027d3193031 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -4,7 +4,10 @@ */ class Comment extends CommonObject { - public $element='comment'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='comment'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 97ba1f814d0..6db2388ce8c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -64,7 +64,7 @@ abstract class CommonObject public $errors=array(); /** - * @var string + * @var string ID to identify managed object */ public $element; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 7f77f99f183..bbdf7e9c3ab 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -34,7 +34,10 @@ */ class Events // extends CommonObject { - public $element='events'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='events'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 640ad2ed5ac..8e6f389200b 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -28,6 +28,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Fiscalyear extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='fiscalyear'; /** diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 4896a1919d7..0d695baaf8d 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -28,7 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Link extends CommonObject { - public $element = 'link'; + /** + * @var string ID to identify managed object + */ + public $element = 'link'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 88d9fc706e1..b898b4eb238 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class Cronjob extends CommonObject { - public $element='cronjob'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='cronjob'; /** * @var string Name of table without prefix where object is stored From 87067b2bc92e75adadd2743fa2d83a77db068118 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 18:35:45 +0200 Subject: [PATCH 62/91] Standardize and update code --- htdocs/don/class/don.class.php | 5 ++++- htdocs/don/class/paymentdonation.class.php | 5 ++++- htdocs/ecm/class/ecmdirectory.class.php | 5 ++++- htdocs/expedition/class/expedition.class.php | 7 +++++++ htdocs/expensereport/class/expensereport_ik.class.php | 3 +++ .../expensereport/class/expensereport_rule.class.php | 3 +++ .../expensereport/class/paymentexpensereport.class.php | 5 ++++- htdocs/fichinter/class/fichinter.class.php | 6 ++++++ htdocs/fourn/class/fournisseur.commande.class.php | 10 ++++++++-- .../class/fournisseur.commande.dispatch.class.php | 5 ++++- htdocs/fourn/class/fournisseur.facture.class.php | 8 +++++++- htdocs/fourn/class/paiementfourn.class.php | 3 +++ htdocs/holiday/class/holiday.class.php | 3 +++ htdocs/hrm/class/establishment.class.php | 3 +++ htdocs/livraison/class/livraison.class.php | 7 +++++++ htdocs/loan/class/loan.class.php | 4 ++++ htdocs/loan/class/loanschedule.class.php | 5 ++++- htdocs/loan/class/paymentloan.class.php | 5 ++++- htdocs/opensurvey/class/opensurveysondage.class.php | 5 ++++- htdocs/product/class/product.class.php | 3 +++ htdocs/product/stock/class/entrepot.class.php | 3 +++ 21 files changed, 92 insertions(+), 11 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 71c8bbd3abb..9aa55945d2b 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Don extends CommonObject { - public $element='don'; // Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='don'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 939c4e33780..f866f20a02f 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class PaymentDonation extends CommonObject { - public $element='payment_donation'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='payment_donation'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6f3aefbc9d8..3e3559847b8 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -27,7 +27,10 @@ */ class EcmDirectory // extends CommonObject { - public $element='ecm_directories'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='ecm_directories'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index da911520ead..a4bcfeb2281 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -44,7 +44,11 @@ if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/expe */ class Expedition extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element="shipping"; + public $fk_element="fk_expedition"; /** @@ -2272,6 +2276,9 @@ class Expedition extends CommonObject */ class ExpeditionLigne extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ public $element='expeditiondet'; /** diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index 849d688ba2a..609ba42c5f5 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -29,6 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; */ class ExpenseReportIk extends CoreObject { + /** + * @var string ID to identify managed object + */ public $element='expenseik'; /** diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index 2d2dddb1f66..8599cfcc810 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -29,6 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; */ class ExpenseReportRule extends CoreObject { + /** + * @var string ID to identify managed object + */ public $element='expenserule'; /** diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index d8c5f51647b..a827b095bff 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class PaymentExpenseReport extends CommonObject { - public $element='payment_expensereport'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='payment_expensereport'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index e235ec1ea12..7c772d460a5 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -35,6 +35,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php'; */ class Fichinter extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='fichinter'; /** @@ -1331,6 +1334,9 @@ class FichinterLigne extends CommonObjectLine var $duration; // Duree de l'intervention var $rang = 0; + /** + * @var string ID to identify managed object + */ public $element='fichinterdet'; /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6ffc8ebc9b3..3672e1dd1ac 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -40,7 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class CommandeFournisseur extends CommonOrder { - public $element='order_supplier'; + /** + * @var string ID to identify managed object + */ + public $element='order_supplier'; /** * @var string Name of table without prefix where object is stored @@ -3092,7 +3095,10 @@ class CommandeFournisseur extends CommonOrder */ class CommandeFournisseurLigne extends CommonOrderLine { - public $element='commande_fournisseurdet'; + /** + * @var string ID to identify managed object + */ + public $element='commande_fournisseurdet'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 0ff73d0d8e3..818a09c2bfb 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -49,7 +49,10 @@ class CommandeFournisseurDispatch extends CommonObject */ public $errors = array(); - public $element='commandefournisseurdispatch'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='commandefournisseurdispatch'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b3d62a4f6b8..6acfdaa3530 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -41,7 +41,10 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class FactureFournisseur extends CommonInvoice { - public $element='invoice_supplier'; + /** + * @var string ID to identify managed object + */ + public $element='invoice_supplier'; /** * @var string Name of table without prefix where object is stored @@ -2565,6 +2568,9 @@ class FactureFournisseur extends CommonInvoice */ class SupplierInvoiceLine extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ public $element='facture_fourn_det'; /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index d1c71a2cd98..55c6a00d251 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -35,6 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class PaiementFourn extends Paiement { + /** + * @var string ID to identify managed object + */ public $element='payment_supplier'; /** diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5a1078aad82..833b46b2bca 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Holiday extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='holiday'; /** diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index a39e6a20b08..744e679194e 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -28,6 +28,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Establishment extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='establishment'; /** diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index f61c8eabb2a..763b28fb445 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -39,7 +39,11 @@ if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande */ class Livraison extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element="delivery"; + public $fk_element="fk_livraison"; /** @@ -1095,6 +1099,9 @@ class LivraisonLigne extends CommonObjectLine public $product_ref; public $product_label; + /** + * @var string ID to identify managed object + */ public $element='livraisondet'; /** diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 1e75aa063cf..8f382c8dc1d 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -29,7 +29,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Loan extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='loan'; + public $table='loan'; /** diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index dbf3f3f3e46..5a33d9995bc 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class LoanSchedule extends CommonObject { - public $element='loan_schedule'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='loan_schedule'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 9d845b7a1cd..1f20590f6e1 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class PaymentLoan extends CommonObject { - public $element='payment_loan'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='payment_loan'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index f62fd69c781..c2036525b62 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class Opensurveysondage extends CommonObject { - public $element='opensurvey_sondage'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='opensurvey_sondage'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index b02da68cc12..b66bf4eaed0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -43,6 +43,9 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; */ class Product extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='product'; /** diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index edae2d19f05..f8e60f135b9 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -33,6 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Entrepot extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='stock'; /** From 30992f2730b4032a0f9f49ccc520d82cb59a7748 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 23 Aug 2018 18:52:47 +0200 Subject: [PATCH 63/91] Standardize and update code --- htdocs/projet/class/project.class.php | 5 ++++- htdocs/projet/class/task.class.php | 5 ++++- htdocs/resource/class/dolresource.class.php | 5 ++++- htdocs/societe/class/societe.class.php | 3 +++ .../class/supplier_proposal.class.php | 10 ++++++++-- htdocs/ticket/class/ticketlogs.class.php | 6 +++++- htdocs/user/class/user.class.php | 3 +++ htdocs/user/class/usergroup.class.php | 3 +++ 8 files changed, 34 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 16c187e1842..6e8709a4328 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; class Project extends CommonObject { - public $element = 'project'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element = 'project'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index e7546048950..e3fee33a0de 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Task extends CommonObject { - public $element='project_task'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='project_task'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 4e580fd6e26..604e4f8849d 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"; */ class Dolresource extends CommonObject { - public $element='dolresource'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element='dolresource'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 39fa367e26a..5c3363bc4c8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -41,6 +41,9 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class Societe extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='societe'; /** diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 34485e0b4fe..9275cc0decf 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -45,7 +45,10 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class SupplierProposal extends CommonObject { - public $element='supplier_proposal'; + /** + * @var string ID to identify managed object + */ + public $element='supplier_proposal'; /** * @var string Name of table without prefix where object is stored @@ -2651,7 +2654,10 @@ class SupplierProposalLine extends CommonObjectLine */ public $error=''; - public $element='supplier_proposaldet'; + /** + * @var string ID to identify managed object + */ + public $element='supplier_proposaldet'; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index f511cc1900b..cf5f8dc122b 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -47,7 +47,11 @@ class Ticketlogs// extends CommonObject */ public $errors = array(); - public $element = 'ticketlogs'; //!< Id that identify managed objects + /** + * @var string ID to identify managed object + */ + public $element = 'ticketlogs'; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 90b5d477180..f64ecd9ede6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -40,6 +40,9 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class User extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='user'; /** diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 7bcfa05ab28..8f89b4a2e35 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -35,6 +35,9 @@ if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT."/core/class/l */ class UserGroup extends CommonObject { + /** + * @var string ID to identify managed object + */ public $element='usergroup'; /** From 89d55f3b4693960492e87d24fbc89810d343f330 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Aug 2018 11:45:22 +0200 Subject: [PATCH 64/91] Fix lib in modulebuilder --- htdocs/modulebuilder/index.php | 11 ++++++----- .../{myobject.lib.php => mymodule_myobject.lib.php} | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 2 +- htdocs/modulebuilder/template/myobject_note.php | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) rename htdocs/modulebuilder/template/lib/{myobject.lib.php => mymodule_myobject.lib.php} (97%) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e844793b601..d406f6918a0 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -121,13 +121,13 @@ if ($dirins && $action == 'initmodule' && $modulename) } } - // Delete some files + // Delete some files related to object (because to previous dolCopyDir has copied everything) dol_delete_file($destdir.'/myobject_card.php'); dol_delete_file($destdir.'/myobject_note.php'); dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); - dol_delete_file($destdir.'/lib/myobject.lib.php'); + dol_delete_file($destdir.'/lib/mymodule_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject.sql'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject_extrafields.sql'); @@ -279,14 +279,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) if (! $error) { - // Delete some files + // Copy some files $filetogenerate = array( 'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_note.php'=>strtolower($objectname).'_note.php', 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', @@ -648,7 +648,8 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule.lib.php'=>'lib/'.strtolower($module).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', diff --git a/htdocs/modulebuilder/template/lib/myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php similarity index 97% rename from htdocs/modulebuilder/template/lib/myobject.lib.php rename to htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index d3665dff236..dbf049b3827 100644 --- a/htdocs/modulebuilder/template/lib/myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/modulebuilder/template/lib/myobject.lib.php + * \file htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php * \ingroup mymodule * \brief Library files with common functions for MyObject */ diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 5c7303ba6a9..3322fb527d3 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cfc79b2f232..78a9070eefd 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -60,7 +60,7 @@ if (! $res) die("Include of main fails"); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index c08a360835a..dfdc16d69d9 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies","other","mails")); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 5b438c32a7c..1a26d9abeb4 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -38,7 +38,7 @@ if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main if (! $res) die("Include of main fails"); dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies")); From 085f8cf604e32630bf3ed12b49545471a68db847 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Aug 2018 11:51:06 +0200 Subject: [PATCH 65/91] Fix bad link --- htdocs/modulebuilder/template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index d745c808bf4..04f3ff0f356 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -13,7 +13,7 @@ Other modules are available on