diff --git a/.travis.yml b/.travis.yml index 6dd9dd7dac3..11da1e2d048 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 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. $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/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 8db5e9812db..ddc5f4bf6d5 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -158,6 +158,22 @@ + + + + + + + + 0 + + + 0 + + + 0 + + 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/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/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 7420ae8a982..7f0b2be0071 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,11 +30,31 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // 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='c_accounting_category'; //!< Id that identify managed objects - public $table_element='c_accounting_category'; //!< Name of table without prefix where object is stored + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error string + * @see errors + */ + public $error; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + + /** + * @var string ID to identify managed object + */ + public $element='c_accounting_category'; + + /** + * @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/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index ef13b84b4bb..8b30070317a 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) */ @@ -38,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 0753b12b273..60cb8d0c53a 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'; /** @@ -39,26 +44,33 @@ 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 */ public $restrictiononfksoc = 1; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error code (or message) */ 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; @@ -67,7 +79,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/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 4e538d4d8a4..2748971d008 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -26,8 +26,16 @@ */ class AccountingJournal extends CommonObject { + /** + * @var string ID to identify managed object + */ 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/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 926c1829226..85d25aad432 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/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index c00176dc8ae..b51413be369 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/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 16e0224a79e..838101b7f7b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -41,8 +41,16 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; */ class Adherent extends CommonObject { + /** + * @var string ID to identify managed object + */ 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; @@ -532,6 +540,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; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 548bfc21c93..57a16c812e3 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -32,8 +32,16 @@ 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'; + + /** + * @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/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 59c51cb1d21..bfa990a04c0 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -32,6 +32,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 $socid; diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 47a3eb66f50..90452816be8 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -32,8 +32,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Subscription extends CommonObject { + /** + * @var string ID to identify managed object + */ 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/admin/bank.php b/htdocs/admin/bank.php index 1e9acde2665..497d4748da8 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/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 55426fa90eb..4617481d04d 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -385,7 +385,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/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 606d3a5f201..dd3b1c5bff7 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/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/modules.php b/htdocs/admin/modules.php index 0cf1b646eff..71656475e6f 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/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/receiptprinter.php b/htdocs/admin/receiptprinter.php index abe2fbea655..b250bf28a87 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 3dbc785d1d7..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; @@ -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 fda1946875a..65e19fb9d83 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 38f0a8eb497..5cf72b302c9 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/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index f5e9af6f8df..4913921dbbc 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 4f633fb273a..45656dd0813 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -29,8 +29,16 @@ 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'; + + /** + * @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/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index e6b4985f6b8..56e90c1a639 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -31,9 +31,9 @@ include '../master.inc.php'; $phone = GETPOST('phone'); $notfound = $langs->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/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/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/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 1beb4b36871..9491b10c267 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -28,14 +28,29 @@ */ 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 + */ 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'; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; - var $id; + /** + * @var int ID + */ + public $id; + var $fk_user; var $datec; var $url; 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/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 549bb5af29b..b0854dcf7e1 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -148,7 +148,14 @@ class Categorie extends CommonObject 'project' => 'projet', ); + /** + * @var string ID to identify managed object + */ 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 435f3d941ca..1f50d4f3c69 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -34,15 +34,25 @@ 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 + */ 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 +63,7 @@ class ActionComm extends CommonObject * Id of the event * @var int */ - var $id; + public $id; /** * Id of the event. Use $id as possible @@ -67,7 +77,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 @@ -885,7 +898,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) diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 9c02e39e4f6..57d2d0f8fbc 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/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 785f9c67bfe..6c2c162b810 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -29,18 +29,29 @@ class CActionComm { /** - * @var string Error code (or message) - */ - public $error=''; + * @var string Error code (or message) + */ + public $error=''; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; - var $id; + /** + * @var int ID + */ + public $id; 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/comm/card.php b/htdocs/comm/card.php index d7d5a3f4f5a..3c1c02057c3 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -582,7 +582,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.=''; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -600,7 +600,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/commande/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -618,7 +618,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -634,7 +634,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; $boxstat.='
      '; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 4d10120aaeb..72058578db7 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/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 7b01c1c5a22..13d72acb3d7 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -326,8 +326,6 @@ if ($object->fetch($id) >= 0) } // Si le module mailing est qualifie - if ($qualified) - { if ($allowaddtarget) { print '
      '; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 43b9f820b4c..21d16d0605d 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -28,23 +28,35 @@ */ class AdvanceTargetingMailing extends CommonObject { + /** + * @var DoliDB Database handler. + */ + public $db; - var $db; //!< To store db handler /** * @var string Error code (or message) */ public $error=''; - /** * @var string[] Error codes (or messages) */ public $errors = array(); - - var $element='advtargetemailing'; //!< Id that identify managed objects - var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored - var $id; + /** + * @var string ID to identify managed object + */ + public $element='advtargetemailing'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='advtargetemailing'; + + /** + * @var int ID + */ + public $id; var $name; var $entity; diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 76054a95879..fffb69bea2f 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.formadvtargetemailing.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 */ /** @@ -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/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 92d92e89983..d7265afec72 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -31,8 +31,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Mailing extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 6700e2c9ea6..7e472ae852d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -45,16 +45,26 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Propal extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 @@ -1325,6 +1335,7 @@ class Propal extends CommonObject $sql.= ", p.fk_shipping_method"; $sql.= ", p.fk_incoterms, p.location_incoterms"; $sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc"; + $sql.= ", p.tms as date_modification"; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ", c.label as statut_label"; $sql.= ", ca.code as availability_code, ca.label as availability"; @@ -1381,6 +1392,7 @@ class Propal extends CommonObject $this->datev = $this->db->jdate($obj->datev); // TODO deprecated $this->date_creation = $this->db->jdate($obj->datec); //Creation date $this->date_validation = $this->db->jdate($obj->datev); //Validation date + $this->date_modification = $this->db->jdate($obj->date_modification); // tms $this->date = $this->db->jdate($obj->dp); // Proposal date $this->datep = $this->db->jdate($obj->dp); // deprecated $this->fin_validite = $this->db->jdate($obj->dfv); @@ -3668,7 +3680,14 @@ class Propal extends CommonObject */ class PropaleLigne extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ 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/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/commande/card.php b/htdocs/commande/card.php index 10005f3004a..016d6a28c04 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/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b2b94433386..805390d8d14 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -42,8 +42,16 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Commande extends CommonOrder { - public $element='commande'; - public $table_element='commande'; + /** + * @var string ID to identify managed object + */ + public $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'; @@ -3796,7 +3804,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; @@ -3818,7 +3830,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/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; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 987c146a512..1ef5063fab9 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -36,8 +36,16 @@ 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'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element = 'bank_account'; + public $picto = 'account'; /** @@ -1640,13 +1648,33 @@ class Account extends CommonObject */ class AccountLine extends CommonObject { - var $error; - var $db; - var $element='bank'; - var $table_element='bank'; + /** + * @var string Error code (or message) + */ + public $error=''; + + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string ID to identify managed object + */ + public $element='bank'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='bank'; + var $picto = 'generic'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $datec; var $dateo; @@ -1656,7 +1684,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/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/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 8bb9a369ac5..afd2523f247 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -30,11 +30,23 @@ 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 ID to identify managed object + */ + public $element='variouspayment'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='payment_various'; + public $picto = 'bill'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $tms; var $datep; @@ -43,7 +55,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/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 6bd16b62c2d..9df18d769b2 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -31,8 +31,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Deplacement extends CommonObject { + /** + * @var string ID to identify managed object + */ 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..e490c90f1ed 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -30,6 +30,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 $socid; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 84cfc2e3505..007b6f06313 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -39,8 +39,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class FactureRec extends CommonInvoice { + /** + * @var string ID to identify managed object + */ 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'; @@ -1641,7 +1649,14 @@ class FactureRec extends CommonInvoice */ class FactureLigneRec extends CommonInvoiceLine { + /** + * @var string ID to identify managed object + */ 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 c247f2dbe4b..913e86b68c9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -53,8 +53,16 @@ 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'; + + /** + * @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'; @@ -4251,8 +4259,15 @@ class Facture extends CommonInvoice */ class FactureLigne extends CommonInvoiceLine { - public $element='facturedet'; - public $table_element='facturedet'; + /** + * @var string ID to identify managed object + */ + public $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/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 61d477522dc..18a43d6d68d 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -28,8 +28,15 @@ */ class PaymentTerm // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) @@ -40,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/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 1eb5dc9618b..c2c8bee9904 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -29,8 +29,16 @@ 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 ID to identify managed object + */ + public $element='localtax'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='localtax'; + public $picto='payment'; var $ltt; @@ -38,7 +46,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/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 4b548964603..920811feb56 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -33,8 +33,16 @@ 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'; + + /** + * @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 6404db12045..1fd2ad8bbef 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -36,8 +36,16 @@ require_once DOL_DOCUMENT_ROOT .'/multicurrency/class/multicurrency.class.php'; */ class Paiement extends CommonObject { - public $element='payment'; - public $table_element='paiement'; + /** + * @var string ID to identify managed object + */ + public $element='payment'; + + /** + * @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 cedc8a1431e..352f76b3fc1 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -39,8 +39,16 @@ 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'; + + /** + * @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/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index ba7661d60e0..fc92302cf7d 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -31,8 +31,15 @@ */ class LignePrelevement { - var $id; - var $db; + /** + * @var int ID + */ + public $id; + + /** + * @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 e18834872d9..e05d27d10d6 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -30,8 +30,15 @@ */ class RejetPrelevement { - var $id; - var $db; + /** + * @var int ID + */ + public $id; + + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 22df2a58407..76dfd8491ba 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -31,8 +31,16 @@ 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 ID to identify managed object + */ + public $element='payment_salary'; + + /** + * @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 fe0983d7855..c6ce0983bac 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; @@ -54,9 +52,6 @@ class Cchargesociales public $module; public $accountancy_code; - /** - */ - /** * Constructor diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index bb4fd40edc1..2110b7f610a 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -32,9 +32,18 @@ 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'; - 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 4061cedd8c5..60b31b85689 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -31,8 +31,16 @@ 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 ID to identify managed object + */ + public $element='paiementcharge'; + + /** + * @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 def18a6ff7a..a5f7c3134d7 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -33,8 +33,16 @@ 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 ID to identify managed object + */ + public $element='tva'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='tva'; + public $picto='payment'; var $tms; @@ -43,7 +51,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/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 416dbd417c1..2fc8a738f07 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; @@ -37,8 +41,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/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 5fc94c99995..4cd6fe81820 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -37,8 +37,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Contact extends CommonObject { + /** + * @var string ID to identify managed object + */ 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'; @@ -681,6 +689,7 @@ class Contact extends CommonObject $sql.= " c.photo,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.import_key,"; + $sql.= " c.datec as date_creation, c.tms as date_modification,"; $sql.= " co.label as country, co.code as country_code,"; $sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " u.rowid as user_id, u.login as user_login,"; @@ -715,6 +724,9 @@ class Contact extends CommonObject $this->zip = $obj->zip; $this->town = $obj->town; + $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_modification = $this->db->jdate($obj->date_modification); + $this->fk_departement = $obj->fk_departement; // deprecated $this->state_id = $obj->fk_departement; $this->departement_code = $obj->state_code; // deprecated diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2e862fd9e40..33aa7559d30 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -41,16 +41,26 @@ require_once DOL_DOCUMENT_ROOT . '/margin/lib/margins.lib.php'; */ class Contrat extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 @@ -1048,7 +1058,7 @@ class Contrat extends CommonObject } else { - $this->error="Failed to add contact"; + $this->error="Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -2459,10 +2469,21 @@ class Contrat extends CommonObject */ class ContratLigne extends CommonObjectLine { - public $element='contratdet'; - public $table_element='contratdet'; + /** + * @var string ID to identify managed object + */ + public $element='contratdet'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='contratdet'; - var $id; + /** + * @var int ID + */ + public $id; + var $ref; var $tms; 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/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..d7691e05c30 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(); @@ -71,6 +74,8 @@ class box_graph_propales_permonth extends ModeleBoxes //include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; //$propalstatic=new Propal($db); + $langs->load("propal"); + $text = $langs->trans("BoxProposalsPerMonth",$max); $this->info_box_head = array( 'text' => $text, 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/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. diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index d2436f2a526..75d4b340687 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) @@ -38,7 +41,11 @@ class AntiVir public $errors = array(); var $output; - var $db; + + /** + * @var DoliDB Database handler. + */ + public $db; /** * Constructor @@ -67,7 +74,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; } diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 6451c79c575..86917922550 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -28,8 +28,15 @@ */ class Canvas { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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..f49d39e8fdd 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -32,8 +32,15 @@ */ class Ccountry // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) @@ -43,10 +50,19 @@ 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; + + /** + * @var string proper name for given parameter + */ + public $label; + var $active; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index fe7a6692d9a..47782f5f3c6 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -4,8 +4,15 @@ */ 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 ID to identify managed object + */ + public $element='comment'; + + /** + * @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/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 2bba49a15fc..e0436091a43 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -607,15 +607,16 @@ 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(); $array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs); - }*/ + } + return $array_shipment; } @@ -623,17 +624,17 @@ abstract class CommonDocGenerator /** * Define array with couple substitution key => substitution value * - * @param array $line Array of lines - * @param Translate $outputlangs Lang object to use for output - * @return array Substitution array + * @param ExpeditionLigne $line Object line + * @param Translate $outputlangs Lang object to use for output + * @return array Substitution array */ // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function get_substitutionarray_shipment_lines($line,$outputlangs) + function get_substitutionarray_shipment_lines($line, $outputlangs) { global $conf; - dol_include_once('/core/lib/product.lib.php'); + 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, @@ -652,6 +653,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(); + + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); + + return $resarray; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c6f795f26cb..b34eae4001b 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 + * @var string ID to identify managed object */ public $element; + /** - * @var string + * @var string Name of table without prefix where object is stored */ 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() @@ -1843,7 +1879,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/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/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 7a853cdf18a..bb75a36de96 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -32,8 +32,15 @@ */ class Cstate // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) @@ -43,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 c69b70c7c35..184f5f26a2c 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -27,8 +27,15 @@ */ class Ctypent // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * @var string[] Error codes (or messages) @@ -38,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/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/discount.class.php b/htdocs/core/class/discount.class.php index 9d9b6a1c96a..3861303bbe1 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -28,8 +28,15 @@ */ class DiscountAbsolute { + /** + * @var DoliDB Database handler. + */ 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/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 4a9b45aa54f..6b50b27f3f3 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 a093a35487a..81e9c5eab9e 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -105,16 +105,25 @@ 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; - var $error; + + /** + * @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/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index e4ede83a158..9e462e36e74 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 abdbb1689f8..bbdf7e9c3ab 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -34,13 +34,30 @@ */ 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 ID to identify managed object + */ + public $element='events'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='events'; - var $id; - var $db; + /** + * @var int ID + */ + public $id; + + /** + * @var DoliDB Database handler. + */ + public $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 36e31bf2437..da76800e691 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 @@ -88,7 +91,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/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index a14b541e34b..a1e41f4fa3a 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -28,15 +28,27 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Fiscalyear extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 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/class/google.class.php b/htdocs/core/class/google.class.php index e923ec12252..5756acd90e0 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -26,8 +26,15 @@ */ class GoogleAPI { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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..9e2bd344171 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -29,8 +29,15 @@ */ class HookManager { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 0e55c9ef7de..96fb24ec9b1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -47,8 +47,16 @@ */ class Form { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 9cc402f3f4e..64e33cd5023 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -35,10 +35,17 @@ class FormAccounting extends Form private $options_cache = array(); - var $db; - var $error; - /** + * @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 51e873485fd..ed50a59cb25 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -29,8 +29,15 @@ */ class FormActions { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 51184e9fed7..fd9bc3ab3f9 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -29,8 +29,15 @@ */ class FormAdmin { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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..9cf60cc45b1 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -29,8 +29,15 @@ */ class FormBank { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 3e29a7d92f4..75b5ddea5c9 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -28,8 +28,15 @@ */ class FormBarCode { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 5c09d0a3ade..0f6938610ff 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -31,9 +31,15 @@ */ class FormCompany { - var $db; - var $error; - + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * Constructor diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index bf4f46ad229..dff31917126 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -27,8 +27,15 @@ */ class FormContract { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** @@ -167,10 +174,10 @@ class FormContract * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label * @param int $showempty Show empty line - * @return int Nbr of project if OK, <0 if KO + * @return int Nbr of project if OK, <0 if KO */ - function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) - { + function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + { global $langs; print "\n"; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 87cc16e6eac..fdb56e94e21 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -28,8 +28,15 @@ */ class FormCron extends Form { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** * Constructor diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c49ae8cfa63..30e40e194cc 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.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 5502d870005..3d5f2c9b640 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -27,8 +27,15 @@ */ class FormIntervention { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 ba9bc2f03bc..127df27934b 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 @@ -85,7 +88,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.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/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index da8acce83d4..e891e3dacbe 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -28,8 +28,15 @@ */ class FormMargin { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 0a31d53d7c5..6d2964f29bf 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.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 12953ac5fd8..25c41d3bd70 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -29,8 +29,15 @@ */ class FormProjets { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 3deff2bbb0e..c4ac522d98a 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -27,8 +27,15 @@ */ class FormPropal { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 4bf80cb7d00..d2307c5cfb1 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; @@ -56,7 +59,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 fc86d7a05cd..08a01c5e8f2 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -27,8 +27,15 @@ */ class FormSocialContrib { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 9c3daefd62a..c0f4a3f75d2 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; @@ -80,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/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 67ac8691a19..28692774d02 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/ldap.class.php b/htdocs/core/class/ldap.class.php index c480bda1f07..820c22cd3cb 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/link.class.php b/htdocs/core/class/link.class.php index 0441c04a86e..0d695baaf8d 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -28,8 +28,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Link extends CommonObject { - public $element = 'link'; - public $table_element = 'links'; + /** + * @var string ID to identify managed object + */ + public $element = 'link'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'links'; public $entity; public $datea; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 48880633563..715f17b5a92 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -28,9 +28,20 @@ */ class Menubase { - public $db; // To store db handler - public $error; // To return error code (or message) - public $errors=array(); // To return several error codes (or messages) + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); public $id; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index f3beece9794..f5c0020bac1 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -30,9 +30,20 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/CMailFile.class.php'; */ class Notify { - var $id; - var $db; - var $error; + /** + * @var int ID + */ + public $id; + + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 9b76e2d2409..beaf85c60b7 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -26,8 +26,15 @@ */ class RssParser { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; private $_format=''; private $_urlRSS; 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/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/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&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/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/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'], 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/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(); 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/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 285664dea95..3babb23456b 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/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index 86c292ee80d..17a98d9cd77 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -113,7 +113,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) @@ -154,7 +154,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) @@ -173,4 +173,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 741c247579d..fcf01131f46 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -39,7 +39,7 @@ class modTcpdfbarcode extends ModeleBarCode public $error=''; var $is2d = false; - + /** * Return description of numbering model * @@ -60,8 +60,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. @@ -71,10 +71,10 @@ class modTcpdfbarcode extends ModeleBarCode function canBeActivated() { global $langs; - + return true; } - + /** * Return true if encoding is supported * @@ -88,7 +88,7 @@ class modTcpdfbarcode extends ModeleBarCode return 0; } else { return 1; - } + } } /** @@ -104,17 +104,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) { @@ -127,15 +127,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; - } + } } /** @@ -177,8 +177,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')) { @@ -191,16 +191,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) @@ -237,7 +237,7 @@ class modTcpdfbarcode extends ModeleBarCode 'PHARMA' => 'PHARMA', 'PHARMA2T' => 'PHARMA2T' ); - + $tcpdf2dEncodingTypes = array( 'DATAMATRIX' => 'DATAMATRIX', 'PDF417' => 'PDF417', @@ -245,9 +245,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]; @@ -256,6 +256,6 @@ class modTcpdfbarcode extends ModeleBarCode return $tcpdf2dEncodingTypes[$dolEncodingType]; } else { return ''; - } + } } } diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 7a8e7c2fba1..a77ed90b964 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -30,8 +30,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; */ class ExportCsv extends ModeleExports { - var $id; - var $label; + /** + * @var int ID + */ + public $id; + + /** + * @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 57618b5e504..ce38a0c995b 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -32,8 +32,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class ExportExcel extends ModeleExports { - var $id; - var $label; + /** + * @var int ID + */ + public $id; + + /** + * @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 49118a8f293..c92ace3d53d 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -33,8 +33,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class ExportExcel2007 extends ExportExcel { - var $id; - var $label; + /** + * @var int ID + */ + public $id; + + /** + * @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 0600841f8b5..5f0ea6f2ad5 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -31,8 +31,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/export/modules_export.php'; */ class ExportTsv extends ModeleExports { - var $id; - var $label; + /** + * @var int ID + */ + public $id; + + /** + * @var string proper name for given parameter + */ + public $label; + var $extension; var $version; 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.= '
      '; $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/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 5a65c5a2883..ba6cdef6eb0 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; /** @@ -42,13 +46,20 @@ class ImportCsv 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 + /** + * @var int ID + */ + public $id; + + /** + * @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 81d3272cb3c..b0a28674fa2 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,13 +46,20 @@ 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 + /** + * @var int ID + */ + public $id; + + /** + * @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/modules_import.php b/htdocs/core/modules/import/modules_import.php index 40f78540dc8..83b7321afd0 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/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index b02c943cda0..ef0f1c21b88 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 5b2ccd047fe..303db374a6f 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 3fa9b2687cf..469446f13b7 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 ace612356c8..b450b7d8e7d 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 3cd509cd8cb..0af98ae149a 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -31,8 +31,16 @@ 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 DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; + var $tooltip=''; diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 2dc2cae5048..e5f91b3ed5d 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 8c86ea6d1a9..3dea8e07ecc 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 b4592591f9a..ccbb1825245 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 856b380c659..b067d831997 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -31,8 +31,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; */ class PrintingDriver { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @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 3337d715d14..d4a8f044ba3 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -42,14 +42,21 @@ 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; + /** + * @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 f2837e3d943..69ed4a5d484 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -40,14 +40,21 @@ 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; + /** + * @var DoliDB Database handler. + */ + public $db; /** diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 2bb185328f1..659cb8e07f6 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -77,7 +77,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator * @param int $y y position in user units * @param int $w width in user units * @param int $h height in user units - * @return void + * @return void */ private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h) { 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 b7257ac5115..6610df963e0 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 @@ -941,109 +941,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/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index 79cbd1ff629..384b956e85d 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -31,10 +31,18 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpass */ class modGeneratePassNone extends ModeleGenPassword { - var $id; + /** + * @var int ID + */ + public $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..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; @@ -42,7 +46,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..87a792672fb 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -31,10 +31,18 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/security/generate/modules_genpass */ class modGeneratePassStandard extends ModeleGenPassword { - var $id; + /** + * @var int ID + */ + public $id; + var $length; - var $db; + /** + * @var DoliDB Database handler. + */ + public $db; + var $conf; var $lang; var $user; 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/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/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 3e28ea3e4ef..f8f5595887d 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; /** @@ -152,12 +155,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/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/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 7a10f5c6021..657653c9997 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -30,8 +30,16 @@ 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 ID to identify managed object + */ + public $element='cronjob'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element='cronjob'; + public $picto = 'cron'; public $entity; 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 @@ + diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 8a20ae29eea..ad58004b0d0 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -34,8 +34,16 @@ 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 ID to identify managed object + */ + public $element='don'; + + /** + * @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 c7e2db2e7a4..ed048dc04a4 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 e2f7ad18feb..092bc77fbb2 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -29,8 +29,16 @@ 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 ID to identify managed object + */ + public $element='payment_donation'; + + /** + * @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/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/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 18ee35c8884..0772b3fbdf5 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -27,13 +27,28 @@ */ 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 ID to identify managed object + */ + public $element='ecm_directories'; + + /** + * @var string Name of table without prefix where object is stored + */ + //public $table_element='ecm_directories'; + var $picto = 'dir'; - var $id; + /** + * @var int ID + */ + 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' @@ -51,8 +66,15 @@ class EcmDirectory // extends CommonObject public $full_arbo_loaded; + /** + * @var string Error code (or message) + */ public $error; - public $errors; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); /** diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 2ef219c27ee..95d4b42a4b6 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/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index 3139c5f9986..b6000cad923 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -27,8 +27,15 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; */ class FormEcm { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b70c59b1b52..80fe07378b6 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -44,9 +44,18 @@ 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"; + + /** + * @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'; @@ -2281,7 +2290,14 @@ class Expedition extends CommonObject */ class ExpeditionLigne extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ public $element='expeditiondet'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='expeditiondet'; public $fk_origin_line; @@ -2292,7 +2308,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/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/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.class.php b/htdocs/expensereport/class/expensereport.class.php index a87aea81d30..aea15e13502 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -33,8 +33,16 @@ require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport_rule.class.p */ class ExpenseReport extends CommonObject { - var $element='expensereport'; - var $table_element='expensereport'; + /** + * @var string ID to identify managed object + */ + public $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'; @@ -2391,8 +2399,15 @@ class ExpenseReport extends CommonObject */ class ExpenseReportLine { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; var $rowid; var $comments; diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index a93d4e9062c..609ba42c5f5 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -29,8 +29,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; */ class ExpenseReportIk extends CoreObject { + /** + * @var string ID to identify managed object + */ 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..8599cfcc810 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -29,8 +29,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php'; */ class ExpenseReportRule extends CoreObject { + /** + * @var string ID to identify managed object + */ 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 43ff275e9b0..52e866a80ec 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -30,8 +30,16 @@ 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 ID to identify managed object + */ + public $element='payment_expensereport'; + + /** + * @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/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 102552854b6..0bc9715f753 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/card-rec.php b/htdocs/fichinter/card-rec.php index 08600d71ee5..d084f9be546 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 b83f87af162..2e62f6f49e7 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").'
      '.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'.$form->textwithpicto('',$tooltip,1,1).'
      '.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'.$form->textwithpicto('',$tooltip,1,1).'
      '; $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') ); @@ -423,7 +423,7 @@ if ($action == 'create') { } $db->free($result); - } else + } else print $db->error(); print "
      "; @@ -465,7 +465,7 @@ if ($action == 'create') { } else { /* * View mode - * + * */ if ($id > 0) { if ($object->fetch($id) > 0) { @@ -496,7 +496,7 @@ if ($action == 'create') { $morehtmlref.=img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { - + $morehtmlref.='
      '; $morehtmlref.=''; $morehtmlref.=''; @@ -511,7 +511,7 @@ if ($action == 'create') { $object->socid, $object->fk_project, 'none', 0, 0, 0, 1 ); - } + } } else { if (! empty($object->fk_project)) { $proj = new Project($db); @@ -566,7 +566,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 { @@ -593,9 +593,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 '
      '; @@ -615,26 +615,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 { @@ -649,12 +649,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 @@ -672,29 +672,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 ''; print ''; print ''; print ''; print ''; + if (is_resource($handle)) { while (($file = readdir($handle))!==false) 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 7dec3c42470..c87dc73287e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -32,8 +32,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Holiday extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 b219c1b4a59..60493b0b7f0 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -28,8 +28,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Establishment extends CommonObject { + /** + * @var string ID to identify managed object + */ 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/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 2d9b27b7b12..87b74af9f20 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/includes/restler/framework/Luracast/Restler/explorer/css/screen.css b/htdocs/includes/restler/framework/Luracast/Restler/explorer/css/screen.css index dc02468fdc0..ea3a4153c15 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/explorer/css/screen.css +++ b/htdocs/includes/restler/framework/Luracast/Restler/explorer/css/screen.css @@ -1231,7 +1231,7 @@ cursor: pointer; } .swagger-section #header { - background-color: #646257; + background-color: rgb(163, 188, 210); padding: 14px; } .swagger-section #input_baseUrl { @@ -1278,7 +1278,7 @@ font-size: 1.5em; font-weight: bold; text-decoration: none; - background: transparent url(../images/logo_small.png) no-repeat left center; + background: transparent url(../../../../theme/eldy/img/favicon.ico) no-repeat left center; padding: 20px 0 20px 40px; color: white; } diff --git a/htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html b/htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html index c73f1981cc9..01fb8ee2a0e 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html +++ b/htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html @@ -3,7 +3,7 @@ - Api Explorer + REST API Explorer @@ -73,6 +73,7 @@ docExpansion: "none", jsonEditor: false, apisSorter: "alpha", + operationsSorter: "alpha", defaultModelRendering: 'schema', showRequestHeaders: false }); @@ -126,7 +127,7 @@
      '.$langs->trans("NbOfGenerationDone").''; print $object->nb_gen_done?$object->nb_gen_done:'0'; print '
      '; print $langs->trans("DateLastGeneration"); @@ -733,7 +733,7 @@ if ($action == 'create') { $num = count($object->lines); $i = 0; while ($i < $num) { - + // Show product and description if (isset($object->lines[$i]->product_type)) $type=$object->lines[$i]->product_type; @@ -785,7 +785,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) { @@ -810,7 +810,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' ); @@ -821,12 +821,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)) @@ -844,7 +844,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 @@ -910,7 +910,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:'') ; @@ -933,7 +933,7 @@ if ($action == 'create') { print ''.$langs->trans('NA').''; print ''; @@ -953,7 +953,7 @@ if ($action == 'create') { $i++; } } - } else + } else print '
      '.$langs->trans("NoneF").'
      "; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index cb2759f6895..2cc7f3b834b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -35,8 +35,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php'; */ class Fichinter extends CommonObject { + /** + * @var string ID to identify managed object + */ 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'; @@ -1315,8 +1323,15 @@ class Fichinter extends CommonObject */ class FichinterLigne extends CommonObjectLine { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; // From llx_fichinterdet var $fk_fichinter; @@ -1325,8 +1340,16 @@ class FichinterLigne extends CommonObjectLine var $duration; // Duree de l'intervention var $rang = 0; + /** + * @var string ID to identify managed object + */ 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/fichinter/index.php b/htdocs/fichinter/index.php index 6b8ce71bfb5..9e5f1526969 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -148,7 +148,6 @@ if ($resql) { if (! $conf->use_javascript_ajax) { - print '
      '.$fichinterstatic->LibStatut($status,$bool,0).''.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 2fe58419b28..0cb9f9350cf 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -372,7 +372,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.=''; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -390,7 +390,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -408,7 +408,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).''; $boxstat.='
      '; @@ -419,7 +419,7 @@ if ($object->id > 0) $link=DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id; $icon='bill'; if ($link) $boxstat.='
      '; - $boxstat.='
      '; + $boxstat.='
      '; $boxstat.=''.img_object("",$icon).' '.$text.'
      '; $boxstat.=''.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.''; $boxstat.='
      '; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ea319666eb3..688f08e9666 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -40,16 +40,26 @@ 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 ID to identify managed object + */ + public $element='order_supplier'; + + /** + * @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 +78,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 @@ -3094,7 +3105,14 @@ 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 + */ public $table_element='commande_fournisseurdet'; public $oldline; diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 5bf92bf24f1..b2e5be57236 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -34,10 +34,29 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; */ class CommandeFournisseurDispatch 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='commandefournisseurdispatch'; //!< Id that identify managed objects + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + + /** + * @var string ID to identify managed object + */ + public $element='commandefournisseurdispatch'; + + /** + * @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/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8cbd871c8f7..2db826d4f5f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -41,16 +41,26 @@ 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 + */ 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 +110,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; @@ -2565,7 +2577,14 @@ class FactureFournisseur extends CommonInvoice */ class SupplierInvoiceLine extends CommonObjectLine { + /** + * @var string ID to identify managed object + */ public $element='facture_fourn_det'; + + /** + * @var string Name of table without prefix where object is stored + */ public $table_element='facture_fourn_det'; public $oldline; @@ -2575,6 +2594,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see product_ref */ public $ref; + /** * Internal ref * @var string @@ -2593,6 +2613,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see label */ public $libelle; + /** * Product description * @var string @@ -2606,6 +2627,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see subprice */ public $pu_ht; + public $subprice; /** @@ -2621,6 +2643,7 @@ class SupplierInvoiceLine extends CommonObjectLine * @see total_tva */ public $tva; + public $total_tva; /** diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 6cb1ff2bb27..f507f417684 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -37,16 +37,27 @@ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class. */ class ProductFournisseur extends Product { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; var $product_fourn_price_id; // id of ligne product-supplier - var $id; // product id - /** - * @deprecated - * @see ref_supplier - */ + /** + * @var int ID + */ + public $id; + + /** + * @deprecated + * @see ref_supplier + */ var $fourn_ref; var $delivery_time_days; var $ref_supplier; // ref supplier (can be set by get_buyprice) @@ -78,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) { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 297a5fb859a..26a29db83ea 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -35,8 +35,16 @@ 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'; + + /** + * @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/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 6ebb90817fd..0ed6f7fed14 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 11c40ff45a8..e26f6faf8b3 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/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3d7ac96f47e..b9ae654d4ca 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -819,7 +819,6 @@ if ($resql) if ($num > 0) { $i=0; - $totalarray=array(); while ($i < min($num,$limit)) { diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index e8696f0bdca..fb76247f5d7 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -146,6 +146,7 @@ if ($year) print '
      '.$langs->trans("Size").''.$langs->trans("Date").'
      '; - - 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); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 6aa5386de50..a72ea28928b 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/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 1dcb1fd261a..1a7edf914e0 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -33,8 +33,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class Entrepot extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 151a625fdc6..ba82e007086 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 6332c401ac1..0dbe197981c 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 2c1c22fcce2..d5ea2e1f45f 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/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index c1631b3ff18..07432766fbc 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) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9d4ac0fb122..8a39327b7c0 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 "
      Table llx_societe_account wiki page for more information

      + * Example body payload :
      {"key_account": "cus_DAVkLSs1LYyYI", "site": "stripe"}
      + * + * @param int $id ID of thirdparty + * @param array $request_data Request data + * + * @return SocieteAccount + * @throws 401 Unauthorized: User does not have permission to read thirdparties + * @throws 409 Conflict: A SocieteAccount entity (gateway) already exists for this company and site. + * @throws 422 Unprocessable Entity: You must pass the site attribute in your request data ! + * @throws 500 Internal Server Error: Error creating SocieteAccount account + * @status 201 + * + * @url POST {id}/gateways + */ + function createSocieteAccount($id, $request_data = null) + { + global $db; + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + if(!isset($request_data['site'])) { + throw new RestException(422, 'Unprocessable Entity: You must pass the site attribute in your request data !'); + } + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".$id." AND site = '". $request_data['site']."' "; + $result = $db->query($sql); + + if($result->num_rows == 0 ){ + $account = new SocieteAccount($this->db); + if(!isset($request_data['login'])) { + $account->login = ""; + } + $account->fk_soc = $id; + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + if ($account->create(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error creating SocieteAccount entity. Ensure that the ID of thirdparty provided does exist!'); + + $this->_cleanObjectDatas($account); + + return $account; + } else { + throw new RestException(409, 'A SocieteAccount entity already exists for this company and site.'); + } + } + + /** + * Create and attach a new (or replace an existing) specific site gateway to a thirdparty + * + * You MUST pass all values to keep (otherwise, they will be deleted) !
      + * If you just need to update specific fields prefer PATCH /thirdparties/{id}/gateways/{site} endpoint.

      + * When a SocieteAccount entity does not exist for the id and site + * supplied, a new one will be created. In that case fk_soc and site members form + * request body payload will be ignored and id and site query strings parameters + * will be used instead. + * + * @param int $id ID of thirdparty + * @param string $site Site key + * @param array $request_data Request data + * + * @return SocieteAccount + * @throws 401 Unauthorized: User does not have permission to read thirdparties + * @throws 422 Unprocessable Entity: You must pass the site attribute in your request data ! + * @throws 500 Internal Server Error: Error updating SocieteAccount entity + * + * @throws RestException + * @url PUT {id}/gateways/{site} + */ + function putSocieteAccount($id, $site, $request_data = null) + { + global $db; + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $sql = "SELECT rowid, fk_user_creat, date_creation FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = $id AND site = '$site' "; + $result = $db->query($sql); + + // We do not found an existing SocieteAccount entity for this fk_soc and site ; we then create a new one. + if($result->num_rows == 0 ){ + if(!isset($request_data['key_account'])) { + throw new RestException(422, 'Unprocessable Entity: You must pass the key_account attribute in your request data !'); + } + $account = new SocieteAccount($this->db); + if(!isset($request_data['login'])) { + $account->login = ""; + } + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + $account->fk_soc = $id; + $account->site = $site; + + if ($account->create(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error creating SocieteAccount entity.'); + // We found an existing SocieteAccount entity, we are replacing it + } else { + + if(isset($request_data['site']) && $request_data['site'] !== $site) { + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".$id." AND site = '". $request_data['site']."' "; + $result = $db->query($sql); + + if($result->num_rows !== 0) + throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) from $site to ".$request_data['site'] . " but another SocieteAccount entity already exists with this site key."); + } + + $obj = $db->fetch_object($result); + + $account = new SocieteAccount($this->db); + $account->id = $obj->rowid; + $account->fk_soc = $id; + $account->site = $site; + if(!isset($request_data['login'])) { + $account->login = ""; + } + $account->fk_user_creat = $obj->fk_user_creat; + $account->date_creation = $obj->date_creation; + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + if ($account->update(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error updating SocieteAccount entity.'); + } + + $this->_cleanObjectDatas($account); + + return $account; + } + + /** + * Update specified values of a specific site gateway attached to a thirdparty + * + * @param int $id Id of thirdparty + * @param string $site Site key + * @param array $request_data Request data + * + * @return SocieteAccount + * @throws 401 Unauthorized: User does not have permission to read thirdparties + * @throws 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty + * @throws 409 Conflict: Another SocieteAccount entity already exists for this thirdparty with this site key. + * @throws 500 Internal Server Error: Error updating SocieteAccount entity + * + * @url PATCH {id}/gateways/{site} + */ + function patchSocieteAccount($id, $site, $request_data = null) + { + global $db; + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = $id AND site = '$site' "; + $result = $db->query($sql); + + if($result->num_rows == 0 ){ + throw new RestException(404, "This thirdparty does not have $site gateway attached or does not exist."); + } else { + + // If the user tries to edit the site member, we check first if + if(isset($request_data['site']) && $request_data['site'] !== $site) { + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = ".$id." AND site = '". $request_data['site']."' "; + $result = $db->query($sql); + + if($result->num_rows !== 0) + throw new RestException(409, "You are trying to update this thirdparty SocieteAccount (gateway record) site member from $site to ".$request_data['site'] . " but another SocieteAccount entity already exists for this thirdparty with this site key."); + } + + $obj = $db->fetch_object($result); + $account = new SocieteAccount($this->db); + $account->fetch($obj->rowid); + + foreach($request_data as $field => $value) { + $account->$field = $value; + } + + if ($account->update(DolibarrApiAccess::$user) < 0) + throw new RestException(500, 'Error updating SocieteAccount account'); + + $this->_cleanObjectDatas($account); + + return $account; + } + } + + /** + * Delete a specific site gateway attached to a thirdparty (by gateway id) + * + * @param int $id ID of thirdparty + * @param int $site Site key + * + * @return void + * @throws 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty + * @throws 500 Internal Server Error: Error deleting SocieteAccount entity + * + * @url DELETE {id}/gateways/{site} + */ + function deleteSocieteAccount($id, $site) + { + global /** @var Database $db */ + $db; + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = $id AND site = '$site' "; + $result = $db->query($sql); + + if($result->num_rows == 0 ){ + throw new RestException(404); + } else { + $obj = $db->fetch_object($result); + $account = new SocieteAccount($this->db); + $account->fetch($obj->rowid); + + if($account->delete(DolibarrApiAccess::$user) < 0) { + throw new RestException(500, "Error while deleting $site gateway attached to this third party"); + } + } + } + + /** + * Delete all gateways attached to a thirdparty + * + * @param int $id ID of thirdparty + * + * @return void + * @throws 401 Unauthorized: User does not have permission to delete thirdparties gateways + * @throws 404 Not Found: Specified thirdparty ID does not belongs to an existing thirdparty + * @throws 500 Internal Server Error: Error deleting SocieteAccount entity + * + * @url DELETE {id}/gateways + */ + function deleteSocieteAccounts($id) + { + global /** @var Database $db */ + $db; + + if(! DolibarrApiAccess::$user->rights->societe->creer) { + throw new RestException(401); + } + + /** + * We select all the records that match the socid + */ + + $sql = "SELECT rowid, fk_soc, key_account, site, date_creation, tms"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe_account WHERE fk_soc = $id "; + + $result = $db->query($sql); + + if($result->num_rows == 0 ){ + throw new RestException(404, 'This third party does not have any gateway attached or does not exist.'); + } else { + $i=0; + + $num = $db->num_rows($result); + while ($i < $num) + { + $obj = $db->fetch_object($result); + $account = new SocieteAccount($db); + $account->fetch($obj->rowid); + + if($account->delete(DolibarrApiAccess::$user) < 0) { + throw new RestException(500, 'Error while deleting gateways attached to this third party'); + } + $i++; + } + } + + } /** * Clean sensible object datas @@ -1182,9 +1536,8 @@ class Thirdparties extends DolibarrApi * @param object $object Object to clean * @return array Array of cleaned object properties */ - function _cleanObjectDatas($object) + function _cleanObjectDatas($object) { - $object = parent::_cleanObjectDatas($object); unset($object->nom); // ->name already defined and nom deprecated @@ -1215,7 +1568,7 @@ class Thirdparties extends DolibarrApi foreach (Thirdparties::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, "$field field missing"); - $thirdparty[$field] = $data[$field]; + $thirdparty[$field] = $data[$field]; } return $thirdparty; } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index cc40a697cad..0b4919eef79 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 0289c5aa745..b0d491f33fb 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -41,8 +41,16 @@ require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; */ class Societe extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 3fc3082e5bf..e6aabf68f6d 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 */ @@ -84,7 +87,7 @@ class SocieteAccount extends CommonObject 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1), 'site' => array('type'=>'varchar(128)', 'label'=>'Site', 'visible'=>-1, 'enabled'=>1, 'position'=>41), - 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>42, 'notnull'=>1, 'index'=>1), + 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'index'=>1), 'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,), 'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,), //'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,), @@ -99,6 +102,7 @@ class SocieteAccount extends CommonObject public $rowid; public $entity; public $key_account; + public $login; public $pass_encoding; public $pass_crypted; public $pass_temp; 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/stripe/transaction.php b/htdocs/stripe/transaction.php index 5b9282a6e79..415ed32a62a 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/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 1766f4b5161..7c7b9eaa732 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -45,8 +45,16 @@ 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 ID to identify managed object + */ + public $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,17 +2655,36 @@ class SupplierProposal extends CommonObject */ class SupplierProposalLine extends CommonObjectLine { - var $db; - var $error; + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error=''; - public $element='supplier_proposaldet'; - public $table_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 + */ + public $table_element='supplier_proposaldet'; var $oldline; // 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 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; } diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index bc560d38f8f..50ff0cc6eed 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 bc560d38f8f..50ff0cc6eed 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/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 1c94d3a1373..5e9748a6027 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -35,12 +35,25 @@ require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; */ class ActionsTicket { + /** + * @var DoliDB Database handler. + */ public $db; + public $dao; public $mesg; - public $error; - public $errors = array(); + + /** + * @var string Error code (or message) + */ + public $error; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + //! Numero de l'erreur public $errno = 0; @@ -951,7 +964,7 @@ class ActionsTicket * Print statut * * @param int $mode Display mode - * @return void + * @return string Label of status */ public function getLibStatut($mode = 0) { @@ -978,8 +991,8 @@ class ActionsTicket /** * Get action title * - * @param string $action Type of action - * @return string + * @param string $action Type of action + * @return string Title of action */ public function getTitle($action = '') { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1d6593d62ef..8b211a66f64 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 */ @@ -1615,12 +1620,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++; diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index b4a464f6a17..cf5f8dc122b 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -32,11 +32,30 @@ require_once DOL_DOCUMENT_ROOT . "/core/class/commonobject.class.php"; */ 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 DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error; + + /** + * @var string[] Error codes (or messages) + */ + public $errors = array(); + + /** + * @var string ID to identify managed object + */ + public $element = 'ticketlogs'; + + /** + * @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 7075e8d8aec..c67bba222ef 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -40,8 +40,16 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class User extends CommonObject { + /** + * @var string ID to identify managed object + */ 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 @@ -1531,6 +1539,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; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 594b8bf928c..95272011762 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -35,8 +35,16 @@ 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'; + + /** + * @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/variants/generator.php b/htdocs/variants/generator.php index 3083c5e67ca..49265f25001 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -374,7 +374,8 @@ if (! empty($id) || ! empty($ref)) { close(); -} \ No newline at end of file + // End of page + llxFooter(); +} + +$db->close(); diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 1cf2d8851cc..092937234fc 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 06fc16c1dd1..249e6015d83 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; @@ -126,8 +125,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) diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index 0836036afa5..e1db7d199cf 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -117,7 +117,7 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesCreate - * + * * @return void */ public function testChargeSocialesCreate() @@ -139,10 +139,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesFetch - * + * * @param int $id Id of social contribution * @return void - * + * * @depends testChargeSocialesCreate * The depends says test is run only if previous is ok */ @@ -164,10 +164,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesValid - * + * * @param Object $localobject Social contribution * @return void - * + * * @depends testChargeSocialesFetch * The depends says test is run only if previous is ok */ @@ -188,10 +188,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesOther - * + * * @param Object $localobject Social contribution * @return void - * + * * @depends testChargeSocialesValid * The depends says test is run only if previous is ok */ @@ -216,10 +216,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesDelete - * + * * @param int $id Social contribution * @return void - * + * * @depends testChargeSocialesOther * The depends says test is run only if previous is ok */ diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index a97da0c0ad6..c29adf0861f 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -264,14 +264,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: 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