@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | public function testPrivatePropertyAccess() |
| 281 | 281 | { |
| 282 | 282 | $oldErrorReporting = error_reporting(E_ALL); |
| 283 | - set_error_handler(static function (int $errno, string $errstr): never { |
|
| 283 | + set_error_handler(static function(int $errno, string $errstr): never { |
|
| 284 | 284 | throw new Exception($errstr, $errno); |
| 285 | 285 | }, E_ALL); |
| 286 | 286 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | public function testUndefinedPropertyAccessDisallowed() |
| 307 | 307 | { |
| 308 | 308 | $oldErrorReporting = error_reporting(E_ALL); |
| 309 | - set_error_handler(static function (int $errno, string $errstr): never { |
|
| 309 | + set_error_handler(static function(int $errno, string $errstr): never { |
|
| 310 | 310 | throw new Exception($errstr, $errno); |
| 311 | 311 | }, E_ALL); |
| 312 | 312 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | public function testUndefinedPropertyAccess() |
| 333 | 333 | { |
| 334 | 334 | $oldErrorReporting = error_reporting(E_ALL); |
| 335 | - set_error_handler(static function (int $errno, string $errstr): never { |
|
| 335 | + set_error_handler(static function(int $errno, string $errstr): never { |
|
| 336 | 336 | throw new Exception($errstr, $errno); |
| 337 | 337 | }, E_ALL); |
| 338 | 338 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * \remarks To run this script as CLI: phpunit filename.php |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | -global $conf,$user,$langs,$db; |
|
| 28 | +global $conf, $user, $langs, $db; |
|
| 29 | 29 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 30 | 30 | //require_once 'PHPUnit/Autoload.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -33,35 +33,35 @@ discard block |
||
| 33 | 33 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
| 34 | 34 | require_once dirname(__FILE__).'/CommonClassTest.class.php'; |
| 35 | 35 | |
| 36 | -if (! defined('NOREQUIREUSER')) { |
|
| 36 | +if (!defined('NOREQUIREUSER')) { |
|
| 37 | 37 | define('NOREQUIREUSER', '1'); |
| 38 | 38 | } |
| 39 | -if (! defined('NOREQUIREDB')) { |
|
| 39 | +if (!defined('NOREQUIREDB')) { |
|
| 40 | 40 | define('NOREQUIREDB', '1'); |
| 41 | 41 | } |
| 42 | -if (! defined('NOREQUIRESOC')) { |
|
| 42 | +if (!defined('NOREQUIRESOC')) { |
|
| 43 | 43 | define('NOREQUIRESOC', '1'); |
| 44 | 44 | } |
| 45 | -if (! defined('NOREQUIRETRAN')) { |
|
| 45 | +if (!defined('NOREQUIRETRAN')) { |
|
| 46 | 46 | define('NOREQUIRETRAN', '1'); |
| 47 | 47 | } |
| 48 | -if (! defined('NOCSRFCHECK')) { |
|
| 48 | +if (!defined('NOCSRFCHECK')) { |
|
| 49 | 49 | define('NOCSRFCHECK', '1'); |
| 50 | 50 | } |
| 51 | -if (! defined('NOTOKENRENEWAL')) { |
|
| 51 | +if (!defined('NOTOKENRENEWAL')) { |
|
| 52 | 52 | define('NOTOKENRENEWAL', '1'); |
| 53 | 53 | } |
| 54 | -if (! defined('NOREQUIREMENU')) { |
|
| 54 | +if (!defined('NOREQUIREMENU')) { |
|
| 55 | 55 | define('NOREQUIREMENU', '1'); // If there is no menu to show |
| 56 | 56 | } |
| 57 | -if (! defined('NOREQUIREHTML')) { |
|
| 57 | +if (!defined('NOREQUIREHTML')) { |
|
| 58 | 58 | define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
| 59 | 59 | } |
| 60 | -if (! defined('NOREQUIREAJAX')) { |
|
| 60 | +if (!defined('NOREQUIREAJAX')) { |
|
| 61 | 61 | define('NOREQUIREAJAX', '1'); |
| 62 | 62 | } |
| 63 | -if (! defined("NOLOGIN")) { |
|
| 64 | - define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 63 | +if (!defined("NOLOGIN")) { |
|
| 64 | + define("NOLOGIN", '1'); // If this page is public (can be called outside logged session) |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if (empty($user->id)) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $langCodes = []; |
| 92 | 92 | $filesarray = scandir(DOL_DOCUMENT_ROOT.'/langs'); |
| 93 | 93 | foreach ($filesarray as $key => $code) { |
| 94 | - if (! preg_match('/^[a-z]+_[A-Z]+$/', $code)) { |
|
| 94 | + if (!preg_match('/^[a-z]+_[A-Z]+$/', $code)) { |
|
| 95 | 95 | continue; |
| 96 | 96 | } |
| 97 | 97 | $langCodes[$code] = [$code]; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function testLang($code): void |
| 112 | 112 | { |
| 113 | - global $conf,$user,$langs,$db; |
|
| 113 | + global $conf, $user, $langs, $db; |
|
| 114 | 114 | $conf = $this->savconf; |
| 115 | 115 | $user = $this->savuser; |
| 116 | 116 | $langs = $this->savlangs; |
@@ -136,11 +136,11 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | $result = $tmplangs->transnoentitiesnoconv("SeparatorDecimal"); |
| 138 | 138 | print $prefix."SeparatorDecimal=".$result.PHP_EOL; |
| 139 | - $this->assertTrue(in_array($result, array('.',',','/','。',' ','','None')), 'Error on decimal separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported |
|
| 139 | + $this->assertTrue(in_array($result, array('.', ',', '/', '。', ' ', '', 'None')), 'Error on decimal separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported |
|
| 140 | 140 | |
| 141 | 141 | $result = $tmplangs->transnoentitiesnoconv("SeparatorThousand"); |
| 142 | 142 | print $prefix."SeparatorThousand=".$result.PHP_EOL; |
| 143 | - $this->assertTrue(in_array($result, array('.',',','/',' ','','\'','None','Space')), 'Error on thousand separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported |
|
| 143 | + $this->assertTrue(in_array($result, array('.', ',', '/', ' ', '', '\'', 'None', 'Space')), 'Error on thousand separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported |
|
| 144 | 144 | |
| 145 | 145 | // Test java string contains only d,M,y,/,-,. and not m,... |
| 146 | 146 | $result = $tmplangs->transnoentitiesnoconv("FormatDateShortJava"); |
@@ -158,37 +158,37 @@ discard block |
||
| 158 | 158 | print $prefix."Check some syntax rules in the language file".PHP_EOL; |
| 159 | 159 | $filesarray2 = scandir(DOL_DOCUMENT_ROOT.'/langs/'.$code); |
| 160 | 160 | foreach ($filesarray2 as $key => $file) { |
| 161 | - if (! preg_match('/\.lang$/', $file)) { |
|
| 161 | + if (!preg_match('/\.lang$/', $file)) { |
|
| 162 | 162 | continue; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | //print 'Check lang file '.$file.PHP_EOL; |
| 166 | 166 | $filecontent = file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file); |
| 167 | 167 | |
| 168 | - $result = preg_match('/=--$/m', $filecontent); // A special % char we don't want. We want the common one. |
|
| 168 | + $result = preg_match('/=--$/m', $filecontent); // A special % char we don't want. We want the common one. |
|
| 169 | 169 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 170 | 170 | $this->assertTrue($result == 0, 'Found a translation KEY=-- in file '.$code.'/'.$file.'. We probably want Key=- instead.'); |
| 171 | 171 | |
| 172 | - $result = strpos($filecontent, '%'); // A special % char we don't want. We want the common one. |
|
| 172 | + $result = strpos($filecontent, '%'); // A special % char we don't want. We want the common one. |
|
| 173 | 173 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 174 | 174 | $this->assertTrue($result === false, 'Found a bad percent char % instead of % in file '.$code.'/'.$file); |
| 175 | 175 | |
| 176 | - $result = preg_match('/%n/m', $filecontent); // A sequence of char we don't want |
|
| 176 | + $result = preg_match('/%n/m', $filecontent); // A sequence of char we don't want |
|
| 177 | 177 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 178 | 178 | $this->assertTrue($result == 0, 'Found a sequence %n in the translation file '.$code.'/'.$file.'. We probably want %s'); |
| 179 | 179 | |
| 180 | - $result = preg_match('/<<<<</m', $filecontent); // A sequence of char we don't want |
|
| 180 | + $result = preg_match('/<<<<</m', $filecontent); // A sequence of char we don't want |
|
| 181 | 181 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 182 | 182 | $this->assertTrue($result == 0, 'Found a sequence <<<<< in the translation file '.$code.'/'.$file.'. Probably a bad merge of code were done.'); |
| 183 | 183 | |
| 184 | 184 | $reg = array(); |
| 185 | - $result = preg_match('/(.*)\'notranslate\'/im', $filecontent, $reg); // A sequence of char we don't want |
|
| 185 | + $result = preg_match('/(.*)\'notranslate\'/im', $filecontent, $reg); // A sequence of char we don't want |
|
| 186 | 186 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 187 | 187 | $this->assertTrue($result == 0, 'Found a sequence tag \'notranslate\' in the translation file '.$code.'/'.$file.' in line '.empty($reg[1]) ? '' : $reg[1]); |
| 188 | 188 | |
| 189 | 189 | if (!in_array($code, array('ar_SA'))) { |
| 190 | 190 | $reg = array(); |
| 191 | - $result = preg_match('/(.*)<([^a-z\/\s,=\(]1)/im', $filecontent, $reg); // A sequence of char we don't want |
|
| 191 | + $result = preg_match('/(.*)<([^a-z\/\s,=\(]1)/im', $filecontent, $reg); // A sequence of char we don't want |
|
| 192 | 192 | //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; |
| 193 | 193 | $this->assertTrue($result == 0, 'Found a sequence tag <'.(empty($reg[2]) ? '' : $reg[2]).' in the translation file '.$code.'/'.$file.' in line '.empty($reg[1]) ? '' : $reg[1]); |
| 194 | 194 | } |
@@ -206,15 +206,15 @@ discard block |
||
| 206 | 206 | return [ |
| 207 | 207 | 'en_US-1' => [ |
| 208 | 208 | 'Result of lang->trans must have original translation string with its original HTML tag, but inserted values must be fully encoded.', // Description |
| 209 | - "en_US", // Langcode |
|
| 210 | - "main", // Dict |
|
| 211 | - "Search criteria '<b><input autofocus onfocus='alert(1337)' <--!</b>' into fields ", // Expected |
|
| 209 | + "en_US", // Langcode |
|
| 210 | + "main", // Dict |
|
| 211 | + "Search criteria '<b><input autofocus onfocus='alert(1337)' <--!</b>' into fields ", // Expected |
|
| 212 | 212 | "FilterOnInto", "<input autofocus onfocus='alert(1337)' <--!"], |
| 213 | 213 | 'fr-FR-1' => [ |
| 214 | 214 | 'Result of lang->trans must have original translation string with its original HTML tag, but inserted values must be fully encoded.', // Description |
| 215 | - "fr_FR", // Langcode |
|
| 216 | - "main", // Dict |
|
| 217 | - "Rechercher le critère '<b><input autofocus onfocus='alert(1337)' <--!</b>' dans les champs ", // Expected |
|
| 215 | + "fr_FR", // Langcode |
|
| 216 | + "main", // Dict |
|
| 217 | + "Rechercher le critère '<b><input autofocus onfocus='alert(1337)' <--!</b>' dans les champs ", // Expected |
|
| 218 | 218 | "FilterOnInto", "<input autofocus onfocus='alert(1337)' <--!"], |
| 219 | 219 | ]; |
| 220 | 220 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function testTrans($description, $langcode, $dict, $expected, $key, $param1 = null, $param2 = null) |
| 238 | 238 | { |
| 239 | - global $conf,$user,$langs,$db; |
|
| 239 | + global $conf, $user, $langs, $db; |
|
| 240 | 240 | $conf = $this->savconf; |
| 241 | 241 | $user = $this->savuser; |
| 242 | 242 | $langs = $this->savlangs; |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | $this->ref_supplier = $obj->ref_supplier; |
| 528 | 528 | $this->socid = $obj->fk_soc; |
| 529 | 529 | $this->fourn_id = $obj->fk_soc; |
| 530 | - $this->statut = $obj->status; // deprecated |
|
| 530 | + $this->statut = $obj->status; // deprecated |
|
| 531 | 531 | $this->status = $obj->status; |
| 532 | 532 | $this->billed = $obj->billed; |
| 533 | 533 | $this->user_author_id = $obj->user_author_id; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | $this->fk_project = $obj->fk_project; |
| 559 | 559 | $this->cond_reglement_id = $obj->fk_cond_reglement; |
| 560 | 560 | $this->cond_reglement_code = $obj->cond_reglement_code; |
| 561 | - $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
| 561 | + $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
| 562 | 562 | $this->cond_reglement_label = $obj->cond_reglement_label; |
| 563 | 563 | $this->cond_reglement_doc = $obj->cond_reglement_doc; |
| 564 | 564 | $this->fk_account = $obj->fk_account; |
@@ -691,10 +691,10 @@ discard block |
||
| 691 | 691 | $sqlsearchpackage .= ' WHERE entity IN ('.getEntity('product_fournisseur_price').")"; |
| 692 | 692 | $sqlsearchpackage .= " AND fk_product = ".((int) $objp->fk_product); |
| 693 | 693 | $sqlsearchpackage .= " AND ref_fourn = '".$this->db->escape($objp->ref_supplier)."'"; |
| 694 | - $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 695 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 694 | + $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 695 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 696 | 696 | $sqlsearchpackage .= " AND fk_soc = ".((int) $this->socid); |
| 697 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 697 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 698 | 698 | $sqlsearchpackage .= " LIMIT 1"; |
| 699 | 699 | |
| 700 | 700 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | if (!$error) { |
| 849 | 849 | $result = 1; |
| 850 | 850 | $this->status = self::STATUS_VALIDATED; |
| 851 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 851 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 852 | 852 | $this->ref = $num; |
| 853 | 853 | } |
| 854 | 854 | |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | } |
| 1093 | 1093 | |
| 1094 | 1094 | global $action; |
| 1095 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1095 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1096 | 1096 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1097 | 1097 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1098 | 1098 | if ($reshook > 0) { |
@@ -1361,7 +1361,7 @@ discard block |
||
| 1361 | 1361 | $sql .= " WHERE rowid = ".((int) $this->id); |
| 1362 | 1362 | |
| 1363 | 1363 | if ($this->db->query($sql)) { |
| 1364 | - $result = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1364 | + $result = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1365 | 1365 | |
| 1366 | 1366 | if ($error == 0) { |
| 1367 | 1367 | // Call trigger |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | $sql .= " WHERE rowid = ".((int) $this->id); |
| 1414 | 1414 | dol_syslog(get_class($this)."::cancel", LOG_DEBUG); |
| 1415 | 1415 | if ($this->db->query($sql)) { |
| 1416 | - $result = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1416 | + $result = 0; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 1417 | 1417 | |
| 1418 | 1418 | // Call trigger |
| 1419 | 1419 | $result = $this->call_trigger('ORDER_SUPPLIER_CANCEL', $user); |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | $this->multicurrency_tx = 1; |
| 1543 | 1543 | } |
| 1544 | 1544 | |
| 1545 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 1545 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 1546 | 1546 | $this->status = self::STATUS_DRAFT; |
| 1547 | 1547 | |
| 1548 | 1548 | $sql = "INSERT INTO ".$this->db->prefix()."commande_fournisseur ("; |
@@ -1628,10 +1628,10 @@ discard block |
||
| 1628 | 1628 | $line->date_end, |
| 1629 | 1629 | $line->array_options, |
| 1630 | 1630 | $line->fk_unit, |
| 1631 | - $line->multicurrency_subprice, // pu_ht_devise |
|
| 1632 | - $line->origin, // origin |
|
| 1633 | - $line->origin_id, // origin_id |
|
| 1634 | - $line->rang, // rang |
|
| 1631 | + $line->multicurrency_subprice, // pu_ht_devise |
|
| 1632 | + $line->origin, // origin |
|
| 1633 | + $line->origin_id, // origin_id |
|
| 1634 | + $line->rang, // rang |
|
| 1635 | 1635 | $line->special_code |
| 1636 | 1636 | ); |
| 1637 | 1637 | if ($result < 0) { |
@@ -2004,7 +2004,7 @@ discard block |
||
| 2004 | 2004 | $this->db->begin(); |
| 2005 | 2005 | |
| 2006 | 2006 | $product_type = $type; |
| 2007 | - $label = ''; // deprecated |
|
| 2007 | + $label = ''; // deprecated |
|
| 2008 | 2008 | |
| 2009 | 2009 | if ($fk_product > 0) { |
| 2010 | 2010 | if (getDolGlobalString('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY')) { // Not the common case |
@@ -2147,7 +2147,7 @@ discard block |
||
| 2147 | 2147 | $this->line->total_localtax2 = $total_localtax2; |
| 2148 | 2148 | $this->line->total_ttc = $total_ttc; |
| 2149 | 2149 | $this->line->product_type = $type; |
| 2150 | - $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
| 2150 | + $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
| 2151 | 2151 | $this->line->origin = $origin; |
| 2152 | 2152 | $this->line->origin_id = $origin_id; |
| 2153 | 2153 | $this->line->fk_unit = $fk_unit; |
@@ -2158,8 +2158,8 @@ discard block |
||
| 2158 | 2158 | // Multicurrency |
| 2159 | 2159 | $this->line->fk_multicurrency = $this->fk_multicurrency; |
| 2160 | 2160 | $this->line->multicurrency_code = $this->multicurrency_code; |
| 2161 | - $this->line->multicurrency_subprice = $pu_ht_devise; |
|
| 2162 | - $this->line->multicurrency_total_ht = $multicurrency_total_ht; |
|
| 2161 | + $this->line->multicurrency_subprice = $pu_ht_devise; |
|
| 2162 | + $this->line->multicurrency_total_ht = $multicurrency_total_ht; |
|
| 2163 | 2163 | $this->line->multicurrency_total_tva = $multicurrency_total_tva; |
| 2164 | 2164 | $this->line->multicurrency_total_ttc = $multicurrency_total_ttc; |
| 2165 | 2165 | |
@@ -3354,7 +3354,7 @@ discard block |
||
| 3354 | 3354 | global $conf, $langs; |
| 3355 | 3355 | |
| 3356 | 3356 | if (!dol_strlen($modele)) { |
| 3357 | - $modele = ''; // No doc template/generation by default |
|
| 3357 | + $modele = ''; // No doc template/generation by default |
|
| 3358 | 3358 | |
| 3359 | 3359 | if (!empty($this->model_pdf)) { |
| 3360 | 3360 | $modele = $this->model_pdf; |
@@ -3886,10 +3886,10 @@ discard block |
||
| 3886 | 3886 | $sqlsearchpackage .= ' WHERE entity IN ('.getEntity('product_fournisseur_price').")"; |
| 3887 | 3887 | $sqlsearchpackage .= " AND fk_product = ".((int) $objp->fk_product); |
| 3888 | 3888 | $sqlsearchpackage .= " AND ref_fourn = '".$this->db->escape($objp->ref_supplier)."'"; |
| 3889 | - $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 3890 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 3889 | + $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 3890 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 3891 | 3891 | $sqlsearchpackage .= " AND fk_soc = ".((int) $objp->socid); |
| 3892 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 3892 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 3893 | 3893 | $sqlsearchpackage .= " LIMIT 1"; |
| 3894 | 3894 | |
| 3895 | 3895 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -4018,7 +4018,7 @@ discard block |
||
| 4018 | 4018 | $sql .= "null,"; |
| 4019 | 4019 | } |
| 4020 | 4020 | $sql .= "'".$this->db->escape($this->product_type)."',"; |
| 4021 | - $sql .= (int) $this->special_code . ","; |
|
| 4021 | + $sql .= (int) $this->special_code.","; |
|
| 4022 | 4022 | $sql .= "'".$this->db->escape($this->rang)."',"; |
| 4023 | 4023 | $sql .= "'".$this->db->escape($this->qty)."', "; |
| 4024 | 4024 | $sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape($this->vat_src_code)."'").","; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $search_date_order_endday = GETPOSTINT('search_date_order_endday'); |
| 67 | 67 | $search_date_order_endmonth = GETPOSTINT('search_date_order_endmonth'); |
| 68 | 68 | $search_date_order_endyear = GETPOSTINT('search_date_order_endyear'); |
| 69 | -$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver |
|
| 69 | +$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver |
|
| 70 | 70 | $search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear); |
| 71 | 71 | |
| 72 | 72 | $search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday'); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday'); |
| 76 | 76 | $search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth'); |
| 77 | 77 | $search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear'); |
| 78 | -$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
| 78 | +$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver |
|
| 79 | 79 | $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); |
| 80 | 80 | |
| 81 | 81 | $search_date_valid_startday = GETPOSTINT('search_date_valid_startday'); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $search_date_valid_endday = GETPOSTINT('search_date_valid_endday'); |
| 85 | 85 | $search_date_valid_endmonth = GETPOSTINT('search_date_valid_endmonth'); |
| 86 | 86 | $search_date_valid_endyear = GETPOSTINT('search_date_valid_endyear'); |
| 87 | -$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
| 87 | +$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver |
|
| 88 | 88 | $search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear); |
| 89 | 89 | |
| 90 | 90 | $search_date_approve_startday = GETPOSTINT('search_date_approve_startday'); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $search_date_approve_endday = GETPOSTINT('search_date_approve_endday'); |
| 94 | 94 | $search_date_approve_endmonth = GETPOSTINT('search_date_approve_endmonth'); |
| 95 | 95 | $search_date_approve_endyear = GETPOSTINT('search_date_approve_endyear'); |
| 96 | -$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver |
|
| 96 | +$search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver |
|
| 97 | 97 | $search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear); |
| 98 | 98 | |
| 99 | 99 | $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 214 | 214 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 215 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 215 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 216 | 216 | |
| 217 | 217 | $error = 0; |
| 218 | 218 | |
@@ -730,8 +730,8 @@ discard block |
||
| 730 | 730 | } else { |
| 731 | 731 | $db->rollback(); |
| 732 | 732 | $action = 'create'; |
| 733 | - $_GET["origin"] = $_POST["origin"]; // Keep this ? |
|
| 734 | - $_GET["originid"] = $_POST["originid"]; // Keep this ? |
|
| 733 | + $_GET["origin"] = $_POST["origin"]; // Keep this ? |
|
| 734 | + $_GET["originid"] = $_POST["originid"]; // Keep this ? |
|
| 735 | 735 | setEventMessages("Error", null, 'errors'); |
| 736 | 736 | $error++; |
| 737 | 737 | } |
@@ -903,9 +903,9 @@ discard block |
||
| 903 | 903 | if ($search_user > 0) { |
| 904 | 904 | $sql .= " AND EXISTS ("; |
| 905 | 905 | $sql .= " SELECT ec.rowid "; |
| 906 | - $sql .= " FROM " . MAIN_DB_PREFIX . "element_contact as ec"; |
|
| 907 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact"; |
|
| 908 | - $sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = " . ((int) $search_user); |
|
| 906 | + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; |
|
| 907 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON tc.rowid = ec.fk_c_type_contact"; |
|
| 908 | + $sql .= " WHERE ec.element_id = cf.rowid AND ec.fk_socpeople = ".((int) $search_user); |
|
| 909 | 909 | $sql .= " AND tc.element = 'order_supplier' AND tc.source = 'internal'"; |
| 910 | 910 | $sql .= ")"; |
| 911 | 911 | } |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | if ($searchCategoryProductOperator == 0) { |
| 958 | 958 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
| 959 | 959 | } else { |
| 960 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
| 960 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
| 961 | 961 | } |
| 962 | 962 | } |
| 963 | 963 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | |
| 1238 | 1238 | $topicmail = "SendOrderRef"; |
| 1239 | 1239 | $modelmail = "order_supplier_send"; |
| 1240 | - $objecttmp = new CommandeFournisseur($db); // in case $object is not the good object |
|
| 1240 | + $objecttmp = new CommandeFournisseur($db); // in case $object is not the good object |
|
| 1241 | 1241 | $trackid = 'sord'.$object->id; |
| 1242 | 1242 | include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; |
| 1243 | 1243 | |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | |
| 31 | 31 | // If socid provided by ajax company selector |
| 32 | 32 | if (GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha')) { |
| 33 | - $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 34 | - $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 35 | - $_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 33 | + $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 34 | + $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 35 | + $_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); // Keep this ? |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // Security check |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // Load Dolibarr environment |
| 55 | 55 | require '../../main.inc.php'; |
| 56 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 57 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php'; |
|
| 58 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 59 | -require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent_type.class.php'; |
|
| 60 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
| 61 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 62 | -require_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php'; |
|
| 63 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 64 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php'; |
|
| 56 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 57 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; |
|
| 58 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 59 | +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; |
|
| 60 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
| 61 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 62 | +require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; |
|
| 63 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 64 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; |
|
| 65 | 65 | // Init vars |
| 66 | 66 | $backtopage = GETPOST('backtopage', 'alpha'); |
| 67 | 67 | $action = GETPOST('action', 'aZ09'); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | //permissions |
| 87 | 87 | |
| 88 | -$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
| 88 | +$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
| 89 | 89 | |
| 90 | 90 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
| 91 | 91 | $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); |
@@ -117,14 +117,14 @@ discard block |
||
| 117 | 117 | print '<body id="mainbody" class="publicnewmemberform">'; |
| 118 | 118 | |
| 119 | 119 | // Define urllogo |
| 120 | - $urllogo = DOL_URL_ROOT . '/theme/common/login_logo.png'; |
|
| 121 | - |
|
| 122 | - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output . '/logos/thumbs/' . $mysoc->logo_small)) { |
|
| 123 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $mysoc->logo_small); |
|
| 124 | - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output . '/logos/' . $mysoc->logo)) { |
|
| 125 | - $urllogo = DOL_URL_ROOT . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/' . $mysoc->logo); |
|
| 126 | - } elseif (is_readable(DOL_DOCUMENT_ROOT . '/theme/dolibarr_logo.svg')) { |
|
| 127 | - $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.svg'; |
|
| 120 | + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; |
|
| 121 | + |
|
| 122 | + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { |
|
| 123 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); |
|
| 124 | + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { |
|
| 125 | + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); |
|
| 126 | + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { |
|
| 127 | + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | print '<header class="center">'; |
@@ -133,17 +133,17 @@ discard block |
||
| 133 | 133 | if ($urllogo) { |
| 134 | 134 | print '<div class="backgreypublicpayment">'; |
| 135 | 135 | print '<div class="logopublicpayment">'; |
| 136 | - print '<img id="dolpaymentlogo" src="' . $urllogo . '">'; |
|
| 136 | + print '<img id="dolpaymentlogo" src="'.$urllogo.'">'; |
|
| 137 | 137 | print '</div>'; |
| 138 | 138 | if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { |
| 139 | - print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">' . $langs->trans("PoweredBy") . '<br><img class="poweredbyimg" src="' . DOL_URL_ROOT . '/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
| 139 | + print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>'; |
|
| 140 | 140 | } |
| 141 | 141 | print '</div>'; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { |
| 145 | 145 | print '<div class="backimagepublicregistration">'; |
| 146 | - print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION') . '">'; |
|
| 146 | + print '<img id="idEVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION').'">'; |
|
| 147 | 147 | print '</div>'; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | printCommonFooter('public'); |
| 169 | 169 | |
| 170 | 170 | if (!empty($conf->use_javascript_ajax)) { |
| 171 | - print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n"; |
|
| 172 | - print '<script src="' . DOL_URL_ROOT . '/core/js/lib_foot.js.php?lang=' . $langs->defaultlang . (!empty($ext) ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 171 | + print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
|
| 172 | + print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.(!empty($ext) ? '&'.$ext : '').'"></script>'."\n"; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | print "</body>\n"; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code')))); |
| 208 | 208 | if (!$ok) { |
| 209 | 209 | $error++; |
| 210 | - $errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n"; |
|
| 210 | + $errmsg .= $langs->trans("ErrorBadValueForCode")."<br>\n"; |
|
| 211 | 211 | $action = ''; |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -219,19 +219,19 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client; |
| 221 | 221 | |
| 222 | - $societe->address = GETPOST('address', 'alphanohtml'); |
|
| 222 | + $societe->address = GETPOST('address', 'alphanohtml'); |
|
| 223 | 223 | |
| 224 | - $societe->country_id = GETPOSTINT('country_id'); |
|
| 224 | + $societe->country_id = GETPOSTINT('country_id'); |
|
| 225 | 225 | |
| 226 | - $societe->phone = GETPOST('phone', 'alpha'); |
|
| 226 | + $societe->phone = GETPOST('phone', 'alpha'); |
|
| 227 | 227 | |
| 228 | - $societe->fax = GETPOST('fax', 'alpha'); |
|
| 228 | + $societe->fax = GETPOST('fax', 'alpha'); |
|
| 229 | 229 | |
| 230 | - $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
|
| 230 | + $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
|
| 231 | 231 | |
| 232 | - $societe->client = 2 ; // our client is a prospect |
|
| 232 | + $societe->client = 2; // our client is a prospect |
|
| 233 | 233 | |
| 234 | - $societe->code_client = '-1'; |
|
| 234 | + $societe->code_client = '-1'; |
|
| 235 | 235 | |
| 236 | 236 | $societe->name_alias = GETPOST('name_alias', 'alphanohtml'); |
| 237 | 237 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | if (!$error) { |
| 240 | 240 | $result = $societe->create($user); |
| 241 | 241 | if ($result > 0) { |
| 242 | - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; |
|
| 242 | + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; |
|
| 243 | 243 | $objectsoc = $societe; |
| 244 | 244 | |
| 245 | 245 | if (!empty($backtopage)) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $urlback = getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION'); |
| 249 | 249 | // TODO Make replacement of __AMOUNT__, etc... |
| 250 | 250 | } else { |
| 251 | - $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken(); |
|
| 251 | + $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); |
|
| 252 | 252 | } |
| 253 | 253 | } else { |
| 254 | 254 | $error++; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | if (!$error) { |
| 261 | 261 | $db->commit(); |
| 262 | 262 | |
| 263 | - header("Location: " . $urlback); |
|
| 263 | + header("Location: ".$urlback); |
|
| 264 | 264 | exit; |
| 265 | 265 | } else { |
| 266 | 266 | $db->rollback(); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | llxHeaderVierge($langs->trans("ContactUs")); |
| 302 | 302 | |
| 303 | 303 | print '<br>'; |
| 304 | -print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . ' ' . $langs->trans("ContactUs"), '', '', 0, 0, 'center'); |
|
| 304 | +print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').' '.$langs->trans("ContactUs"), '', '', 0, 0, 'center'); |
|
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | print '<div align="center">'; |
@@ -309,9 +309,9 @@ discard block |
||
| 309 | 309 | |
| 310 | 310 | print '<div class="center subscriptionformhelptext opacitymedium justify">'; |
| 311 | 311 | if (getDolGlobalString('COMPANY_NEWFORM_TEXT')) { |
| 312 | - print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT')) . "<br>\n"; |
|
| 312 | + print $langs->trans(getDolGlobalString('COMPANY_NEWFORM_TEXT'))."<br>\n"; |
|
| 313 | 313 | } else { |
| 314 | - print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL")) . "<br>\n"; |
|
| 314 | + print $langs->trans("ContactUsDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n"; |
|
| 315 | 315 | } |
| 316 | 316 | print '</div>'; |
| 317 | 317 | |
@@ -319,13 +319,13 @@ discard block |
||
| 319 | 319 | dol_htmloutput_events(); |
| 320 | 320 | |
| 321 | 321 | // Print form |
| 322 | -print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="newprospect">' . "\n"; |
|
| 323 | -print '<input type="hidden" name="token" value="' . newToken() . '" / >'; |
|
| 324 | -print '<input type="hidden" name="entity" value="' . $entity . '" />'; |
|
| 322 | +print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newprospect">'."\n"; |
|
| 323 | +print '<input type="hidden" name="token" value="'.newToken().'" / >'; |
|
| 324 | +print '<input type="hidden" name="entity" value="'.$entity.'" />'; |
|
| 325 | 325 | print '<input type="hidden" name="action" value="add" />'; |
| 326 | 326 | print '<br>'; |
| 327 | 327 | |
| 328 | -$messagemandatory = '<span class="">' . $langs->trans("FieldsWithAreMandatory", '*') . '</span>'; |
|
| 328 | +$messagemandatory = '<span class="">'.$langs->trans("FieldsWithAreMandatory", '*').'</span>'; |
|
| 329 | 329 | //print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>'; |
| 330 | 330 | //print $langs->trans("FieldsWithIsForPublic",'**').'<br>'; |
| 331 | 331 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | </script>'; |
| 362 | 362 | |
| 363 | 363 | |
| 364 | -print '<table class="border" summary="form to subscribe" id="tablesubscribe">' . "\n"; |
|
| 364 | +print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; |
|
| 365 | 365 | //Third party name |
| 366 | 366 | /* |
| 367 | 367 | if ($objectsoc->particulier || $private) { |
@@ -371,30 +371,30 @@ discard block |
||
| 371 | 371 | } |
| 372 | 372 | */ |
| 373 | 373 | print '<tr class="tr-field-thirdparty-name"><td class="titlefieldcreate">'; // text appreas left |
| 374 | -print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">'; |
|
| 375 | -print '<span id="TypeName" class="fieldrequired" title="' .dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')) . '" >' . $form->editfieldkey('Company', 'name', '', $objectsoc, 0) . '<span class="star"> *</span></span>'; |
|
| 374 | +print '<input type="hidden" name="ThirdPartyName" value="'.$langs->trans('ThirdPartyName').'">'; |
|
| 375 | +print '<span id="TypeName" class="fieldrequired" title="'.dol_escape_htmltag($langs->trans("FieldsWithAreMandatory", '*')).'" >'.$form->editfieldkey('Company', 'name', '', $objectsoc, 0).'<span class="star"> *</span></span>'; |
|
| 376 | 376 | print '</td><td>'; // inline input |
| 377 | -print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="' . dol_escape_htmltag($objectsoc->name) . '" autofocus="autofocus">'; |
|
| 377 | +print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($objectsoc->name).'" autofocus="autofocus">'; |
|
| 378 | 378 | // |
| 379 | 379 | |
| 380 | 380 | // Name and lastname |
| 381 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Firstname") . ' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('firstname')) . '"></td></tr>' . "\n"; |
|
| 381 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Firstname").' <span class="star">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n"; |
|
| 382 | 382 | |
| 383 | -print '<tr><td class="classfortooltip" title="' . dol_escape_htmltag($messagemandatory) . '">' . $langs->trans("Lastname") . ' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="' . dol_escape_htmltag(GETPOST('lastname')) . '"></td></tr>' . "\n"; |
|
| 383 | +print '<tr><td class="classfortooltip" title="'.dol_escape_htmltag($messagemandatory).'">'.$langs->trans("Lastname").' <span class="star">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n"; |
|
| 384 | 384 | |
| 385 | 385 | // Address |
| 386 | 386 | print '<tr><td class="tdtop">'; |
| 387 | 387 | print $form->editfieldkey('Address', 'address', '', $objectsoc, 0); |
| 388 | 388 | print '</td>'; |
| 389 | 389 | print '<td>'; |
| 390 | -print '<textarea name="address" id="address" class="quatrevingtpercent" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 390 | +print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 391 | 391 | print dol_escape_htmltag($objectsoc->address, 0, 1); |
| 392 | 392 | print '</textarea>'; |
| 393 | 393 | print $form->widgetForTranslation("address", $objectsoc, $permissiontoadd, 'textarea', 'alphanohtml', 'quatrevingtpercent'); |
| 394 | 394 | print '</td></tr>'; |
| 395 | 395 | |
| 396 | 396 | // Country |
| 397 | -print '<tr><td>' . $form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0) . '</td><td class="maxwidthonsmartphone">'; |
|
| 397 | +print '<tr><td>'.$form->editfieldkey('Country', 'selectcountry_id', '', $objectsoc, 0).'</td><td class="maxwidthonsmartphone">'; |
|
| 398 | 398 | print img_picto('', 'country', 'class="pictofixedwidth"'); |
| 399 | 399 | print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $objectsoc->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx'); |
| 400 | 400 | if ($user->admin) { |
@@ -403,50 +403,50 @@ discard block |
||
| 403 | 403 | print '</td></tr>'; |
| 404 | 404 | |
| 405 | 405 | // Phone / Fax |
| 406 | -print '<tr><td>' . $form->editfieldkey('Phone', 'phone', '', $objectsoc, 0) . '</td>'; |
|
| 407 | -print '<td>' . img_picto('', 'object_phoning', 'class="pictofixedwidth"') . ' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone) . '"></td>'; |
|
| 406 | +print '<tr><td>'.$form->editfieldkey('Phone', 'phone', '', $objectsoc, 0).'</td>'; |
|
| 407 | +print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" id="phone" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $objectsoc->phone).'"></td>'; |
|
| 408 | 408 | print '</tr>'; |
| 409 | 409 | |
| 410 | 410 | print '<tr>'; |
| 411 | -print '<td>' . $form->editfieldkey('Fax', 'fax', '', $objectsoc, 0) . '</td>'; |
|
| 412 | -print '<td>' . img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"') . ' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax) . '"></td>'; |
|
| 411 | +print '<td>'.$form->editfieldkey('Fax', 'fax', '', $objectsoc, 0).'</td>'; |
|
| 412 | +print '<td>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' <input type="text" name="fax" id="fax" class="maxwidth200 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : $objectsoc->fax).'"></td>'; |
|
| 413 | 413 | print '</tr>'; |
| 414 | 414 | |
| 415 | 415 | // Email / Web |
| 416 | -print '<tr><td>' . $form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY) . '</td>'; |
|
| 417 | -print '<td>' . img_picto('', 'object_email', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="' . $objectsoc->email . '"></td>'; |
|
| 416 | +print '<tr><td>'.$form->editfieldkey('EMail', 'email', '', $objectsoc, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'</td>'; |
|
| 417 | +print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').' <input type="text" class="maxwidth200 widthcentpercentminusx" name="email" id="email" value="'.$objectsoc->email.'"></td>'; |
|
| 418 | 418 | if (isModEnabled('mailing') && getDolGlobalString('THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION')) { |
| 419 | 419 | if ($conf->browser->layout == 'phone') { |
| 420 | 420 | print '</tr><tr>'; |
| 421 | 421 | } |
| 422 | - print '<td class="individualline noemail">' . $form->editfieldkey($langs->trans('No_Email') . ' (' . $langs->trans('Contact') . ')', 'contact_no_email', '', $objectsoc, 0) . '</td>'; |
|
| 423 | - print '<td class="individualline" ' . (($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '') . '>' . $form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1) . '</td>'; |
|
| 422 | + print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $objectsoc, 0).'</td>'; |
|
| 423 | + print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($objectsoc->no_email) ? 0 : 1)), 1, false, 1).'</td>'; |
|
| 424 | 424 | } |
| 425 | 425 | print '</tr>'; |
| 426 | 426 | |
| 427 | -print '<tr><td>' . $form->editfieldkey('Web', 'url', '', $objectsoc, 0) . '</td>'; |
|
| 428 | -print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="' . $objectsoc->url . '"></td></tr>'; |
|
| 427 | +print '<tr><td>'.$form->editfieldkey('Web', 'url', '', $objectsoc, 0).'</td>'; |
|
| 428 | +print '<td>'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$objectsoc->url.'"></td></tr>'; |
|
| 429 | 429 | |
| 430 | 430 | |
| 431 | 431 | // Comments |
| 432 | 432 | print '<tr>'; |
| 433 | -print '<td class="tdtop">' . $langs->trans("Comments") . '</td>'; |
|
| 434 | -print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="' . ROWS_3 . '">' . dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1) . '</textarea></td>'; |
|
| 435 | -print '</tr>' . "\n"; |
|
| 433 | +print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; |
|
| 434 | +print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>'; |
|
| 435 | +print '</tr>'."\n"; |
|
| 436 | 436 | // TODO Move this into generic feature. |
| 437 | 437 | |
| 438 | 438 | |
| 439 | 439 | |
| 440 | 440 | // Display Captcha code if is enabled |
| 441 | 441 | if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) { |
| 442 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php'; |
|
| 443 | - print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">' . $langs->trans("SecurityCode") . '</span></label></td><td>'; |
|
| 442 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; |
|
| 443 | + print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>'; |
|
| 444 | 444 | print '<span class="span-icon-security inline-block">'; |
| 445 | - print '<input id="securitycode" placeholder="' . $langs->trans("SecurityCode") . '" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
| 445 | + print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width150" type="text" maxlength="5" name="code" tabindex="3" />'; |
|
| 446 | 446 | print '</span>'; |
| 447 | 447 | print '<span class="nowrap inline-block">'; |
| 448 | - print '<img class="inline-block valignmiddle" src="' . DOL_URL_ROOT . '/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
| 449 | - print '<a class="inline-block valignmiddle" href="' . $php_self . '" tabindex="4" data-role="button">' . img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"') . '</a>'; |
|
| 448 | + print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />'; |
|
| 449 | + print '<a class="inline-block valignmiddle" href="'.$php_self.'" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>'; |
|
| 450 | 450 | print '</span>'; |
| 451 | 451 | print '</td></tr>'; |
| 452 | 452 | } |
@@ -457,9 +457,9 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | // Save / Submit |
| 459 | 459 | print '<div class="center">'; |
| 460 | -print '<input type="submit" value="' . $langs->trans("Send") . '" id="submitsave" class="button">'; |
|
| 460 | +print '<input type="submit" value="'.$langs->trans("Send").'" id="submitsave" class="button">'; |
|
| 461 | 461 | if (!empty($backtopage)) { |
| 462 | - print ' <input type="submit" value="' . $langs->trans("Cancel") . '" id="submitcancel" class="button button-cancel">'; |
|
| 462 | + print ' <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">'; |
|
| 463 | 463 | } |
| 464 | 464 | print '</div>'; |
| 465 | 465 | |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // Load Dolibarr environment |
| 26 | 26 | require '../../main.inc.php'; |
| 27 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/asset.lib.php'; |
|
| 28 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetmodel.class.php'; |
|
| 29 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; |
|
| 32 | -require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; |
|
| 27 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; |
|
| 28 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetmodel.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php'; |
|
| 32 | +require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php'; |
|
| 33 | 33 | |
| 34 | 34 | // Load translation files required by the page |
| 35 | 35 | $langs->loadLangs(array("assets", "other")); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $assetdepreciationoptions = new AssetDepreciationOptions($db); |
| 50 | 50 | $assetaccountancycodes = new AssetAccountancyCodes($db); |
| 51 | 51 | $extrafields = new ExtraFields($db); |
| 52 | -$diroutputmassaction = $conf->asset->dir_output . '/temp/massgeneration/' . $user->id; |
|
| 52 | +$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id; |
|
| 53 | 53 | $hookmanager->initHooks(array('assetmodelcard', 'globalcard')); // Note that conf->hooks_modules contains array |
| 54 | 54 | |
| 55 | 55 | // Fetch optionals attributes and labels |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | $search_all = GETPOST("search_all", 'alpha'); |
| 62 | 62 | $search = array(); |
| 63 | 63 | foreach ($object->fields as $key => $val) { |
| 64 | - if (GETPOST('search_' . $key, 'alpha')) { |
|
| 65 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 64 | + if (GETPOST('search_'.$key, 'alpha')) { |
|
| 65 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Load object |
| 74 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 74 | +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
| 75 | 75 | |
| 76 | 76 | $permissiontoread = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); |
| 77 | 77 | $permissiontoadd = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | if (empty($reshook)) { |
| 125 | 125 | $error = 0; |
| 126 | 126 | |
| 127 | - $backurlforlist = DOL_URL_ROOT . '/asset/model/list.php'; |
|
| 127 | + $backurlforlist = DOL_URL_ROOT.'/asset/model/list.php'; |
|
| 128 | 128 | |
| 129 | 129 | if (empty($backtopage) || ($cancel && empty($id))) { |
| 130 | 130 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
| 131 | 131 | if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { |
| 132 | 132 | $backtopage = $backurlforlist; |
| 133 | 133 | } else { |
| 134 | - $backtopage = DOL_URL_ROOT . '/asset/model/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 134 | + $backtopage = DOL_URL_ROOT.'/asset/model/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen |
| 150 | - include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php'; |
|
| 150 | + include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
@@ -160,44 +160,44 @@ discard block |
||
| 160 | 160 | $form = new Form($db); |
| 161 | 161 | $formfile = new FormFile($db); |
| 162 | 162 | |
| 163 | -$title = $langs->trans("AssetModel") . ' - ' . $langs->trans("Card"); |
|
| 163 | +$title = $langs->trans("AssetModel").' - '.$langs->trans("Card"); |
|
| 164 | 164 | $help_url = ''; |
| 165 | 165 | llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-model-card'); |
| 166 | 166 | |
| 167 | 167 | // Part to create |
| 168 | 168 | if ($action == 'create') { |
| 169 | - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_' . $object->picto); |
|
| 169 | + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("AssetModel")), '', 'object_'.$object->picto); |
|
| 170 | 170 | |
| 171 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 172 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 171 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 172 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 173 | 173 | print '<input type="hidden" name="action" value="add">'; |
| 174 | 174 | if ($backtopage) { |
| 175 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 175 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 176 | 176 | } |
| 177 | 177 | if ($backtopageforcancel) { |
| 178 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 178 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | print dol_get_fiche_head(array(), ''); |
| 182 | 182 | |
| 183 | 183 | |
| 184 | - print '<table class="border centpercent tableforfieldcreate">' . "\n"; |
|
| 184 | + print '<table class="border centpercent tableforfieldcreate">'."\n"; |
|
| 185 | 185 | |
| 186 | 186 | // Common attributes |
| 187 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; |
|
| 187 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; |
|
| 188 | 188 | |
| 189 | 189 | // Other attributes |
| 190 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
|
| 190 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
|
| 191 | 191 | |
| 192 | 192 | // Depreciation options |
| 193 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/depreciation_options_edit.tpl.php'; |
|
| 193 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/depreciation_options_edit.tpl.php'; |
|
| 194 | 194 | |
| 195 | 195 | // Accountancy codes |
| 196 | 196 | print '<div class="clearboth"></div>'; |
| 197 | 197 | print '<hr>'; |
| 198 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/accountancy_codes_edit.tpl.php'; |
|
| 198 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/accountancy_codes_edit.tpl.php'; |
|
| 199 | 199 | |
| 200 | - print '</table>' . "\n"; |
|
| 200 | + print '</table>'."\n"; |
|
| 201 | 201 | |
| 202 | 202 | print dol_get_fiche_end(); |
| 203 | 203 | |
@@ -210,36 +210,36 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | // Part to edit record |
| 212 | 212 | if (($id || $ref) && $action == 'edit') { |
| 213 | - print load_fiche_titre($langs->trans("AssetModel"), '', 'object_' . $object->picto); |
|
| 213 | + print load_fiche_titre($langs->trans("AssetModel"), '', 'object_'.$object->picto); |
|
| 214 | 214 | |
| 215 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 216 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 215 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 216 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 217 | 217 | print '<input type="hidden" name="action" value="update">'; |
| 218 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 218 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 219 | 219 | if ($backtopage) { |
| 220 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 220 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 221 | 221 | } |
| 222 | 222 | if ($backtopageforcancel) { |
| 223 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 223 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | print dol_get_fiche_head(); |
| 227 | 227 | |
| 228 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 228 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 229 | 229 | |
| 230 | 230 | // Common attributes |
| 231 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 231 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 232 | 232 | |
| 233 | 233 | // Other attributes |
| 234 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
| 234 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
| 235 | 235 | |
| 236 | 236 | // Depreciation options |
| 237 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/depreciation_options_edit.tpl.php'; |
|
| 237 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/depreciation_options_edit.tpl.php'; |
|
| 238 | 238 | |
| 239 | 239 | // Accountancy codes |
| 240 | 240 | print '<div class="clearboth"></div>'; |
| 241 | 241 | print '<hr>'; |
| 242 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/accountancy_codes_edit.tpl.php'; |
|
| 242 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/accountancy_codes_edit.tpl.php'; |
|
| 243 | 243 | |
| 244 | 244 | print '</table>'; |
| 245 | 245 | |
@@ -261,12 +261,12 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | // Confirmation to delete |
| 263 | 263 | if ($action == 'delete') { |
| 264 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 264 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); |
|
| 265 | 265 | } elseif ($action == 'clone') { |
| 266 | 266 | // Clone confirmation |
| 267 | 267 | // Create an array for form |
| 268 | 268 | $formquestion = array(); |
| 269 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 269 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | // Call Hook formConfirm |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | // Object card |
| 286 | 286 | // ------------------------------------------------------------ |
| 287 | - $linkback = '<a href="' . DOL_URL_ROOT . '/asset/model/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; |
|
| 287 | + $linkback = '<a href="'.DOL_URL_ROOT.'/asset/model/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
|
| 288 | 288 | |
| 289 | 289 | $morehtmlref = '<div class="refidno">'; |
| 290 | 290 | $morehtmlref .= '</div>'; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | print '<div class="fichecenter">'; |
| 297 | 297 | print '<div class="underbanner clearboth"></div>'; |
| 298 | - print '<table class="border centpercent tableforfield">' . "\n"; |
|
| 298 | + print '<table class="border centpercent tableforfield">'."\n"; |
|
| 299 | 299 | |
| 300 | 300 | // Common attributes |
| 301 | 301 | $object->fields = dol_sort_array($object->fields, 'position'); |
@@ -381,20 +381,20 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | // Other attributes. Fields from hook formObjectOptions and Extrafields. |
| 384 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
| 384 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
| 385 | 385 | print '</table>'; |
| 386 | 386 | |
| 387 | 387 | // Depreciation options attributes |
| 388 | 388 | print '<div class="fichehalfleft">'; |
| 389 | 389 | print '<table class="border centpercent tableforfield">'; |
| 390 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/depreciation_options_view.tpl.php'; |
|
| 390 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/depreciation_options_view.tpl.php'; |
|
| 391 | 391 | print '</table>'; |
| 392 | 392 | print '</div>'; |
| 393 | 393 | |
| 394 | 394 | // Accountancy codes attributes |
| 395 | 395 | print '<div class="fichehalfright">'; |
| 396 | 396 | print '<table class="border centpercent tableforfield">'; |
| 397 | - include DOL_DOCUMENT_ROOT . '/asset/tpl/accountancy_codes_view.tpl.php'; |
|
| 397 | + include DOL_DOCUMENT_ROOT.'/asset/tpl/accountancy_codes_view.tpl.php'; |
|
| 398 | 398 | print '</table>'; |
| 399 | 399 | print '</div>'; |
| 400 | 400 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | |
| 407 | 407 | // Buttons for actions |
| 408 | 408 | if ($action != 'editline') { |
| 409 | - print '<div class="tabsAction">' . "\n"; |
|
| 409 | + print '<div class="tabsAction">'."\n"; |
|
| 410 | 410 | $parameters = array(); |
| 411 | 411 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 412 | 412 | if ($reshook < 0) { |
@@ -415,16 +415,16 @@ discard block |
||
| 415 | 415 | |
| 416 | 416 | if (empty($reshook)) { |
| 417 | 417 | if ($object->status == $object::STATUS_DRAFT) { |
| 418 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 418 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | // Back to draft |
| 422 | 422 | if ($object->status != $object::STATUS_DRAFT) { |
| 423 | - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=confirm_setdraft&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 423 | + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | if ($object->status != $object::STATUS_VALIDATED) { |
| 427 | - print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=confirm_validate&confirm=yes&token=' . newToken(), '', $permissiontoadd); |
|
| 427 | + print dolGetButtonAction($langs->trans('Enable'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | if ($object->status != $object::STATUS_CANCELED) { |
@@ -432,12 +432,12 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | // Clone |
| 435 | - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd); |
|
| 435 | + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($socid) ? '&socid='.$socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd); |
|
| 436 | 436 | |
| 437 | 437 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 438 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 438 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 439 | 439 | } |
| 440 | - print '</div>' . "\n"; |
|
| 440 | + print '</div>'."\n"; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // General $Variables |
| 83 | -$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 83 | +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility |
|
| 84 | 84 | $ref = GETPOST('ref', 'alpha'); |
| 85 | 85 | $socid = GETPOSTINT('socid'); |
| 86 | 86 | $action = GETPOST('action', 'aZ09'); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | setEventMessages('', $warningMsgLineList, 'warnings'); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); |
|
| 248 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$result); |
|
| 249 | 249 | exit(); |
| 250 | 250 | } else { |
| 251 | 251 | $langs->load("errors"); |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | // Validation |
| 337 | 337 | $object->fetch($id); |
| 338 | 338 | |
| 339 | - if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 339 | + if ((preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 340 | 340 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 341 | 341 | ) { |
| 342 | 342 | $object->date = dol_now(); |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | $error++; |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | - $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1051 | + $dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server |
|
| 1052 | 1052 | $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); |
| 1053 | 1053 | |
| 1054 | 1054 | // Replacement invoice |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1081 | 1081 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1082 | 1082 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1083 | - $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1083 | + $object->model_pdf = GETPOST('model', 'alphanohtml'); |
|
| 1084 | 1084 | $object->fk_project = GETPOSTINT('projectid'); |
| 1085 | 1085 | $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); |
| 1086 | 1086 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
@@ -1141,9 +1141,9 @@ discard block |
||
| 1141 | 1141 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1142 | 1142 | $object->ref_client = GETPOST('ref_client', 'alphanohtml'); |
| 1143 | 1143 | $object->ref_customer = GETPOST('ref_client', 'alphanohtml'); |
| 1144 | - $object->model_pdf = GETPOST('model'); |
|
| 1144 | + $object->model_pdf = GETPOST('model'); |
|
| 1145 | 1145 | $object->fk_project = GETPOSTINT('projectid'); |
| 1146 | - $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1146 | + $object->cond_reglement_id = 0; // No payment term for a credit note |
|
| 1147 | 1147 | $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); |
| 1148 | 1148 | $object->fk_account = GETPOSTINT('fk_account'); |
| 1149 | 1149 | //$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU'); |
@@ -1465,7 +1465,7 @@ discard block |
||
| 1465 | 1465 | $object->note_public = trim(GETPOST('note_public', 'restricthtml')); |
| 1466 | 1466 | $object->note_private = trim(GETPOST('note_private', 'restricthtml')); |
| 1467 | 1467 | $object->ref_client = GETPOST('ref_client'); |
| 1468 | - $object->ref_customer = GETPOST('ref_client'); |
|
| 1468 | + $object->ref_customer = GETPOST('ref_client'); |
|
| 1469 | 1469 | $object->model_pdf = GETPOST('model'); |
| 1470 | 1470 | $object->fk_project = GETPOSTINT('projectid'); |
| 1471 | 1471 | $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); |
@@ -2080,7 +2080,7 @@ discard block |
||
| 2080 | 2080 | } else { |
| 2081 | 2081 | $db->rollback(); |
| 2082 | 2082 | $action = 'create'; |
| 2083 | - $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2083 | + $_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ? |
|
| 2084 | 2084 | $_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ? |
| 2085 | 2085 | setEventMessages($object->error, $object->errors, 'errors'); |
| 2086 | 2086 | } |
@@ -2614,7 +2614,7 @@ discard block |
||
| 2614 | 2614 | // Define special_code for special lines |
| 2615 | 2615 | $special_code = GETPOSTINT('special_code'); |
| 2616 | 2616 | if ($special_code == 3) { |
| 2617 | - $special_code = 0; // Options should not exists on invoices |
|
| 2617 | + $special_code = 0; // Options should not exists on invoices |
|
| 2618 | 2618 | } |
| 2619 | 2619 | |
| 2620 | 2620 | $line = new FactureLigne($db); |
@@ -3227,8 +3227,8 @@ discard block |
||
| 3227 | 3227 | //$remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); |
| 3228 | 3228 | |
| 3229 | 3229 | if (isModEnabled('multicurrency')) { |
| 3230 | - $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3231 | - $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3230 | + $currency_code = (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code)); |
|
| 3231 | + $currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx)); |
|
| 3232 | 3232 | } |
| 3233 | 3233 | |
| 3234 | 3234 | //Replicate extrafields |
@@ -3324,7 +3324,7 @@ discard block |
||
| 3324 | 3324 | print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">'; |
| 3325 | 3325 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
| 3326 | 3326 | print '<input type="hidden" name="action" id="formtocreateaction" value="add">'; |
| 3327 | - print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3327 | + print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change |
|
| 3328 | 3328 | if ($soc->id > 0) { |
| 3329 | 3329 | print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n"; |
| 3330 | 3330 | } |
@@ -4373,7 +4373,7 @@ discard block |
||
| 4373 | 4373 | $nbMandated = 0; |
| 4374 | 4374 | foreach ($object->lines as $line) { |
| 4375 | 4375 | $res = $line->fetch_product(); |
| 4376 | - if ($res > 0) { |
|
| 4376 | + if ($res > 0) { |
|
| 4377 | 4377 | if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) { |
| 4378 | 4378 | $nbMandated++; |
| 4379 | 4379 | break; |
@@ -4576,7 +4576,7 @@ discard block |
||
| 4576 | 4576 | } |
| 4577 | 4577 | // Ref customer |
| 4578 | 4578 | $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string', '', 0, 1); |
| 4579 | - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 4579 | + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, $usercancreate, 'string'.(getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1); |
|
| 4580 | 4580 | // Thirdparty |
| 4581 | 4581 | $morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer'); |
| 4582 | 4582 | if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { |
@@ -5007,45 +5007,45 @@ discard block |
||
| 5007 | 5007 | } |
| 5008 | 5008 | print '<tr>'; |
| 5009 | 5009 | // Amount HT |
| 5010 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>'; |
|
| 5011 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5010 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>'; |
|
| 5011 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5012 | 5012 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5013 | 5013 | // Multicurrency Amount HT |
| 5014 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5014 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5015 | 5015 | } |
| 5016 | 5016 | print '</tr>'; |
| 5017 | 5017 | |
| 5018 | 5018 | print '<tr>'; |
| 5019 | 5019 | // Amount VAT |
| 5020 | - print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>'; |
|
| 5021 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5020 | + print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>'; |
|
| 5021 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5022 | 5022 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5023 | 5023 | // Multicurrency Amount VAT |
| 5024 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5024 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5025 | 5025 | } |
| 5026 | 5026 | print '</tr>'; |
| 5027 | 5027 | |
| 5028 | 5028 | // Amount Local Taxes |
| 5029 | 5029 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { |
| 5030 | 5030 | print '<tr>'; |
| 5031 | - print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
| 5032 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5031 | + print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
| 5032 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5033 | 5033 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5034 | 5034 | $object->multicurrency_total_localtax1 = (float) price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT'); |
| 5035 | 5035 | |
| 5036 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5036 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5037 | 5037 | } |
| 5038 | 5038 | print '</tr>'; |
| 5039 | 5039 | } |
| 5040 | 5040 | |
| 5041 | 5041 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { |
| 5042 | 5042 | print '<tr>'; |
| 5043 | - print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
| 5044 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5043 | + print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
| 5044 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5045 | 5045 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5046 | 5046 | $object->multicurrency_total_localtax2 = (float) price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT'); |
| 5047 | 5047 | |
| 5048 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5048 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5049 | 5049 | } |
| 5050 | 5050 | print '</tr>'; |
| 5051 | 5051 | } |
@@ -5105,11 +5105,11 @@ discard block |
||
| 5105 | 5105 | |
| 5106 | 5106 | print '<tr>'; |
| 5107 | 5107 | // Amount TTC |
| 5108 | - print '<td>' . $langs->trans('AmountTTC') . '</td>'; |
|
| 5109 | - print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>'; |
|
| 5108 | + print '<td>'.$langs->trans('AmountTTC').'</td>'; |
|
| 5109 | + print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>'; |
|
| 5110 | 5110 | if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { |
| 5111 | 5111 | // Multicurrency Amount TTC |
| 5112 | - print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>'; |
|
| 5112 | + print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>'; |
|
| 5113 | 5113 | } |
| 5114 | 5114 | print '</tr>'; |
| 5115 | 5115 | |
@@ -5768,7 +5768,7 @@ discard block |
||
| 5768 | 5768 | $langs->load("contracts"); |
| 5769 | 5769 | |
| 5770 | 5770 | if ($usercancreatecontract) { |
| 5771 | - print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>'; |
|
| 5771 | + print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>'; |
|
| 5772 | 5772 | } |
| 5773 | 5773 | } |
| 5774 | 5774 | } |
@@ -5992,7 +5992,7 @@ discard block |
||
| 5992 | 5992 | if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) |
| 5993 | 5993 | $enableDelete = false; |
| 5994 | 5994 | $deleteHref = '#'; |
| 5995 | - if ($isErasable > 0 && ! $objectidnext) { |
|
| 5995 | + if ($isErasable > 0 && !$objectidnext) { |
|
| 5996 | 5996 | $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); |
| 5997 | 5997 | $enableDelete = true; |
| 5998 | 5998 | } |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $this->mode_reglement_id = 0; |
| 470 | 470 | } |
| 471 | 471 | $this->status = self::STATUS_DRAFT; |
| 472 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 472 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 473 | 473 | |
| 474 | 474 | if (!empty($this->multicurrency_code)) { |
| 475 | 475 | // Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate) |
@@ -525,8 +525,8 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | // Define some dates |
| 527 | 527 | $originaldatewhen = $_facrec->date_when; |
| 528 | - $nextdatewhen = null; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 529 | - $previousdaynextdatewhen = null; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 528 | + $nextdatewhen = null; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 529 | + $previousdaynextdatewhen = null; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
| 530 | 530 | if ($originaldatewhen) { |
| 531 | 531 | $nextdatewhen = dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency); |
| 532 | 532 | $previousdaynextdatewhen = dol_time_plus_duree($nextdatewhen, -1, 'd'); |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | if (!empty($_facrec->frequency)) { // Invoice are created on same thirdparty than template when there is a recurrence, but not necessarily when there is no recurrence. |
| 536 | 536 | $this->socid = $_facrec->socid; |
| 537 | 537 | } |
| 538 | - $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
| 538 | + $this->entity = $_facrec->entity; // Invoice created in same entity than template |
|
| 539 | 539 | |
| 540 | 540 | // Fields coming from GUI. |
| 541 | 541 | // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $this->mode_reglement_id = 0; |
| 575 | 575 | } |
| 576 | 576 | $this->status = self::STATUS_DRAFT; |
| 577 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 577 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 578 | 578 | |
| 579 | 579 | $this->linked_objects = $_facrec->linkedObjectsIds; |
| 580 | 580 | // We do not add link to template invoice or next invoice will be linked to all generated invoices |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | |
| 819 | 819 | // Complete vat rate with code |
| 820 | 820 | $vatrate = $newinvoiceline->tva_tx; |
| 821 | - if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', (string) $vatrate)) { |
|
| 821 | + if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', (string) $vatrate)) { |
|
| 822 | 822 | $vatrate .= ' ('.$newinvoiceline->vat_src_code.')'; |
| 823 | 823 | } |
| 824 | 824 | |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | $buyprice, |
| 1051 | 1051 | $_facrec->lines[$i]->label, |
| 1052 | 1052 | empty($_facrec->lines[$i]->array_options) ? null : $_facrec->lines[$i]->array_options, |
| 1053 | - 100, // situation percent is undefined on recurring invoice lines |
|
| 1053 | + 100, // situation percent is undefined on recurring invoice lines |
|
| 1054 | 1054 | '', |
| 1055 | 1055 | $_facrec->lines[$i]->fk_unit, |
| 1056 | 1056 | $_facrec->lines[$i]->multicurrency_subprice, |
@@ -1144,7 +1144,7 @@ discard block |
||
| 1144 | 1144 | |
| 1145 | 1145 | $facture->fk_facture_source = $this->fk_facture_source; |
| 1146 | 1146 | $facture->type = $this->type; |
| 1147 | - $facture->subtype = $this->subtype; |
|
| 1147 | + $facture->subtype = $this->subtype; |
|
| 1148 | 1148 | $facture->socid = $this->socid; |
| 1149 | 1149 | $facture->date = $this->date; |
| 1150 | 1150 | $facture->date_pointoftax = $this->date_pointoftax; |
@@ -1161,7 +1161,7 @@ discard block |
||
| 1161 | 1161 | |
| 1162 | 1162 | $facture->origin = $this->origin; |
| 1163 | 1163 | $facture->origin_id = $this->origin_id; |
| 1164 | - $facture->fk_account = $this->fk_account; |
|
| 1164 | + $facture->fk_account = $this->fk_account; |
|
| 1165 | 1165 | |
| 1166 | 1166 | $facture->lines = $this->lines; // Array of lines of invoice |
| 1167 | 1167 | $facture->situation_counter = $this->situation_counter; |
@@ -1633,7 +1633,7 @@ discard block |
||
| 1633 | 1633 | { |
| 1634 | 1634 | global $conf, $langs, $hookmanager, $action; |
| 1635 | 1635 | |
| 1636 | - if (! in_array($origin->element, array('propal', 'commande'))) { |
|
| 1636 | + if (!in_array($origin->element, array('propal', 'commande'))) { |
|
| 1637 | 1637 | $origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder'; |
| 1638 | 1638 | return null; |
| 1639 | 1639 | } |
@@ -1643,7 +1643,7 @@ discard block |
||
| 1643 | 1643 | return null; |
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 1646 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 1647 | 1647 | |
| 1648 | 1648 | if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { |
| 1649 | 1649 | $origin->error = 'ErrorDateIsInFuture'; |
@@ -1687,7 +1687,7 @@ discard block |
||
| 1687 | 1687 | $deposit->pos_source = $origin->pos_source; |
| 1688 | 1688 | $deposit->model_pdf = 'crabe'; |
| 1689 | 1689 | |
| 1690 | - $modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type; |
|
| 1690 | + $modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type; |
|
| 1691 | 1691 | |
| 1692 | 1692 | if (getDolGlobalString($modelByTypeConfName)) { |
| 1693 | 1693 | $deposit->model_pdf = getDolGlobalString($modelByTypeConfName); |
@@ -1742,10 +1742,10 @@ discard block |
||
| 1742 | 1742 | continue; |
| 1743 | 1743 | } |
| 1744 | 1744 | $TTotalByTva[$line->tva_tx] += $line->total_ttc; |
| 1745 | - $descriptions[$line->tva_tx] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); |
|
| 1746 | - $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); |
|
| 1747 | - $descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty; |
|
| 1748 | - $descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>'; |
|
| 1745 | + $descriptions[$line->tva_tx] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : ''); |
|
| 1746 | + $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label.' - ' : ''); |
|
| 1747 | + $descriptions[$line->tva_tx] .= $langs->trans('Qty').' : '.$line->qty; |
|
| 1748 | + $descriptions[$line->tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>'; |
|
| 1749 | 1749 | } |
| 1750 | 1750 | |
| 1751 | 1751 | foreach ($TTotalByTva as $tva => &$total) { |
@@ -1769,10 +1769,10 @@ discard block |
||
| 1769 | 1769 | $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? |
| 1770 | 1770 | $tva_tx = $lines[$i]->tva_tx; |
| 1771 | 1771 | $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100; |
| 1772 | - $descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); |
|
| 1773 | - $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); |
|
| 1774 | - $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; |
|
| 1775 | - $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>'; |
|
| 1772 | + $descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : ''); |
|
| 1773 | + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : ''); |
|
| 1774 | + $descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty; |
|
| 1775 | + $descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>'; |
|
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | if ($totalamount == 0) { |
@@ -1787,11 +1787,11 @@ discard block |
||
| 1787 | 1787 | continue; |
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | - $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; |
|
| 1790 | + $descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref; |
|
| 1791 | 1791 | |
| 1792 | 1792 | // Hidden conf |
| 1793 | 1793 | if (getDolGlobalString('INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION') && !empty($descriptions[$tva])) { |
| 1794 | - $descline .= '<ul>' . $descriptions[$tva] . '</ul>'; |
|
| 1794 | + $descline .= '<ul>'.$descriptions[$tva].'</ul>'; |
|
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | 1797 | $addlineResult = $deposit->addline( |
@@ -2164,9 +2164,9 @@ discard block |
||
| 2164 | 2164 | $this->id = $obj->rowid; |
| 2165 | 2165 | $this->entity = $obj->entity; |
| 2166 | 2166 | |
| 2167 | - $this->ref = $obj->ref; |
|
| 2168 | - $this->ref_client = $obj->ref_client; |
|
| 2169 | - $this->ref_customer = $obj->ref_client; |
|
| 2167 | + $this->ref = $obj->ref; |
|
| 2168 | + $this->ref_client = $obj->ref_client; |
|
| 2169 | + $this->ref_customer = $obj->ref_client; |
|
| 2170 | 2170 | $this->ref_ext = $obj->ref_ext; |
| 2171 | 2171 | $this->type = $obj->type; |
| 2172 | 2172 | $this->subtype = $obj->subtype; |
@@ -2192,7 +2192,7 @@ discard block |
||
| 2192 | 2192 | $this->fk_project = $obj->fk_project; |
| 2193 | 2193 | $this->project = null; // Clear if another value was already set by fetch_projet |
| 2194 | 2194 | |
| 2195 | - $this->statut = $obj->status; // deprecated |
|
| 2195 | + $this->statut = $obj->status; // deprecated |
|
| 2196 | 2196 | $this->status = $obj->status; |
| 2197 | 2197 | |
| 2198 | 2198 | $this->date_lim_reglement = $this->db->jdate($obj->dlr); |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | $this->fk_fac_rec_source = $obj->fk_fac_rec_source; |
| 2209 | 2209 | $this->note = $obj->note_private; // deprecated |
| 2210 | 2210 | $this->note_private = $obj->note_private; |
| 2211 | - $this->note_public = $obj->note_public; |
|
| 2211 | + $this->note_public = $obj->note_public; |
|
| 2212 | 2212 | $this->user_creation_id = $obj->fk_user_author; |
| 2213 | 2213 | $this->user_validation_id = $obj->fk_user_valid; |
| 2214 | 2214 | $this->user_modification_id = $obj->fk_user_modif; |
@@ -2322,7 +2322,7 @@ discard block |
||
| 2322 | 2322 | $line->ref = $objp->product_ref; // Ref product |
| 2323 | 2323 | $line->product_ref = $objp->product_ref; // Ref product |
| 2324 | 2324 | $line->libelle = $objp->product_label; // deprecated |
| 2325 | - $line->product_label = $objp->product_label; // Label product |
|
| 2325 | + $line->product_label = $objp->product_label; // Label product |
|
| 2326 | 2326 | $line->product_barcode = $objp->product_barcode; // Barcode number product |
| 2327 | 2327 | $line->product_desc = $objp->product_desc; // Description product |
| 2328 | 2328 | $line->fk_product_type = $objp->fk_product_type; // Type of product |
@@ -3195,10 +3195,10 @@ discard block |
||
| 3195 | 3195 | if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'creer')) |
| 3196 | 3196 | || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('facture', 'invoice_advance', 'validate'))) { |
| 3197 | 3197 | $this->error = 'Permission denied'; |
| 3198 | - dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
| 3198 | + dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR); |
|
| 3199 | 3199 | return -1; |
| 3200 | 3200 | } |
| 3201 | - if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 3201 | + if ((preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) && // empty should not happened, but when it occurs, the test save life |
|
| 3202 | 3202 | getDolGlobalString('FAC_FORCE_DATE_VALIDATION') // If option enabled, we force invoice date |
| 3203 | 3203 | ) { |
| 3204 | 3204 | $this->date = dol_now(); |
@@ -3552,7 +3552,7 @@ discard block |
||
| 3552 | 3552 | // Set new ref and define current status |
| 3553 | 3553 | if (!$error) { |
| 3554 | 3554 | $this->ref = $num; |
| 3555 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 3555 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 3556 | 3556 | $this->status = self::STATUS_VALIDATED; |
| 3557 | 3557 | $this->date_validation = $now; |
| 3558 | 3558 | $i = 0; |
@@ -3697,7 +3697,7 @@ discard block |
||
| 3697 | 3697 | |
| 3698 | 3698 | if ($error == 0) { |
| 3699 | 3699 | $old_statut = $this->status; |
| 3700 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 3700 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 3701 | 3701 | $this->status = self::STATUS_DRAFT; |
| 3702 | 3702 | |
| 3703 | 3703 | // Call trigger |
@@ -4594,7 +4594,7 @@ discard block |
||
| 4594 | 4594 | } |
| 4595 | 4595 | |
| 4596 | 4596 | if (!empty($addon)) { |
| 4597 | - dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
| 4597 | + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG); |
|
| 4598 | 4598 | |
| 4599 | 4599 | $mybool = false; |
| 4600 | 4600 | |
@@ -5669,14 +5669,14 @@ discard block |
||
| 5669 | 5669 | if (!empty($paymentmode) && $paymentmode != 'all') { |
| 5670 | 5670 | $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; |
| 5671 | 5671 | } |
| 5672 | - $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
| 5673 | - $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
| 5672 | + $sql .= " WHERE f.paye = 0"; // Only unpaid |
|
| 5673 | + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status |
|
| 5674 | 5674 | if ($datetouse == 'invoicedate') { |
| 5675 | 5675 | $sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'"; |
| 5676 | 5676 | } else { |
| 5677 | 5677 | $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; |
| 5678 | 5678 | } |
| 5679 | - $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
| 5679 | + $sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing) |
|
| 5680 | 5680 | if (!empty($paymentmode) && $paymentmode != 'all') { |
| 5681 | 5681 | $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; |
| 5682 | 5682 | } |
@@ -5894,7 +5894,7 @@ discard block |
||
| 5894 | 5894 | $actioncomm->create($user); |
| 5895 | 5895 | } |
| 5896 | 5896 | |
| 5897 | - $this->db->commit(); // We always commit |
|
| 5897 | + $this->db->commit(); // We always commit |
|
| 5898 | 5898 | } |
| 5899 | 5899 | |
| 5900 | 5900 | if ($errormesg) { |
@@ -5936,7 +5936,7 @@ discard block |
||
| 5936 | 5936 | // get date of last validated invoices of same type |
| 5937 | 5937 | $sql = "SELECT datef"; |
| 5938 | 5938 | $sql .= " FROM ".MAIN_DB_PREFIX."facture"; |
| 5939 | - $sql .= " WHERE type = " . (int) $this->type ; |
|
| 5939 | + $sql .= " WHERE type = ".(int) $this->type; |
|
| 5940 | 5940 | $sql .= " AND date_valid IS NOT NULL"; |
| 5941 | 5941 | $sql .= " AND entity IN (".getEntity('invoice').")"; |
| 5942 | 5942 | $sql .= " ORDER BY datef DESC LIMIT 1"; |
@@ -6132,7 +6132,7 @@ discard block |
||
| 6132 | 6132 | $objp = $this->db->fetch_object($result); |
| 6133 | 6133 | |
| 6134 | 6134 | if (!$objp) { |
| 6135 | - $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; |
|
| 6135 | + $this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql; |
|
| 6136 | 6136 | return 0; |
| 6137 | 6137 | } |
| 6138 | 6138 | |
@@ -6163,7 +6163,7 @@ discard block |
||
| 6163 | 6163 | $this->total_localtax1 = $objp->total_localtax1; |
| 6164 | 6164 | $this->total_localtax2 = $objp->total_localtax2; |
| 6165 | 6165 | $this->total_ttc = $objp->total_ttc; |
| 6166 | - $this->fk_code_ventilation = $objp->fk_code_ventilation; |
|
| 6166 | + $this->fk_code_ventilation = $objp->fk_code_ventilation; |
|
| 6167 | 6167 | $this->rang = $objp->rang; |
| 6168 | 6168 | $this->fk_fournprice = $objp->fk_fournprice; |
| 6169 | 6169 | $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); |
@@ -6554,7 +6554,7 @@ discard block |
||
| 6554 | 6554 | $sql .= ", date_end=".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null"); |
| 6555 | 6555 | $sql .= ", product_type=".$this->product_type; |
| 6556 | 6556 | $sql .= ", info_bits='".$this->db->escape($this->info_bits)."'"; |
| 6557 | - $sql .= ", special_code=" . (int) $this->special_code; |
|
| 6557 | + $sql .= ", special_code=".(int) $this->special_code; |
|
| 6558 | 6558 | if (empty($this->skip_update_total)) { |
| 6559 | 6559 | $sql .= ", total_ht=".price2num($this->total_ht); |
| 6560 | 6560 | $sql .= ", total_tva=".price2num($this->total_tva); |