Browse Source

Merge remote-tracking branch 'upstream/develop' into camelCaps

Frédéric FRANCE 6 years ago
parent
commit
fe4260a014
100 changed files with 852 additions and 346 deletions
  1. 1 1
      .travis.yml
  2. 7 7
      build/aps/Limitations of APS Support in the Panel_fichiers/highlight.js
  3. 1 1
      build/aps/Limitations of APS Support in the Panel_fichiers/prettify.css
  4. 1 1
      build/aps/Limitations of APS Support in the Panel_fichiers/prettify.js
  5. 19 19
      build/aps/Limitations of APS Support in the Panel_fichiers/stylesheet.css
  6. 20 20
      dev/initdata/import-products.php
  7. 10 10
      dev/initdata/import-users.php
  8. 5 5
      dev/initdemo/updatedemo.php
  9. 16 0
      dev/setup/codesniffer/ruleset.xml
  10. 6 6
      htdocs/accountancy/admin/importaccounts.php
  11. 1 1
      htdocs/accountancy/bookkeeping/thirdparty_lettrage.php
  12. 1 1
      htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php
  13. 25 5
      htdocs/accountancy/class/accountancycategory.class.php
  14. 11 2
      htdocs/accountancy/class/accountancysystem.class.php
  15. 21 4
      htdocs/accountancy/class/accountingaccount.class.php
  16. 8 0
      htdocs/accountancy/class/accountingjournal.class.php
  17. 4 1
      htdocs/accountancy/class/bookkeeping.class.php
  18. 5 5
      htdocs/adherents/canvas/actions_adherentcard_common.class.php
  19. 15 0
      htdocs/adherents/class/adherent.class.php
  20. 8 0
      htdocs/adherents/class/adherent_type.class.php
  21. 3 0
      htdocs/adherents/class/adherentstats.class.php
  22. 8 0
      htdocs/adherents/class/subscription.class.php
  23. 1 1
      htdocs/admin/bank.php
  24. 2 2
      htdocs/admin/company.php
  25. 1 1
      htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
  26. 6 6
      htdocs/admin/dolistore/css/dolistore.css
  27. 1 1
      htdocs/admin/events.php
  28. 18 18
      htdocs/admin/ihm.php
  29. 2 2
      htdocs/admin/ldap_members.php
  30. 4 4
      htdocs/admin/limits.php
  31. 19 19
      htdocs/admin/mails.php
  32. 6 6
      htdocs/admin/mails_emailing.php
  33. 3 3
      htdocs/admin/menus.php
  34. 2 2
      htdocs/admin/modules.php
  35. 18 18
      htdocs/admin/pdf.php
  36. 19 19
      htdocs/admin/receiptprinter.php
  37. 12 12
      htdocs/admin/sms.php
  38. 2 2
      htdocs/admin/stock.php
  39. 3 3
      htdocs/admin/system/modules.php
  40. 3 3
      htdocs/admin/ticket.php
  41. 4 0
      htdocs/asset/class/asset.class.php
  42. 8 0
      htdocs/asset/class/asset_type.class.php
  43. 2 2
      htdocs/asterisk/cidlookup.php
  44. 1 1
      htdocs/blockedlog/admin/blockedlog_list.php
  45. 4 0
      htdocs/blockedlog/class/blockedlog.class.php
  46. 18 3
      htdocs/bookmarks/class/bookmark.class.php
  47. 1 1
      htdocs/cashdesk/css/style.css
  48. 7 0
      htdocs/categories/class/categorie.class.php
  49. 17 4
      htdocs/comm/action/class/actioncomm.class.php
  50. 3 0
      htdocs/comm/action/class/actioncommreminder.class.php
  51. 17 6
      htdocs/comm/action/class/cactioncomm.class.php
  52. 4 4
      htdocs/comm/card.php
  53. 7 7
      htdocs/comm/mailing/advtargetemailing.php
  54. 0 2
      htdocs/comm/mailing/cibles.php
  55. 18 6
      htdocs/comm/mailing/class/advtargetemailing.class.php
  56. 7 3
      htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
  57. 8 0
      htdocs/comm/mailing/class/mailing.class.php
  58. 19 0
      htdocs/comm/propal/class/propal.class.php
  59. 4 1
      htdocs/comm/propal/class/propalestats.class.php
  60. 1 1
      htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
  61. 2 2
      htdocs/commande/card.php
  62. 20 3
      htdocs/commande/class/commande.class.php
  63. 3 0
      htdocs/commande/class/commandestats.class.php
  64. 39 6
      htdocs/compta/bank/class/account.class.php
  65. 9 9
      htdocs/compta/bank/class/bankcateg.class.php
  66. 21 4
      htdocs/compta/bank/class/paymentvarious.class.php
  67. 8 0
      htdocs/compta/deplacement/class/deplacement.class.php
  68. 3 0
      htdocs/compta/deplacement/class/deplacementstats.class.php
  69. 15 0
      htdocs/compta/facture/class/facture-rec.class.php
  70. 17 2
      htdocs/compta/facture/class/facture.class.php
  71. 5 1
      htdocs/compta/facture/class/facturestats.class.php
  72. 13 3
      htdocs/compta/facture/class/paymentterm.class.php
  73. 16 3
      htdocs/compta/localtax/class/localtax.class.php
  74. 8 0
      htdocs/compta/paiement/cheque/class/remisecheque.class.php
  75. 1 7
      htdocs/compta/paiement/class/cpaiement.class.php
  76. 10 2
      htdocs/compta/paiement/class/paiement.class.php
  77. 8 0
      htdocs/compta/prelevement/class/bonprelevement.class.php
  78. 9 2
      htdocs/compta/prelevement/class/ligneprelevement.class.php
  79. 9 2
      htdocs/compta/prelevement/class/rejetprelevement.class.php
  80. 10 2
      htdocs/compta/salaries/class/paymentsalary.class.php
  81. 3 0
      htdocs/compta/salaries/class/salariesstats.class.php
  82. 1 6
      htdocs/compta/sociales/class/cchargesociales.class.php
  83. 11 2
      htdocs/compta/sociales/class/chargesociales.class.php
  84. 10 2
      htdocs/compta/sociales/class/paymentsocialcontribution.class.php
  85. 16 3
      htdocs/compta/tva/class/tva.class.php
  86. 10 3
      htdocs/contact/canvas/actions_contactcard_common.class.php
  87. 12 0
      htdocs/contact/class/contact.class.php
  88. 25 4
      htdocs/contrat/class/contrat.class.php
  89. 15 15
      htdocs/core/ajax/check_notifications.php
  90. 5 1
      htdocs/core/boxes/box_actions.php
  91. 5 1
      htdocs/core/boxes/box_activity.php
  92. 5 1
      htdocs/core/boxes/box_bookmarks.php
  93. 5 1
      htdocs/core/boxes/box_clients.php
  94. 5 1
      htdocs/core/boxes/box_commandes.php
  95. 5 1
      htdocs/core/boxes/box_comptes.php
  96. 5 1
      htdocs/core/boxes/box_contacts.php
  97. 5 1
      htdocs/core/boxes/box_contracts.php
  98. 5 1
      htdocs/core/boxes/box_external_rss.php
  99. 5 1
      htdocs/core/boxes/box_factures.php
  100. 5 1
      htdocs/core/boxes/box_factures_fourn.php

+ 1 - 1
.travis.yml

@@ -216,7 +216,7 @@ before_script:
   - |
     export CONF_FILE=htdocs/conf/conf.php
     echo "Setting up Dolibarr $CONF_FILE"
-    echo '<?php ' > $CONF_FILE
+    echo '<?php' > $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

+ 7 - 7
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";

+ 1 - 1
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;

+ 1 - 1
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 + '</li><li class="L' + i + '">';
       }
-      var lineNum = numberLines[1] && numberLines[1].length 
+      var lineNum = numberLines[1] && numberLines[1].length
           ? numberLines[1] - 1 : 0;  // Lines are 1-indexed
       html.push('<ol class="linenums"><li class="L', (lineNum) % 10, '"');
       if (lineNum) {

+ 19 - 19
build/aps/Limitations of APS Support in the Panel_fichiers/stylesheet.css

@@ -1,5 +1,5 @@
 body
-{ 
+{
 background: #FFFFFF
 }
 
@@ -100,7 +100,7 @@ li.listalpha3 {
         width: auto;
         height: auto;
         white-space: normal;
-       }	   
+       }
 
 /*li.listalpha2, li.listalpha, li.listalpha3
 {
@@ -207,7 +207,7 @@ p.listcontinue3 {
         height: auto;
 }
 
-.prcontinuous 
+.prcontinuous
 {font-family: "Courier New", verdana, arial, helvetica, sans-serif;
         font-style: normal;
         font-variant: normal;
@@ -237,7 +237,7 @@ p.listcontinue3 {
         height: auto;
        }
 
-.prefblue 
+.prefblue
 {display: inline;
         font-family: "Courier New", verdana, arial, helvetica, sans-serif;
         font-size: 10pt;
@@ -253,7 +253,7 @@ p.listcontinue3 {
         padding-left: 0pt;
         padding-right: 0pt;
        }
-.prefred 
+.prefred
 {display: inline;
         font-family: "Courier New", verdana, arial, helvetica, sans-serif;
         font-size: 10pt;
@@ -269,7 +269,7 @@ p.listcontinue3 {
         padding-left: 0pt;
         padding-right: 0pt;
        }
-.prefdarkblue 
+.prefdarkblue
 {display: inline;
         font-family: "Courier New", verdana, arial, helvetica, sans-serif;
         font-weight: bold;
@@ -286,7 +286,7 @@ p.listcontinue3 {
         padding-left: 0pt;
         padding-right: 0pt;
        }
-.prefgrey 
+.prefgrey
 {display: inline;
         font-family: "Courier New", verdana, arial, helvetica, sans-serif;
         font-size: 10pt;
@@ -303,7 +303,7 @@ p.listcontinue3 {
         padding-right: 0pt;
        }
 
-.expandingblock 
+.expandingblock
 {font-family: "Tahoma", verdana, arial, helvetica, sans-serif;
         border-color: #AFAFAF;
         border-top-style: dotted;
@@ -363,7 +363,7 @@ p.listcontinue3 {
 
 .pagenavigation a, .pagenavigation a:link, .pagenavigation a:visited {
 	color: #000000;
-	text-decoration: none;	
+	text-decoration: none;
 }
 .pagenavigation a:hover {
 	text-decoration: none;
@@ -387,7 +387,7 @@ p.listcontinue3 {
 }
 .nav a, .nav a:link, .nav a:visited {
 	color: #000000;
-	text-decoration: none;	
+	text-decoration: none;
 }
 .nav a:hover {
 	text-decoration: none;
@@ -400,9 +400,9 @@ td.navTabActive {
 	vertical-align: middle;
 	font-family: tahoma, verdana, arial, helvetica, sans-serif;
 	font-size: 8pt;
-	padding-top: 4px;  
-	padding-bottom: 0px; 
-	padding-left: 8px; 
+	padding-top: 4px;
+	padding-bottom: 0px;
+	padding-left: 8px;
 	padding-right: 8px;
 	font-weight: bold;
 	background-image: url('nav_bg_active.gif');
@@ -567,7 +567,7 @@ a:visited,
         border-right-color: #FFFFFF;
 	     border-bottom-style: solid;
         border-bottom-width: 2px;
-        border-bottom-color: #ffffff; 
+        border-bottom-color: #ffffff;
 }
 .bodytext {
         font-family: verdana, tahoma, arial, helvetica, sans-serif;
@@ -582,7 +582,7 @@ a:visited,
 		  font-weight: bold;
         font-size: 8pt;
 		  line-height: 12px;
-        color: #2f739b; 
+        color: #2f739b;
 		  line-height: 11px;
         margin: 0px;
         padding: 3px;
@@ -1303,7 +1303,7 @@ li.listnumber2 {
         font-style: normal;
         font-variant: normal;
 		  font-size: 12pt;
-        color: #5c5b64; 
+        color: #5c5b64;
         background-color: inherit;
         word-spacing: normal;
         letter-spacing: normal;
@@ -1512,7 +1512,7 @@ li.listnumber2 {
 span.toc {
 	line-height: 19px;
 }
-		 
+
 .searchDetails {
         font-family: tahoma, verdana, arial, helvetica, sans-serif;
         font-size: 11px;
@@ -1561,11 +1561,11 @@ form {
 	font-weight: bold;
 }
 .searchFoundWord {
-	background-color: #fffdce; 
+	background-color: #fffdce;
 }
 .searchToTop {
 	text-align: left;
 	border-top: 1px solid #cfcfcf;
 	padding: 7px 0px 15px 0px;
 	margin: 0px;
-}
+}

+ 20 - 20
dev/initdata/import-products.php

@@ -21,7 +21,7 @@
 
 /**
  *      \file       dev/initdata/import-product.php
- *		\brief      Script example to insert products from a csv file. 
+ *		\brief      Script example to insert products from a csv file.
  *                  To purge data, you can have a look at purge-data.php
  */
 
@@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
 {
     $i++;
     $errorrecord=0;
-    
+
     if ($startlinenb && $i < $startlinenb) continue;
     if ($endlinenb && $i > $endlinenb) continue;
-    
+
     $nboflines++;
-    
+
     $produit = new Product($db);
     $produit->type = 0;
     $produit->status = 1;
     $produit->ref = trim($fields[0]);
-    
+
     print "Process line nb ".$i.", ref ".$produit->ref;
     $produit->label = trim($fields[2]);
     $produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : ''));
     $produit->volume = price2num($fields[8]);
-    $produit->volume_unit = 0;     
+    $produit->volume_unit = 0;
     $produit->weight = price2num($fields[9]);
     $produit->weight_units = 0;          // -3 = g
 
@@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
 
     $produit->status = 1;
     $produit->status_buy = 1;
-    
+
     $produit->finished = 1;
-    
+
     $produit->price_min = null;
     $produit->price_min_ttc = null;
     $produit->price = price2num($fields[11]);
@@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
     $produit->price_base_type = 'TTC';
     $produit->tva_tx = price2num($fields[13]);
     $produit->tva_npr = 0;
-    
+
     $produit->cost_price = price2num($fields[16]);
-    
+
     // Extrafields
     $produit->array_options['options_ecotaxdeee']=price2num($fields[17]);
-    
+
     $ret=$produit->create($user);
     if ($ret < 0)
     {
         print " - Error in create result code = ".$ret." - ".$produit->errorsToString();
         $errorrecord++;
     }
-	else 
+	else
 	{
 	    print " - Creation OK with ref ".$produit->ref." - id = ".$ret;
 	}
 
 	dol_syslog("Add prices");
-	
+
     // If we use price level, insert price for each level
 	if (! $errorrecord && 1)
 	{
@@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
             print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString();
             $errorrecord++;
         }
-    	else 
+    	else
     	{
     	    print " - updatePrice OK";
     	}
 	}
-	
+
 	dol_syslog("Add multilangs");
-	
+
 	// Add alternative languages
 	if (! $errorrecord && 1)
 	{
@@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
             print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString();
             $errorrecord++;
         }
-    	else 
+    	else
     	{
     	    print " - setMultiLangs OK";
     	}
 	}
-	
+
 	print "\n";
-	
-	if ($errorrecord) 
+
+	if ($errorrecord)
 	{
 	    fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n");
 	    $error++;    // $errorrecord will be reset

+ 10 - 10
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

+ 5 - 5
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 <http://www.gnu.org/licenses/>.
  * 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++;
 }
 

+ 16 - 0
dev/setup/codesniffer/ruleset.xml

@@ -158,6 +158,22 @@
 	<!-- Disabled as this does not support tab -->
 	<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
 
+    <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
+    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
+        <properties>
+            <property name="ignoreBlankLines" value="true"/>
+        </properties>
+    </rule>
+    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
+        <severity>0</severity>
+    </rule>
+    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
+        <severity>0</severity>
+    </rule>
+    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
+        <severity>0</severity>
+    </rule>
+
     <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
 
     <!-- Rules from PEAR Standard -->

+ 6 - 6
htdocs/accountancy/admin/importaccounts.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2013-2014 Olivier Geffroy      <jeff@jeffinfo.com>
- * Copyright (C) 2013-2017 Alexandre Spangaro   <aspangaro@zendsi.com> 
+ * Copyright (C) 2013-2017 Alexandre Spangaro   <aspangaro@zendsi.com>
  * Copyright (C) 2014      Florian Henry        <florian.henry@open-concept.pro>
  *
  * 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 '<div><font color="red">' . $langs->trans("EndProcessing") . '</font></div>';
 }
 
-// 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 '</tr>';
 		$i ++;
 	}
-	
+
 	print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Import") . '"></td></tr>';
-	
+
 	print '</table>';
 	print '</form>';
 } else {

+ 1 - 1
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');
 }

+ 1 - 1
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');
 }

+ 25 - 5
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;

+ 11 - 2
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;
 

+ 21 - 4
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

+ 8 - 0
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';

+ 4 - 1
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
 	 */

+ 5 - 5
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)

+ 15 - 0
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;

+ 8 - 0
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
 

+ 3 - 0
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;

+ 8 - 0
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

+ 1 - 1
htdocs/admin/bank.php

@@ -420,7 +420,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
     print '</a>';
     print '</td>';
 }
-else 
+else
 {
     print '<td align="center">' . "\n";
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),

+ 2 - 2
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)

+ 1 - 1
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']);
 	}

+ 6 - 6
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{

+ 1 - 1
htdocs/admin/events.php

@@ -94,7 +94,7 @@ print "</tr>\n";
 foreach ($eventstolog as $key => $arr)
 {
 	if ($arr['id'])
-	{		
+	{
 		print '<tr class="oddeven">';
 		print '<td>'.$arr['id'].'</td>';
 		print '<td>';

+ 18 - 18
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_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_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);
 
 	$varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
 	if ($_FILES[$varforimage]["tmp_name"])

+ 2 - 2
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

+ 4 - 4
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;

+ 19 - 19
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_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_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);
 	// 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;

+ 6 - 6
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");

+ 3 - 3
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

+ 2 - 2
htdocs/admin/modules.php

@@ -8,7 +8,7 @@
  * Copyright (C) 2015		Jean-François Ferry		<jfefe@aternatik.fr>
  * Copyright (C) 2015		Raphaël Doursenaud		<rdoursenaud@gpcsolutions.fr>
  * Copyright (C) 2018		Nicolas ZABOURI 		<info@inovea-conseil.com>
- * 
+ *
  * 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 '<td class="center nowrap" width="120px">';
         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'])){

+ 18 - 18
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;

+ 19 - 19
htdocs/admin/receiptprinter.php

@@ -243,14 +243,14 @@ if ($mode == 'config' && $user->admin)
     print "</tr>\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 '<tr class="oddeven">';
-            if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) 
+            if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid)
             {
                 print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
                 print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
@@ -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 '<th></th>';
             print "</tr>\n";
         }
-        
+
         print '<tr>';
         print '<td><input size="50" type="text" name="printername"></td>';
         $ret = $printer->selectTypePrinter();
@@ -315,7 +315,7 @@ if ($mode == 'config' && $user->admin)
     print '</table>';
 
     dol_fiche_end();
-    
+
     if ($action!='editprinter') {
         print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'"></div>';
     } else {
@@ -324,9 +324,9 @@ if ($mode == 'config' && $user->admin)
     print '</form>';
 
     print '<div><p></div>';
-    
+
     dol_fiche_head();
-    
+
     print $langs->trans("ReceiptPrinterTypeDesc")."<br><br>\n";
     print '<table class="noborder" width="100%">'."\n";
     print '<tr class="oddeven"><td>'.$langs->trans("CONNECTOR_DUMMY").':</td><td>'.$langs->trans("CONNECTOR_DUMMY_HELP").'</td></tr>';
@@ -338,7 +338,7 @@ if ($mode == 'config' && $user->admin)
     dol_fiche_end();
 
     print '<div><p></div>';
-    
+
     dol_fiche_head();
     print $langs->trans("ReceiptPrinterProfileDesc")."<br><br>\n";
     print '<table class="noborder" width="100%">'."\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 '<tr class="oddeven">';
             if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) {
@@ -423,7 +423,7 @@ if ($mode == 'template' && $user->admin)
     print '<th>'.$langs->trans("Description").'</th>';
     print "</tr>\n";
     $max = count($printer->tags);
-    for ($tag=0; $tag < $max; $tag++) 
+    for ($tag=0; $tag < $max; $tag++)
     {
         print '<tr class="oddeven">';
         print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
@@ -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');
 

+ 12 - 12
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 '<table class="noborder" width="100%">';
 	print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
 
-	// Disable	
+	// Disable
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
 	print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1);
 	print '</td></tr>';
 
-	// Separator	
+	// Separator
 	print '<tr class="oddeven"><td colspan="2">&nbsp;</td></tr>';
 
-	// Method	
+	// Method
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
 	if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE',$listofmethods,$conf->global->MAIN_SMS_SENDMODE,1);
 	else print '<font class="error">'.$langs->trans("None").'</font>';
     print '</td></tr>';
 
-	// From	
+	// From
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'</td>';
 	print '<td><input class="flat" name="MAIN_MAIL_SMS_FROM" size="32" value="' . $conf->global->MAIN_MAIL_SMS_FROM;
 	print '"></td></tr>';
@@ -213,20 +213,20 @@ else
 	print '<table class="noborder" width="100%">';
 	print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
 
-	// Disable	
+	// Disable
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_SMS).'</td></tr>';
 
-	// Separator	
+	// Separator
 	print '<tr class="oddeven"><td colspan="2">&nbsp;</td></tr>';
 
-	// Method	
+	// Method
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
 	$text=$listofmethods[$conf->global->MAIN_SMS_SENDMODE];
 	if (empty($text)) $text=$langs->trans("Undefined").' '.img_warning();
 	print $text;
 	print '</td></tr>';
 
-	// From	
+	// From
 	print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM",$langs->transnoentities("Undefined")).'</td>';
 	print '<td>'.$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"));

+ 2 - 2
htdocs/admin/stock.php

@@ -373,7 +373,7 @@ if($conf->invoice->enabled)
 	print "</tr>\n";
 }
 
-if($conf->order->enabled) 
+if($conf->order->enabled)
 {
 	print '<tr class="oddeven">';
 	print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
@@ -388,7 +388,7 @@ if($conf->order->enabled)
 	print "</tr>\n";
 }
 
-if($conf->expedition->enabled) 
+if($conf->expedition->enabled)
 {
 	print '<tr class="oddeven">';
 	print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';

+ 3 - 3
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
 						{

+ 3 - 3
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');
     }

+ 4 - 0
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
 	 */

+ 8 - 0
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
 

+ 2 - 2
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;

+ 1 - 1
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;

+ 4 - 0
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();
 
 	/**

+ 18 - 3
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;

+ 1 - 1
htdocs/cashdesk/css/style.css

@@ -52,7 +52,7 @@ p {
 }
 .logopos {
 	padding-top: 20px;
-	max-height: 40px;	
+	max-height: 40px;
 }
 
 /* ------------------- Header ------------------- */

+ 7 - 0
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;

+ 17 - 4
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)

+ 3 - 0
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
 	 */

+ 17 - 6
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;

+ 4 - 4
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.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
-		$boxstat.='<div class="boxstats">';
+		$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
 		$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
 		$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
 		$boxstat.='</div>';
@@ -600,7 +600,7 @@ if ($object->id > 0)
 		$link=DOL_URL_ROOT.'/commande/list.php?socid='.$object->id;
 		$icon='bill';
 		if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
-		$boxstat.='<div class="boxstats">';
+		$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
 		$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
 		$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
 		$boxstat.='</div>';
@@ -618,7 +618,7 @@ if ($object->id > 0)
 		$link=DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id;
 		$icon='bill';
 		if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
-		$boxstat.='<div class="boxstats">';
+		$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
 		$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
 		$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
 		$boxstat.='</div>';
@@ -634,7 +634,7 @@ if ($object->id > 0)
 		$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
 		$icon='bill';
 		if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
-		$boxstat.='<div class="boxstats">';
+		$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
 		$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
 		$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
 		$boxstat.='</div>';

+ 7 - 7
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';
-		
+
 	}
 }
 

+ 0 - 2
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 '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';

+ 18 - 6
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;

+ 7 - 3
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)
 	 */

+ 8 - 0
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;

+ 19 - 0
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;

+ 4 - 1
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;

+ 1 - 1
htdocs/comm/propal/tpl/linkedobjectblock.tpl.php

@@ -57,7 +57,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
         <?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
             {
                 $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
-                print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines"  data-element="'.$objectlink->element.'"  data-id="'.$objectlink->id.'"  > <i class="fa fa-indent"></i> </a>';  
+                print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines"  data-element="'.$objectlink->element.'"  data-id="'.$objectlink->id.'"  > <i class="fa fa-indent"></i> </a>';
             }
         ?>
         </td>

+ 2 - 2
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 ++;

+ 20 - 3
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;

+ 3 - 0
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;

+ 39 - 6
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;

+ 9 - 9
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) {

+ 21 - 4
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;

+ 8 - 0
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

+ 3 - 0
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;

+ 15 - 0
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;

+ 17 - 2
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;
 

+ 5 - 1
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;

+ 13 - 3
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;

+ 16 - 3
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;

+ 8 - 0
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;

+ 1 - 7
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

+ 10 - 2
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;

+ 8 - 0
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;

+ 9 - 2
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();
 

+ 9 - 2
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;
 
 
 	/**

+ 10 - 2
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;

+ 3 - 0
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;

+ 1 - 6
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

+ 11 - 2
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';
 
     /**

+ 10 - 2
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;

+ 16 - 3
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;

+ 10 - 3
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='';
 	
 
 	/**

+ 12 - 0
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

+ 25 - 4
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;
 

+ 15 - 15
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;
         }
     }

+ 5 - 1
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();

+ 5 - 1
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;
 

+ 5 - 1
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();

+ 5 - 1
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();

+ 5 - 1
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();

+ 5 - 1
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;
 

+ 5 - 1
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();

+ 5 - 1
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();

+ 5 - 1
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();

+ 5 - 1
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();

+ 5 - 1
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();

Some files were not shown because too many files changed in this diff