diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 1bbd13d9022..e6bcc7ad12e 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -8,6 +8,8 @@ $finder = (new PhpCsFixer\Finder()) 'custom', 'documents', 'doctemplates', + 'vendor', + 'install/doctemplates', 'htdocs/custom', 'htdocs/includes', 'htdocs/install/doctemplates', diff --git a/dev/tools/php-cs-fixer/run-php-cs-fixer.sh b/dev/tools/php-cs-fixer/run-php-cs-fixer.sh index b62befcf011..d8c9d4ae6bb 100755 --- a/dev/tools/php-cs-fixer/run-php-cs-fixer.sh +++ b/dev/tools/php-cs-fixer/run-php-cs-fixer.sh @@ -36,7 +36,7 @@ MINPHPVERSION="7.0" echo "***** run-php-cs-fixer.sh *****" if [ "x$1" = "x" ]; then - echo "Syntax: run-php-cs-fixer.sh check|fix [path]" + echo "Syntax: run-php-cs-fixer.sh check|fix [path_from_root_project]" exit 1; fi diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 55ee3bbd697..f28198d94b1 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -82,7 +82,7 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->hasRight(' if ($forcelangprod == $current_lang) { $object->label = GETPOST("libelle", 'alphanohtml'); $object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); - //$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); + //$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); } else { $object->multilangs[$forcelangprod]["label"] = GETPOST("libelle", 'alphanohtml'); $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index a6ff78a0ba0..1f5ce168fa5 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -560,7 +560,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtml .= '
'.imap_last_error(); } dol_syslog("Error ".$morehtml, LOG_WARNING); - //var_dump(imap_errors()) + //var_dump(imap_errors()) } else { dol_syslog("Imap connected. Now we call imap_num_msg()"); $morehtml .= imap_num_msg($connection); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 78fed9249ea..cf8c1ef77aa 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -918,7 +918,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $urlpage = $page; if ($i++) { $codetoconfig .= ''.img_picto(ucfirst($page), "setup").''; - // print ''.ucfirst($page).' '; + // print ''.ucfirst($page).' '; } else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 5afd1ce8c85..39f0d3c0108 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -132,7 +132,7 @@ if ($action == 'add_currency') { if (GETPOSTISSET('modify_apilayer')) { dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha')); dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha')); - //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); + //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); } else { $multiurrency = new MultiCurrency($db); $result = $multiurrency->syncRates(getDolGlobalString('MULTICURRENCY_APP_ID')); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 78765aae04e..741633bf678 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -137,7 +137,7 @@ if ($action == 'setfixednotif' && $user->admin) { $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount')); $newval = GETPOST($shortkey.'_key'); - //print $newkey.' - '.$newval.'
'; + //print $newkey.' - '.$newval.'
'; } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) { // Add a new entry $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount')); @@ -304,7 +304,7 @@ foreach ($listofnotifiedevents as $notifiedevent) { $model = 'expensereport_send'; } elseif ($notifiedevent['elementtype'] == 'order_supplier') { $model = 'order_supplier_send'; - // } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send'; + // } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send'; } elseif ($notifiedevent['elementtype'] == 'member') { $model = 'member'; } diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index e45d581c35f..58a94b273bb 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -313,7 +313,7 @@ print '
'; print '$dolibarr_main_restrict_ip: '; if (empty($dolibarr_main_restrict_ip)) { print ''.$langs->trans("None").''; - //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; +//print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; } else { print $dolibarr_main_restrict_ip; } @@ -332,7 +332,7 @@ if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) { print '$dolibarr_main_db_pass: '; if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").'     ('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')'; - //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; + //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; } else { print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated"); } @@ -350,7 +350,7 @@ print ' -> PHP streams allowed = '; $arrayofstreams = stream_get_wrappers(); if (!empty($arrayofstreams)) { sort($arrayofstreams); - print (join(',', $arrayofstreams)).'     ('.$langs->trans("Recommended").': '.$langs->trans("TryToKeepOnly", 'file,http,https,php').')'."\n"; + print(join(',', $arrayofstreams)).'     ('.$langs->trans("Recommended").': '.$langs->trans("TryToKeepOnly", 'file,http,https,php').')'."\n"; } print '
'; diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 9789527d024..1165e66d7e3 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -144,76 +144,76 @@ if (in_array($type, array('mysql', 'mysqli'))) { print '
'; // Parameteres execution $command = $db->getPathOfRestore(); - if (preg_match("/\s/", $command)) { - $command = $command = escapeshellarg($command); // Use quotes on command - } + if (preg_match("/\s/", $command)) { + $command = $command = escapeshellarg($command); // Use quotes on command + } $param = $dolibarr_main_db_name; $param .= " -h ".$dolibarr_main_db_host; - if (!empty($dolibarr_main_db_port)) { - $param .= " -P ".$dolibarr_main_db_port; - } + if (!empty($dolibarr_main_db_port)) { + $param .= " -P ".$dolibarr_main_db_port; + } $param .= " -u ".$dolibarr_main_db_user; $paramcrypted = $param; $paramclear = $param; - if (!empty($dolibarr_main_db_pass)) { - $paramcrypted .= " -p".preg_replace('/./i', '*', $dolibarr_main_db_pass); - $paramclear .= " -p".$dolibarr_main_db_pass; - } + if (!empty($dolibarr_main_db_pass)) { + $paramcrypted .= " -p".preg_replace('/./i', '*', $dolibarr_main_db_pass); + $paramclear .= " -p".$dolibarr_main_db_pass; + } echo $langs->trans("ImportMySqlDesc"); print '
'; print '
'; print ajax_autoselect('restorecommand'); - if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) { - print '
'.$langs->trans("UnHidePassword").''; - } + if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) { + print '
'.$langs->trans("UnHidePassword").''; + } //else print '
'.$langs->trans("HidePassword").''; print '
'; print ''; -} elseif (in_array($type, array('pgsql'))) { - print '
'; - print 'Restore PostgreSQL'; - print '
'; - // Parameteres execution - $command = $db->getPathOfRestore(); - if (preg_match("/\s/", $command)) { - $command = $command = escapeshellarg($command); // Use quotes on command + } elseif (in_array($type, array('pgsql'))) { + print '
'; + print 'Restore PostgreSQL'; + print '
'; + // Parameteres execution + $command = $db->getPathOfRestore(); + if (preg_match("/\s/", $command)) { + $command = $command = escapeshellarg($command); // Use quotes on command + } + + $param = " -d ".$dolibarr_main_db_name; + $param .= " -h ".$dolibarr_main_db_host; + if (!empty($dolibarr_main_db_port)) { + $param .= " -p ".$dolibarr_main_db_port; + } + $param .= " -U ".$dolibarr_main_db_user; + $paramcrypted = $param; + $paramclear = $param; + /*if (!empty($dolibarr_main_db_pass)) + { + $paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass); + $paramclear.=" -p".$dolibarr_main_db_pass; + }*/ + $paramcrypted .= " -W"; + $paramclear .= " -W"; + // With psql: + $paramcrypted .= " -f"; + $paramclear .= " -f"; + + echo $langs->trans("ImportPostgreSqlDesc"); + print '
'; + print '
'; + print ajax_autoselect('restorecommand'); + //if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
'.$langs->trans("UnHidePassword").''; + //else print '
'.$langs->trans("HidePassword").''; + print '
'; + + print '
'; + + print '
'; } - $param = " -d ".$dolibarr_main_db_name; - $param .= " -h ".$dolibarr_main_db_host; - if (!empty($dolibarr_main_db_port)) { - $param .= " -p ".$dolibarr_main_db_port; - } - $param .= " -U ".$dolibarr_main_db_user; - $paramcrypted = $param; - $paramclear = $param; - /*if (!empty($dolibarr_main_db_pass)) - { - $paramcrypted.=" -p".preg_replace('/./i','*',$dolibarr_main_db_pass); - $paramclear.=" -p".$dolibarr_main_db_pass; - }*/ - $paramcrypted .= " -W"; - $paramclear .= " -W"; - // With psql: - $paramcrypted .= " -f"; - $paramclear .= " -f"; - - echo $langs->trans("ImportPostgreSqlDesc"); - print '
'; - print '
'; - print ajax_autoselect('restorecommand'); - //if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
'.$langs->trans("UnHidePassword").''; - //else print '
'.$langs->trans("HidePassword").''; - print '
'; - - print '
'; - - print '
'; -} - print ''; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index a5f571fec0b..a84a6dd7b3e 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -131,7 +131,7 @@ if (!function_exists("session_id")) { if (!extension_loaded("mbstring")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "MBString")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "MBString")."
\n"; } @@ -140,7 +140,7 @@ if (!extension_loaded("mbstring")) { if (!extension_loaded("json")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "JSON")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "JSON")."
\n"; } @@ -149,7 +149,7 @@ if (!extension_loaded("json")) { if (!function_exists("imagecreate")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "GD")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; } @@ -158,7 +158,7 @@ if (!function_exists("imagecreate")) { if (!function_exists("curl_init")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Curl")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; } @@ -174,7 +174,7 @@ if (!function_exists("easter_date")) { if (!function_exists("simplexml_load_string")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Xml")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "Xml")."
\n"; } @@ -183,7 +183,7 @@ if (!function_exists("simplexml_load_string")) { if (!function_exists("utf8_encode")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "UTF8")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; } @@ -193,7 +193,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc if (!function_exists("locale_get_primary_language") || !function_exists("locale_get_region")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Intl")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; } @@ -203,7 +203,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc if (!function_exists("imap_open")) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "IMAP")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "IMAP")."
\n"; } @@ -212,7 +212,7 @@ if (!function_exists("imap_open")) { if (!class_exists('ZipArchive')) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "ZIP")."
\n"; } diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 5a2dcbc0c77..58d3d1d21f2 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -130,7 +130,7 @@ if (!empty($force_install_message)) { +} ?>"> @@ -244,11 +244,11 @@ if (!empty($force_install_noedit)) { id="main_force_https" name="main_force_https" + print ' checked'; + } ?> + print ' disabled'; + } ?> > @@ -388,8 +388,8 @@ if (!empty($force_install_noedit)) { @@ -407,8 +407,8 @@ if (!empty($force_install_noedit)) { name="db_host" value="" + print ' disabled'; + } ?> > @@ -502,7 +502,7 @@ if (!empty($force_install_noedit)) { ?>" + } ?> > @@ -552,8 +552,8 @@ if (!empty($force_install_noedit)) { class="needroot" value="" 0 && !empty($force_install_databaserootlogin)) { - print ' disabled'; - } ?> + print ' disabled'; + } ?> > '; - //} elseif ($key == 'propvalidate') { + //} elseif ($key == 'propvalidate') { // print ''; } elseif ($key == 'propvisible') { print ''; @@ -4933,18 +4933,18 @@ if ($module == 'initmodule') { }); '; - /*print '
'; - print '
'; - print '
'; - print ''.$langs->trans("or").''; - print '
'; - print '
'; - //print ' '; - print $langs->trans("InitStructureFromExistingTable"); - print ''; - print ''; - print '
'; - */ + /*print '
'; + print '
'; + print '
'; + print ''.$langs->trans("or").''; + print '
'; + print '
'; + //print ' '; + print $langs->trans("InitStructureFromExistingTable"); + print ''; + print ''; + print '
'; + */ } elseif ($tabdic == 'deletedictionary') { // Delete dic tab print ''; @@ -5394,7 +5394,7 @@ if ($module == 'initmodule') { }); '; - // display permissions for each object + // display permissions for each object } else { $fullpathoffile = dol_buildpath($file, 0); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 4d9f5a2529d..c4b931c5b15 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1767,7 +1767,7 @@ class Mo extends CommonObject $productstatic->fetch($line->fk_product); $productstatic->load_virtual_stock(); $this->tpl['label'] .= $productstatic->getNomUrl(1); - //$this->tpl['label'].= ' - '.$productstatic->label; + //$this->tpl['label'].= ' - '.$productstatic->label; } else { // If origin MRP line is not a product, but another MRP // TODO diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index ec786f6ce6b..677da44ef65 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -556,7 +556,7 @@ function hash_call($methodName, $nvpStr) $_SESSION['curl_error_no'] = curl_errno($ch); $_SESSION['curl_error_msg'] = curl_error($ch); - //Execute the Error handling module to display errors. + //Execute the Error handling module to display errors. } else { //closing the curl curl_close($ch); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bbec24b64de..269a5298986 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2304,7 +2304,7 @@ class Product extends CommonObject $price_min = price2num($newminprice, 'MU'); $price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100)); $price_min_ttc = price2num($price_min_ttc, 'MU'); - //print 'X'.$newminprice.'-'.$price_min; + //print 'X'.$newminprice.'-'.$price_min; } else { $price_min = 0; $price_min_ttc = 0; @@ -2688,7 +2688,7 @@ class Product extends CommonObject $this->multiprices_tva_tx[$i] = $result ? $result["tva_tx"].($result ? ' ('.$result['default_vat_code'].')' : '') : null; $this->multiprices_recuperableonly[$i] = $result ? $result["recuperableonly"] : null; - // Price by quantity + // Price by quantity /* $this->prices_by_qty[$i]=$result["price_by_qty"]; $this->prices_by_qty_id[$i]=$result["rowid"]; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 255582e62c3..0ccfe522a77 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -199,7 +199,7 @@ class ProductCustomerPrice extends CommonObject $this->price_min = price2num($this->price_min, 'MU'); $this->price_min_ttc = price2num($this->price_min) * (1 + ($this->tva_tx / 100)); $this->price_min_ttc = price2num($this->price_min_ttc, 'MU'); - // print 'X'.$newminprice.'-'.$price_min; + // print 'X'.$newminprice.'-'.$price_min; } else { $this->price_min = 0; $this->price_min_ttc = 0; @@ -677,7 +677,7 @@ class ProductCustomerPrice extends CommonObject $this->price_min = price2num($this->price_min, 'MU'); $this->price_min_ttc = price2num($this->price_min) * (1 + ($this->tva_tx / 100)); $this->price_min_ttc = price2num($this->price_min_ttc, 'MU'); - // print 'X'.$newminprice.'-'.$price_min; + // print 'X'.$newminprice.'-'.$price_min; } else { $this->price_min = 0; $this->price_min_ttc = 0; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 5a49139386b..f63fb0d5368 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -247,7 +247,7 @@ if ($action == 'createmovements' && $user->hasRight('stock', 'mouvement', 'creer $firstrecord = array_shift($arraybatchinfo); $dlc = $firstrecord['eatby']; $dluo = $firstrecord['sellby']; - //var_dump($batch); + //var_dump($batch); //var_dump($arraybatchinfo); //var_dump($firstrecord); //var_dump($dlc); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c5792768256..09fed415998 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -1356,15 +1356,15 @@ if (!$variants || getDolGlobalString('VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PA fetchByFkCombination($currcomb->id); - $iMax = count($productCombination2ValuePairs); + $iMax = count($productCombination2ValuePairs); - for ($i = 0; $i < $iMax; $i++) { - echo dol_htmlentities($productCombination2ValuePairs[$i]); + for ($i = 0; $i < $iMax; $i++) { + echo dol_htmlentities($productCombination2ValuePairs[$i]); - if ($i !== ($iMax - 1)) { - echo ', '; - } - } ?> + if ($i !== ($iMax - 1)) { + echo ', '; + } + } ?> diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index d347290c92c..5eb2d929b93 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -839,7 +839,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($usevirtualstock) { // If option to increase/decrease is not on an object validation, virtual stock may differs from physical stock. $stock = $prod->stock_theorique; - //TODO $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->; + //TODO $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->; } else { $stock = $prod->stock_reel; $stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->real; @@ -891,12 +891,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $picto = ''; if ($ordered > 0) { $stockforcompare = ($usevirtualstock ? $stock : $stock + $ordered); - /*if ($stockforcompare >= $desiredstock) - { - $picto = img_picto('', 'help'); - } else { - $picto = img_picto('', 'help'); - }*/ + /*if ($stockforcompare >= $desiredstock) + { + $picto = img_picto('', 'help'); + } else { + $picto = img_picto('', 'help'); + }*/ } else { $picto = img_picto($langs->trans("NoPendingReceptionOnSupplierOrder"), 'help'); } diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index d00755525c4..3cc38f65d28 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -476,7 +476,7 @@ class StockTransferLine extends CommonObjectLine $firstrecord = array_shift($arraybatchinfo); $dlc = $firstrecord['eatby']; $dluo = $firstrecord['sellby']; - //var_dump($batch); var_dump($arraybatchinfo); var_dump($firstrecord); var_dump($dlc); var_dump($dluo); exit; + //var_dump($batch); var_dump($arraybatchinfo); var_dump($firstrecord); var_dump($dlc); var_dump($dluo); exit; } else { $dlc = ''; $dluo = ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index f1c912f7ea0..c7b875427cd 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1117,7 +1117,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { $filter = $conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; } $text = img_picto('', 'company', 'class="pictofixedwidth"'); - $text .= $form->select_company(!empty($object->thirdparty->id)?$object->thirdparty->id:"", 'socid', $filter, 'None', 1, 0, array(), 0, 'minwidth300'); + $text .= $form->select_company(!empty($object->thirdparty->id) ? $object->thirdparty->id : "", 'socid', $filter, 'None', 1, 0, array(), 0, 'minwidth300'); if (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') && empty($conf->dol_use_jmobile)) { $texthelp = $langs->trans("IfNeedToUseOtherObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1, 0, '', '', 2); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 372e3510fcf..620b1127e91 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2494,7 +2494,7 @@ class Project extends CommonObject $return .= '
'; if ($this->public) { $return .= img_picto($langs->trans('Visibility').': '.$langs->trans('SharedProject'), 'world', 'class="paddingrightonly valignmiddle"'); - //print $langs->trans('SharedProject'); + //print $langs->trans('SharedProject'); } else { $return .= img_picto($langs->trans('Visibility').': '.$langs->trans('PrivateProject'), 'private', 'class="paddingrightonly valignmiddle"'); //print $langs->trans('PrivateProject'); diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index d91f9177aa3..93d913f3272 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -297,7 +297,7 @@ if (count($tasksarray) > 0) { if ($val->fk_parent != 0 && $task->hasChildren() > 0) { $tasks[$taskcursor]['task_is_group'] = 1; $tasks[$taskcursor]['task_css'] = 'ggroupblack'; - //$tasks[$taskcursor]['task_css'] = 'gtaskblue'; + //$tasks[$taskcursor]['task_css'] = 'gtaskblue'; } elseif ($task->hasChildren() > 0) { $tasks[$taskcursor]['task_is_group'] = 1; //$tasks[$taskcursor]['task_is_group'] = 0; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 1d5a8d85bd8..35302f28ad1 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1773,7 +1773,7 @@ while ($i < $imaxinloop) { print ''; } elseif (isset($totalarray['totalvaluefield']) && $totalarray['totalvaluefield'] == $i) { print ''; - //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print ''; + //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print ''; } else { print ''; } diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index de5e4d4f179..c011847f9d2 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -244,7 +244,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $backtopage; } elseif (getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION')) { $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; - // TODO Make replacement of __AMOUNT__, etc... + // TODO Make replacement of __AMOUNT__, etc... } else { $urlback = $_SERVER["PHP_SELF"] . "?action=added&token=" . newToken(); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 2841a239015..a9b3aa0ae34 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -440,7 +440,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $backtopage; } elseif (getDolGlobalString('MEMBER_URL_REDIRECT_SUBSCRIPTION')) { $urlback = $conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; - // TODO Make replacement of __AMOUNT__, etc... + // TODO Make replacement of __AMOUNT__, etc... } else { $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); } diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 73c2e3baa17..792bf93f4f7 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -423,7 +423,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $backtopage; } elseif (getDolGlobalString('PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION')) { $urlback = $conf->global->PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION; - // TODO Make replacement of __AMOUNT__, etc... + // TODO Make replacement of __AMOUNT__, etc... } else { $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b2dadb42058..e8b76c41645 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -382,7 +382,7 @@ if ($action == 'dopayment') { if (empty($PAYPAL_API_PRICE) || !is_numeric($PAYPAL_API_PRICE)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")); $action = ''; - // } elseif (empty($EMAIL)) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); + // } elseif (empty($EMAIL)) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); // } elseif (! isValidEMail($EMAIL)) { $mesg=$langs->trans("ErrorBadEMail",$EMAIL); } elseif (!$origfulltag) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentCode")); @@ -2542,29 +2542,29 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme billing_details: { name: 'test' thirdparty) && !empty($object->thirdparty->email))) { - ?>, email: 'thirdparty->email); ?>' + ?>, email: 'thirdparty->email); ?>'thirdparty) && !empty($object->thirdparty->phone)) { - ?>, phone: 'thirdparty->phone); ?>' + ?>, phone: 'thirdparty->phone); ?>'thirdparty)) { - ?>, address: { + ?>, address: { city: 'thirdparty->town); ?>', thirdparty->country_code) { - ?>country: 'thirdparty->country_code); ?>', + ?>country: 'thirdparty->country_code); ?>', line1: 'thirdparty->address)); ?>', postal_code: 'thirdparty->zip); ?>' } + } ?> } }, save_payment_method: /* true when a customer was provided when creating payment intent. true ask to save the card */ + print 'true'; + } else { + print 'false'; + } ?> /* true when a customer was provided when creating payment intent. true ask to save the card */ }, } ).then(function(result) { @@ -2636,29 +2636,29 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme billing_details: { name: cardholderName.value thirdparty) && !empty($object->thirdparty->email))) { - ?>, email: 'thirdparty->email); ?>' + ?>, email: 'thirdparty->email); ?>'thirdparty) && !empty($object->thirdparty->phone)) { - ?>, phone: 'thirdparty->phone); ?>' + ?>, phone: 'thirdparty->phone); ?>'thirdparty)) { - ?>, address: { + ?>, address: { city: 'thirdparty->town); ?>', thirdparty->country_code) { - ?>country: 'thirdparty->country_code); ?>', + ?>country: 'thirdparty->country_code); ?>', line1: 'thirdparty->address)); ?>', postal_code: 'thirdparty->zip); ?>' } + } ?> } }, save_payment_method: /* true when a customer was provided when creating payment intent. true ask to save the card */ + print 'true'; + } else { + print 'false'; + } ?> /* true when a customer was provided when creating payment intent. true ask to save the card */ } ).then(function(result) { console.log(result); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 1a548dd382f..e1bff57f33d 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1867,7 +1867,7 @@ if ($ispaymentok) { $result = $mailfile->sendfile(); if ($result) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); + //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0); } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 9b35ac796ac..81178c5b087 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -397,7 +397,7 @@ if (empty($reshook) && $action == 'add') { $urlback = $backtopage; } elseif (getDolGlobalString('PROJECT_URL_REDIRECT_LEAD')) { $urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD; - // TODO Make replacement of __AMOUNT__, etc... + // TODO Make replacement of __AMOUNT__, etc... } else { $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken(); } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 3b0d17bbf98..6a32b5f4aff 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -89,7 +89,7 @@ if (empty($usedolheader)) { */ llxHeader('', '', '', '', 0, 0, $arrayjs, $arraycss); -} + } // CONTENT diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 5d408ebf796..0c486d20303 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -414,7 +414,7 @@ if (empty($reshook)) { $discountid = $discount->create($user); if ($discountid > 0) { $result = $objecttmp->insert_discount($discountid); - //$result=$discount->link_to_invoice($lineid,$id); + //$result=$discount->link_to_invoice($lineid,$id); } else { setEventMessages($discount->error, $discount->errors, 'errors'); $error++; diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 51a9e3aedc1..d2832f687a9 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -51,8 +51,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 5542bdd344d..8b1aeca2eb3 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -452,7 +452,7 @@ if ($action == "update_extras" && $permissiontoadd) { if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { // This is properties of a date $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); - //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; + //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; } else { $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 301dbe6dd59..3095e18f2b1 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -391,7 +391,7 @@ foreach ($dirsociete as $dirroot) { dol_syslog($e->getMessage(), LOG_ERR); } - $modCodeTiers = new $file; + $modCodeTiers = new $file(); // Show modules according to features level if ($modCodeTiers->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -477,7 +477,7 @@ foreach ($dirsociete as $dirroot) { dol_syslog($e->getMessage(), LOG_ERR); } - $modCodeCompta = new $file; + $modCodeCompta = new $file(); $arrayofmodules[$file] = $modCodeCompta; } @@ -593,9 +593,9 @@ foreach ($dirsociete as $dirroot) { print "'; print ''; @@ -1469,12 +1470,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Phone / Fax print ''; - print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; if ($conf->browser->layout == 'phone') { print ''; } print ''; - print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; // Email / Web print ''; @@ -1525,10 +1526,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Prof ids - $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); + $i = 1; + $j = 0; + $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); - if ($idprof != '-') { + if ($idprof != '-') { $key = 'idprof'.$i; if (($j % $NBCOLS) == 0) { @@ -1554,7 +1557,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Vat is used print ''; print ''; if ($conf->browser->layout == 'phone') { print ''; @@ -1566,7 +1569,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (!getDolGlobalString('MAIN_DISABLEVATCHECK') && isInEEC($object)) { $s .= ' '; - if (!empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { $widthpopup = 600; if (!empty($conf->dol_use_jmobile)) { $widthpopup = 350; @@ -1623,7 +1626,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Type - Workforce/Staff - print ''; // Zip / Town - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100'); print ''; if ($conf->browser->layout == 'phone') { print ''; } - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print $form->widgetForTranslation("town", $object, $permissiontoadd, 'string', 'alphanohtml', 'maxwidth100 quatrevingtpercent'); print ''; @@ -2200,23 +2203,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Phone / Fax print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; if ($conf->browser->layout == 'phone') { print ''; } print ''; - print 'browser->layout == 'phone' ? ' colspan="3"': '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; print ''; // Web print ''; - print ''; + print ''; // EMail print ''; print ''; // Unsubscribe @@ -2290,7 +2293,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // VAT is used print ''; // Local Taxes @@ -2376,7 +2379,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; // Type - Workforce/Staff - print ''; - print ''; + print ''; print ''; @@ -2686,7 +2689,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Prof ids - $i = 1; $j = 0; + $i = 1; + $j = 0; while ($i <= 6) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); if ($idprof != '-') { @@ -3119,7 +3123,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (empty($user->socid)) { $langs->load("mails"); $title = ''; - if (empty($object->email) && !$at_least_one_email_contact) { $title = $langs->trans('NoEMail'); } + if (empty($object->email) && !$at_least_one_email_contact) { + $title = $langs->trans('NoEMail'); + } print dolGetButtonAction($title, $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', 'btn-send-mail', !empty($object->email) || $at_least_one_email_contact); } diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 93a4668cf7c..008d63e8a2d 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -21,7 +21,9 @@ * \brief Popup screen to validate VAT */ -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +if (! defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', '1'); +} // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) require "../../main.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -116,7 +118,7 @@ if (!$vatNumber) { } print $langs->trans("VATIntraSyntaxIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; print $langs->trans("ValueIsValid").': '.$langs->trans("No").' (Might be a non europeen VAT)
'; - //$messagetoshow=$soapclient->response; + //$messagetoshow=$soapclient->response; } else { // Syntaxe ok if ($result['requestDate']) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 341c3e4124e..b394021caa2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -896,7 +896,7 @@ class Societe extends CommonObject if (empty($this->status)) { $this->status = 0; } - $this->name = $this->name ?trim($this->name) : trim($this->nom); + $this->name = $this->name ? trim($this->name) : trim($this->nom); $this->setUpperOrLowerCase(); $this->nom = $this->name; // For backward compatibility if (empty($this->client)) { @@ -1205,8 +1205,11 @@ class Societe extends CommonObject $array_to_check = array('IDPROF1', 'IDPROF2', 'IDPROF3', 'IDPROF4', 'IDPROF5', 'IDPROF6', 'EMAIL', 'TVA_INTRA', 'ACCOUNTANCY_CODE_CUSTOMER', 'ACCOUNTANCY_CODE_SUPPLIER'); foreach ($array_to_check as $key) { $keymin = strtolower($key); - if ($key == 'ACCOUNTANCY_CODE_CUSTOMER') $keymin = 'code_compta'; - elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') $keymin = 'code_compta_fournisseur'; + if ($key == 'ACCOUNTANCY_CODE_CUSTOMER') { + $keymin = 'code_compta'; + } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER') { + $keymin = 'code_compta_fournisseur'; + } $i = (int) preg_replace('/[^0-9]/', '', $key); $vallabel = $this->$keymin; @@ -1246,7 +1249,8 @@ class Societe extends CommonObject if (!$error && $vallabel && getDolGlobalString('SOCIETE_EMAIL_UNIQUE')) { if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { $langs->load("errors"); - $error++; $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + $error++; + $this->errors[] = $langs->trans('Email')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } } elseif ($key == 'TVA_INTRA') { @@ -1254,7 +1258,8 @@ class Societe extends CommonObject if ($vallabel && getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) { if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { $langs->load("errors"); - $error++; $this->errors[] = $langs->trans('VATIntra')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; + $error++; + $this->errors[] = $langs->trans('VATIntra')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; } } } elseif ($key == 'ACCOUNTANCY_CODE_CUSTOMER' && !empty($this->client)) { @@ -1335,9 +1340,9 @@ class Societe extends CommonObject $this->nom = $this->name; // For backward compatibility $this->name_alias = trim($this->name_alias); $this->ref_ext = trim($this->ref_ext); - $this->address = $this->address ?trim($this->address) : trim($this->address); - $this->zip = $this->zip ?trim($this->zip) : trim($this->zip); - $this->town = $this->town ?trim($this->town) : trim($this->town); + $this->address = $this->address ? trim($this->address) : trim($this->address); + $this->zip = $this->zip ? trim($this->zip) : trim($this->zip); + $this->town = $this->town ? trim($this->town) : trim($this->town); $this->state_id = trim($this->state_id); $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; $this->phone = trim($this->phone); @@ -1347,15 +1352,15 @@ class Societe extends CommonObject $this->fax = preg_replace("/\s/", "", $this->fax); $this->fax = preg_replace("/\./", "", $this->fax); $this->email = trim($this->email); - $this->url = $this->url ?clean_url($this->url, 0) : ''; + $this->url = $this->url ? clean_url($this->url, 0) : ''; $this->note_private = trim($this->note_private); $this->note_public = trim($this->note_public); $this->idprof1 = trim($this->idprof1); $this->idprof2 = trim($this->idprof2); $this->idprof3 = trim($this->idprof3); $this->idprof4 = trim($this->idprof4); - $this->idprof5 = (!empty($this->idprof5) ?trim($this->idprof5) : ''); - $this->idprof6 = (!empty($this->idprof6) ?trim($this->idprof6) : ''); + $this->idprof5 = (!empty($this->idprof5) ? trim($this->idprof5) : ''); + $this->idprof6 = (!empty($this->idprof6) ? trim($this->idprof6) : ''); $this->prefix_comm = trim($this->prefix_comm); $this->outstanding_limit = price2num($this->outstanding_limit); $this->order_min_amount = price2num($this->order_min_amount); @@ -1442,7 +1447,7 @@ class Societe extends CommonObject } //Web services - $this->webservices_url = $this->webservices_url ?clean_url($this->webservices_url, 0) : ''; + $this->webservices_url = $this->webservices_url ? clean_url($this->webservices_url, 0) : ''; $this->webservices_key = trim($this->webservices_key); $this->accountancy_code_buy = trim($this->accountancy_code_buy); @@ -2929,7 +2934,7 @@ class Societe extends CommonObject $label = $langs->trans("ShowCompany"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.' refurl valignmiddle"'; $target_value = array('_self', '_blank', '_parent', '_top'); if (in_array($target, $target_value)) { @@ -3121,10 +3126,12 @@ class Societe extends CommonObject if ($resql) { $nump = $this->db->num_rows($resql); if ($nump) { - $sepa = "("; $sepb = ")"; + $sepa = "("; + $sepb = ")"; if ($mode == 'email') { //$sepa="<"; $sepb=">"; - $sepa = "<"; $sepb = ">"; + $sepa = "<"; + $sepb = ">"; } $i = 0; while ($i < $nump) { @@ -3795,7 +3802,7 @@ class Societe extends CommonObject break; } - //Verify duplicate entries + //Verify duplicate entries $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."societe WHERE ".$field." = '".$this->db->escape($value)."' AND entity IN (".getEntity('societe').")"; if ($socid) { $sql .= " AND rowid <> ".$socid; @@ -4346,7 +4353,7 @@ class Societe extends CommonObject if ($member->morphy == 'mor') { if (empty($socname)) { - $socname = $member->company? $member->company : $member->societe; + $socname = $member->company ? $member->company : $member->societe; } if (!empty($fullname) && empty($socalias)) { $socalias = $fullname; @@ -4477,7 +4484,8 @@ class Societe extends CommonObject //TODO This could be replicated for region but function `getRegion` didn't exist, so I didn't added it. // We define state_id, state_code and state - $state_id = 0; $state_code = $state_label = ''; + $state_id = 0; + $state_code = $state_label = ''; if (getDolGlobalString('MAIN_INFO_SOCIETE_STATE')) { $tmp = explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); $state_id = $tmp[0]; @@ -4683,7 +4691,7 @@ class Societe extends CommonObject $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); - return (($obj->nb > 0) ?true:false); + return (($obj->nb > 0) ? true : false); } else { $this->error = $this->db->lasterror(); return false; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e070f07740b..c4efe6be306 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -464,7 +464,7 @@ class SocieteAccount extends CommonObject $label = $langs->trans("WebsiteAccount"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 8cd00ac9cde..9aceb69b6b5 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; $langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'thirdpartylist'; // Security check $socid = GETPOST('socid', 'int'); @@ -52,7 +52,7 @@ if ($socid > 0) { } // Sort & Order fields -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -591,26 +591,26 @@ if ($sql_select) { if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); - echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0)); + echo($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0)); } if ($objp->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); - echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); + echo($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0)); } elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); - echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); + echo($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0)); } elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) { $discount = new DiscountAbsolute($db); $discount->fetch($objp->fk_remise_except); - echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); + echo($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0)); // Add date of deposit if (getDolGlobalString('INVOICE_ADD_DEPOSIT_DATE')) { echo ' ('.dol_print_date($discount->datec).')'; } } else { - echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); + echo($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } } else { diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 2fb0808a36a..612336ea797 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -68,7 +68,7 @@ $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm'); -$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'); if ($user->socid) { $socid = $user->socid; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 20666856940..836c8e83294 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -127,7 +127,7 @@ print dol_get_fiche_head($head, 'document', $langs->trans("ThirdParty"), -1, 'co // Build file list -$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); +$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1); $totalsize = 0; foreach ($filearray as $key => $file) { $totalsize += $file['size']; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 9f7bc20008d..cd0573b6457 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -125,16 +125,20 @@ if ($result) { while ($objp = $db->fetch_object($result)) { $found = 0; if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS') && ($objp->client == 2 || $objp->client == 3)) { - $found = 1; $third['prospect']++; + $found = 1; + $third['prospect']++; } if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS') && ($objp->client == 1 || $objp->client == 3)) { - $found = 1; $third['customer']++; + $found = 1; + $third['customer']++; } if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_STATS') && $objp->fournisseur) { - $found = 1; $third['supplier']++; + $found = 1; + $third['supplier']++; } if (isModEnabled('societe') && $objp->client == 0 && $objp->fournisseur == 0) { - $found = 1; $third['other']++; + $found = 1; + $third['other']++; } if ($found) { $total++; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index a4331d183ed..cda63c586d6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -131,7 +131,7 @@ $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is $diroutputmassaction = $conf->societe->dir_output.'/temp/massgeneration/'.$user->id; // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -152,28 +152,32 @@ $pagenext = $page + 1; if ($type == 'c') { if (empty($contextpage) || $contextpage == 'thirdpartylist') { $contextpage = 'customerlist'; - } if ($search_type == '') { + } + if ($search_type == '') { $search_type = '1,3'; } } if ($type == 'p') { if (empty($contextpage) || $contextpage == 'thirdpartylist') { $contextpage = 'prospectlist'; - } if ($search_type == '') { + } + if ($search_type == '') { $search_type = '2,3'; } } if ($type == 't') { if (empty($contextpage) || $contextpage == 'poslist') { $contextpage = 'poslist'; - } if ($search_type == '') { + } + if ($search_type == '') { $search_type = '1,2,3'; } } if ($type == 'f') { if (empty($contextpage) || $contextpage == 'thirdpartylist') { $contextpage = 'supplierlist'; - } if ($search_type == '') { + } + if ($search_type == '') { $search_type = '4'; } } @@ -326,8 +330,7 @@ if ($action == "change") { // Change customer for TakePOS } $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".((int) $idcustomer)." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; - $resql = $db->query($sql); - ?> + $resql = $db->query($sql); ?>
@@ -189,7 +189,7 @@ if (!empty($force_install_noedit)) { value="" + } ?> > " > trans("CheckToForceHttps"); ?> @@ -275,8 +275,8 @@ if (!empty($force_install_noedit)) { name="db_name" value="" + print ' disabled'; + } ?> > trans("DatabaseName"); ?> trans("ServerAddressDescription"); ?> @@ -424,8 +424,8 @@ if (!empty($force_install_noedit)) { id="db_port" value="" + print ' disabled'; + } ?> > trans("ServerPortDescription"); ?> @@ -441,8 +441,8 @@ if (!empty($force_install_noedit)) { name="db_prefix" value="" + print ' disabled'; + } ?> > trans("DatabasePrefixDescription"); ?> trans("AdminPassword"); ?> trans("DatabaseRootLoginDescription"); ?> @@ -593,7 +593,7 @@ if (!empty($force_install_noedit)) { ?>" 0 && !empty($force_install_databaserootpass)) { print ' disabled'; /* May be removed by javascript*/ - } ?> + } ?> > trans("KeepEmptyIfNoPassword"); ?> diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 4ce9551d246..43ce0075f73 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -645,7 +645,7 @@ if (!$error && $db->connected && $action == "set") { $check2 = $newdb->getDefaultCollationDatabase(); dolibarr_install_syslog('step1: new database is using charset='.$check1.' collation='.$check2); - // If values differs, we save conf file again + // If values differs, we save conf file again //if ($check1 != $dolibarr_main_db_character_set) dolibarr_install_syslog('step1: value for character_set is not the one asked for database creation', LOG_WARNING); //if ($check2 != $dolibarr_main_db_collation) dolibarr_install_syslog('step1: value for collation is not the one asked for database creation', LOG_WARNING); } else { diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index f96d7b8719e..471ea718a41 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3310,7 +3310,7 @@ function migrate_actioncomm_element($db, $langs, $conf) if ($resql) { $db->commit(); - // DDL commands must not be inside a transaction + // DDL commands must not be inside a transaction // We will drop at next version because a migrate should be runnable several times if it fails. //$sqlDrop = "ALTER TABLE ".MAIN_DB_PREFIX."actioncomm DROP COLUMN ".$field; //$db->query($sqlDrop); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 03171f5be86..12f81cf60e4 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -3137,7 +3137,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { $urlpage = $page; if ($i++) { $linktoenabledisable .= ' '.img_picto(ucfirst($page), "setup").''; - // print ''.ucfirst($page).' '; + // print ''.ucfirst($page).' '; } else { if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs)) { $urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1); @@ -3913,7 +3913,7 @@ if ($module == 'initmodule') { */ print ''; print ''.$attribute.''.$attribute.'
getLibStatut(2, 0) ?> getLibStatut(2, 1) ?>'; if ($obj->public) { print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); - //print $langs->trans('SharedProject'); + //print $langs->trans('SharedProject'); } else { print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"'); //print $langs->trans('PrivateProject'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 48e941aae91..a273b7bd381 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -2816,7 +2816,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print '' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '' . price($totalarray['totalvalue']) . ''.price($totalarray['totalvaluebilled']).''.price($totalarray['totalvaluebilled']).'
trans("Reception"); ?> global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { - print ' + print ' getNomUrl(1); ?> ref_supplier); ?>\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; + print 'scandir.'&label='.urlencode($module->name).'">'; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; //} //else //{ @@ -695,9 +695,9 @@ foreach ($profid as $key => $val) { $idprof_mandatory = 'SOCIETE_'.$key.'_MANDATORY'; $idprof_invoice_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY'; - $verif = (empty($conf->global->$idprof_unique) ?false:true); - $mandatory = (empty($conf->global->$idprof_mandatory) ?false:true); - $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ?false:true); + $verif = (empty($conf->global->$idprof_unique) ? false : true); + $mandatory = (empty($conf->global->$idprof_mandatory) ? false : true); + $invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ? false : true); if ($verif) { print ''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index a32782fab17..41d5460566e 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Load translation files required by the page $langs->loadLangs(array('agenda', 'bills', 'companies', 'orders', 'propal')); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartyagenda'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'thirdpartyagenda'; if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); @@ -46,13 +46,13 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -210,9 +210,9 @@ if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $cachekey = 'count_events_thirdparty_'.$object->id; $nbEvent = dol_getcache($cachekey); - $titlelist = $langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '('.$nbEvent.')': ''); + $titlelist = $langs->trans("ActionsOnCompany").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); if (!empty($conf->dol_optimize_smallscreen)) { - $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')': ''); + $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')' : ''); } print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0); diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index f625b94bed7..19cee63dcb1 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -106,7 +106,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { $id = (!empty($match[0]) ? $match[0] : ''); // Take first key found into GET array with matching $htmlname123 // When used from jQuery, the search term is added as GET param "term". - $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ?GETPOST($htmlname, 'alpha') : '')); + $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); if (!$searchkey) { return; } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index b9119174058..b129fde860e 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -203,7 +203,7 @@ abstract class ActionsCardCommon break; } } - $modCodeFournisseur = new $module; + $modCodeFournisseur = new $module(); $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto; // We verified if the tag prefix is used if ($modCodeFournisseur->code_auto) { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b280efc4536..cb3ca2527ac 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -110,7 +110,7 @@ if (!empty($backtopagejsfields)) { $dol_openinpopup = $tmpbacktopagejsfields[0]; } -$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); +$socid = GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'); if ($user->socid) { $socid = $user->socid; } @@ -347,8 +347,8 @@ if (empty($reshook)) { $object->idprof5 = trim(GETPOST('idprof5', 'alphanohtml')); $object->idprof6 = trim(GETPOST('idprof6', 'alphanohtml')); $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); - $object->code_client = GETPOSTISSET('customer_code') ?GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); - $object->code_fournisseur = GETPOSTISSET('supplier_code') ?GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); + $object->code_client = GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha'); + $object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha'); $object->capital = GETPOST('capital', 'alphanohtml'); $object->barcode = GETPOST('barcode', 'alphanohtml'); @@ -413,7 +413,7 @@ if (empty($reshook)) { // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) { - $error++; + $error++; } // Fill array 'array_languages' with data from add form @@ -446,7 +446,8 @@ if (empty($reshook)) { } if (!isValidUrl($object->webservices_url)) { $langs->load("errors"); - $error++; $errors[] = $langs->trans("ErrorBadUrl", $object->webservices_url); + $error++; + $errors[] = $langs->trans("ErrorBadUrl", $object->webservices_url); } } @@ -837,7 +838,7 @@ if (empty($reshook)) { // Actions to build doc $id = $socid; - $upload_dir = !empty($conf->societe->multidir_output[$object->entity])?$conf->societe->multidir_output[$object->entity]:$conf->societe->dir_output; + $upload_dir = !empty($conf->societe->multidir_output[$object->entity]) ? $conf->societe->multidir_output[$object->entity] : $conf->societe->dir_output; $permissiontoadd = $user->hasRight('societe', 'creer'); include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -915,7 +916,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio break; } } - $modCodeClient = new $module; + $modCodeClient = new $module(); // Load object modCodeFournisseur $module = (getDolGlobalString('SOCIETE_CODECLIENT_ADDON') ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { @@ -928,7 +929,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio break; } } - $modCodeFournisseur = new $module; + $modCodeFournisseur = new $module(); // Define if customer/prospect or supplier status is set or not if (GETPOST("type", 'aZ') != 'f') { @@ -962,7 +963,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->firstname = GETPOST('firstname', 'alphanohtml'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alphanohtml'); - $object->client = GETPOST('client', 'int') ?GETPOST('client', 'int') : $object->client; + $object->client = GETPOST('client', 'int') ? GETPOST('client', 'int') : $object->client; if (empty($duplicate_code_error)) { $object->code_client = GETPOST('customer_code', 'alpha'); @@ -1037,11 +1038,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } } - $object->logo = (isset($_FILES['photo']) ?dol_sanitizeFileName($_FILES['photo']['name']) : ''); + $object->logo = (isset($_FILES['photo']) ? dol_sanitizeFileName($_FILES['photo']['name']) : ''); // Company logo management $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos"; - $file_OK = (isset($_FILES['photo']) ?is_uploaded_file($_FILES['photo']['tmp_name']) : false); + $file_OK = (isset($_FILES['photo']) ? is_uploaded_file($_FILES['photo']['tmp_name']) : false); if ($file_OK) { if (image_format_supported($_FILES['photo']['name'])) { dol_mkdir($dir); @@ -1061,7 +1062,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id') ?GETPOST('country_id') : $mysoc->country_id; + $object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -1346,7 +1347,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Prospect/Customer print '
'.$form->editfieldkey('ProspectCustomer', 'customerprospect', '', $object, 0, 'string', '', 1).''; - $selected = (GETPOSTISSET('client') ?GETPOST('client', 'int') : $object->client); + $selected = (GETPOSTISSET('client') ? GETPOST('client', 'int') : $object->client); print $formcompany->selectProspectCustomerType($selected); print '
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '', !getDolGlobalString('SOCIETE_EMAIL_MANDATORY') ? '' : $conf->global->SOCIETE_EMAIL_MANDATORY).'
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; - print ''; // Assujeti par defaut en creation + print ''; // Assujeti par defaut en creation print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>'."\n"; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>'."\n"; $sortparam = (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1); if ($user->admin) { @@ -1844,7 +1847,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $object->address = GETPOST('address', 'alphanohtml'); $object->zip = GETPOST('zipcode', 'alphanohtml'); $object->town = GETPOST('town', 'alphanohtml'); - $object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id; + $object->country_id = GETPOST('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_id; $object->state_id = GETPOST('state_id', 'int'); $object->parent = GETPOST('parent_company_id', 'int'); @@ -2165,13 +2168,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).'
'.$form->editfieldkey('Town', 'town', '', $object, 0).''.$form->editfieldkey('Town', 'town', '', $object, 0).'
'.$form->editfieldkey('Phone', 'phone', GETPOST('phone', 'alpha'), $object, 0).'
'.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).'
'.$form->editfieldkey('Web', 'url', GETPOST('url', 'alpha'), $object, 0).''.img_picto('', 'globe', 'class="pictofixedwidth"').'
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (getDolGlobalString('SOCIETE_EMAIL_MANDATORY'))).''; print img_picto('', 'object_email', 'class="pictofixedwidth"'); - print ''; + print ''; print '
'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).''; - print 'tva_assuj ? 'checked="checked"': '') . ' value="1">'; + print 'tva_assuj ? 'checked="checked"' : '') . ' value="1">'; print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>'; + print '
'.$form->editfieldkey('ThirdPartyType', 'typent_id', '', $object, 0).'browser->layout == 'phone' || getDolGlobalString('SOCIETE_DISABLE_WORKFORCE')) ? ' colspan="3"' : '').'>'; print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -2422,7 +2425,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Incoterms if (isModEnabled('incoterm')) { print '
'.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''.$form->editfieldkey('IncotermLabel', 'incoterm_id', '', $object, 0).''; print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); print '