From 96f16d05645f6533f4a3d4429d0a1c59c7b90c60 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 30 Aug 2022 13:53:19 +0200 Subject: [PATCH 01/60] Refresh button --- htdocs/admin/emailcollector_card.php | 182 +++++++++++++++++++++------ 1 file changed, 143 insertions(+), 39 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index e41777da9d9..919ae21f2d4 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -34,6 +34,16 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php'; include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; +// use Webklex\PHPIMAP; +require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php'; +use Webklex\PHPIMAP\ClientManager; +use Webklex\PHPIMAP\Exceptions\ConnectionFailedException; +use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException; + + +use OAuth\Common\Storage\DoliStorage; +use OAuth\Common\Consumer\Credentials; + if (!$user->admin) { accessforbidden(); } @@ -377,50 +387,144 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $connectstringserver = $object->getConnectStringIMAP($usessl); if ($action == 'scan') { - try { - if ($sourcedir) { - //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); - $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); + if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { + if ($object->acces_type == 1) { + // Mode OAUth2 with PHP-IMAP + require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // define $supportedoauth2array + $keyforsupportedoauth2array = $object->oauth_service; + if (preg_match('/^.*-/', $keyforsupportedoauth2array)) { + $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array); + } else { + $keyforprovider = ''; + } + $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); + $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; + + $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); + + require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; + //$debugtext = "Host: ".$this->host."
Port: ".$this->port."
Login: ".$this->login."
Password: ".$this->password."
access type: ".$this->acces_type."
oauth service: ".$this->oauth_service."
Max email per collect: ".$this->maxemailpercollect; + //dol_syslog($debugtext); + + $storage = new DoliStorage($db, $conf); + + try { + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + $expire = true; + // Is token expired or will token expire in the next 30 seconds + // if (is_object($tokenobj)) { + // $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30)); + // } + // Token expired so we refresh it + if (is_object($tokenobj) && $expire) { + $credentials = new Credentials( + getDolGlobalString('OAUTH_'.$object->oauth_service.'_ID'), + getDolGlobalString('OAUTH_'.$object->oauth_service.'_SECRET'), + getDolGlobalString('OAUTH_'.$object->oauth_service.'_URLAUTHORIZE') + ); + $serviceFactory = new \OAuth\ServiceFactory(); + $oauthname = explode('-', $OAUTH_SERVICENAME); + // ex service is Google-Emails we need only the first part Google + $apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array()); + // We have to save the token because Google give it only once + $refreshtoken = $tokenobj->getRefreshToken(); + $tokenobj = $apiService->refreshAccessToken($tokenobj); + $tokenobj->setRefreshToken($refreshtoken); + $storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj); + } + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + if (is_object($tokenobj)) { + $token = $tokenobj->getAccessToken(); + } else { + $object->error = "Token not found"; + return -1; + } + } catch (Exception $e) { + print $e->getMessage(); + } + + $cm = new ClientManager(); + $client = $cm->make([ + 'host' => $object->host, + 'port' => $object->port, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'protocol' => 'imap', + 'username' => $object->login, + 'password' => $token, + 'authentication' => "oauth", + ]); + } else { + // Mode login/pass with PHP-IMAP + $cm = new ClientManager(); + $client = $cm->make([ + 'host' => $object->host, + 'port' => $object->port, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'protocol' => 'imap', + 'username' => $object->login, + 'password' => $object->password, + 'authentication' => "login", + ]); } - if ($targetdir) { - //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); - $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + try { + $client->connect(); + } catch (ConnectionFailedException $e) { + print $e->getMessage(); } - $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; - $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; - - dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); - - $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect - $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); - $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); - $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); - - dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); - - $connection = imap_open($connectstringsource, $object->login, $object->password); - - //dol_syslog("end imap_open connection=".var_export($connection, true)); - } catch (Exception $e) { - print $e->getMessage(); - } - - if (!$connection) { - $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; - if (function_exists('imap_last_error')) { - $morehtml .= '
'.imap_last_error(); - } - dol_syslog("Error ".$morehtml, LOG_WARNING); - //var_dump(imap_errors()) + $f = $client->getFolders(false, $object->source_directory); + $nbemail = $f[0]->examine()["exists"]; + print "mails:".$nbemail; + $morehtml .= $nbemail; + print "helo"; } else { - dol_syslog("Imap connected. Now we call imap_num_msg()"); - $morehtml .= imap_num_msg($connection); - } + try { + if ($sourcedir) { + //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); + $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); + } + if ($targetdir) { + //$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); + $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); + } - if ($connection) { - dol_syslog("Imap close"); - imap_close($connection); + $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; + $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; + + dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread); + + $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect + $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread); + $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5); + $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5); + + dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4); + + $connection = imap_open($connectstringsource, $object->login, $object->password); + + //dol_syslog("end imap_open connection=".var_export($connection, true)); + } catch (Exception $e) { + print $e->getMessage(); + } + + if (!$connection) { + $morehtml .= 'Failed to open IMAP connection '.$connectstringsource; + if (function_exists('imap_last_error')) { + $morehtml .= '
'.imap_last_error(); + } + dol_syslog("Error ".$morehtml, LOG_WARNING); + //var_dump(imap_errors()) + } else { + dol_syslog("Imap connected. Now we call imap_num_msg()"); + $morehtml .= imap_num_msg($connection); + } + + if ($connection) { + dol_syslog("Imap close"); + imap_close($connection); + } } } else { $morehtml .= ''.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").''; From 204c223b8bd83df136def30b85f80533b558bee8 Mon Sep 17 00:00:00 2001 From: Adventurousdonut <110562645+Adventurousdonut@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:16:15 +0200 Subject: [PATCH 02/60] Update llx_accounting_account_at.sql --- .../mysql/data/llx_accounting_account_at.sql | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index 3e153dc88e7..a006d716432 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -344,3 +344,211 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 319, 'AT-BASE','GROUP6','60000','0','kalk. Löhne u Gehälter', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 320, 'AT-BASE','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 321, 'AT-BASE','GROUP6','66300','0','Leistungserfassung', 1); + +-- Different Base CoA for Austria + +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 7, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 8, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 9, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 14, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 15, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 16, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 18, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 19, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 20, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 23, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 24, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 25, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 26, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 27, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 28, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 29, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 32, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 33, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 34, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 35, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 36, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 37, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 38, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 39, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 40, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 42, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 43, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 44, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 45, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 46, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 47, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 48, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 49, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 50, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 53, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 54, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 55, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 56, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 57, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 58, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 59, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 60, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 63, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 64, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 65, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 66, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 67, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 68, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 69, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 72, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 73, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 74, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 75, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 76, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 77, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 78, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 79, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 80, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 83, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 84, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 85, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 86, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 87, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 88, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 89, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 90, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 91, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 92, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 93, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); From 596fcd89ae2d80537af1f05d2d9b53a091ea965f Mon Sep 17 00:00:00 2001 From: Adventurousdonut <110562645+Adventurousdonut@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:52:53 +0200 Subject: [PATCH 03/60] Update llx_accounting_account_at.sql --- .../mysql/data/llx_accounting_account_at.sql | 410 +++++++++--------- 1 file changed, 205 insertions(+), 205 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index a006d716432..08cf24ec51a 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -347,208 +347,208 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc -- Different Base CoA for Austria -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 7, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 8, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 9, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 10, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 11, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 12, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 13, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 14, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 15, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 16, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 18, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 19, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 20, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 21, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 22, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 23, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 24, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 25, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 26, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 27, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 28, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 29, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 30, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 31, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 32, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 33, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 34, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 35, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 36, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 37, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 38, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 39, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 40, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 41, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 42, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 43, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 44, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 45, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 46, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 47, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 48, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 49, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 50, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 51, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 52, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 53, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 54, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 55, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 56, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 57, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 58, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 59, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 60, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 61, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 62, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 63, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 64, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 65, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 66, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 67, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 68, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 69, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 72, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 73, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 74, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 75, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 76, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 77, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 78, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 79, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 80, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 81, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 82, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 83, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 84, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 85, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 86, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 87, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 88, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 89, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 90, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 91, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 92, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 93, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1001, 'AT-BASE-2', 'Anlagevermögen', '0010', '0', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1002, 'AT-BASE-2', 'Anlagevermögen', '0090', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1003, 'AT-BASE-2', 'Anlagevermögen', '0100', '0', 'Konzessionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1004, 'AT-BASE-2', 'Anlagevermögen', '0110', '0', 'Patentrechte und Lizenzen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1005, 'AT-BASE-2', 'Anlagevermögen', '0120', '0', 'Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1006, 'AT-BASE-2', 'Anlagevermögen', '0121', '0', 'Geringwertige Datenverarbeitungsprogramme', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1007, 'AT-BASE-2', 'Anlagevermögen', '0130', '0', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1008, 'AT-BASE-2', 'Anlagevermögen', '0140', '0', 'Pacht- und Mietrechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1009, 'AT-BASE-2', 'Anlagevermögen', '0150', '0', 'Geschäfts(Firmen)wert', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'AT-BASE-2', 'Anlagevermögen', '0180', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'AT-BASE-2', 'Anlagevermögen', '0190', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'AT-BASE-2', 'Sachanlagen', '0200', '0', 'Unbebaute Grundstücke', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'AT-BASE-2', 'Sachanlagen', '0210', '0', 'Bebaute Grundstücke (Grundwert)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'AT-BASE-2', 'Sachanlagen', '0220', '0', 'Grundstücksgleiche Rechte', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'AT-BASE-2', 'Sachanlagen', '0300', '0', 'Betriebs- und Geschäftsgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'AT-BASE-2', 'Sachanlagen', '0310', '0', 'Wohn- und Sozialgebäude auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'AT-BASE-2', 'Sachanlagen', '0320', '0', 'Betriebs- und Geschäftsgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'AT-BASE-2', 'Sachanlagen', '0330', '0', 'Wohn- und Sozialgebäude auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'AT-BASE-2', 'Sachanlagen', '0340', '0', 'Grundstückseinrichtungen auf eigenem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'AT-BASE-2', 'Sachanlagen', '0350', '0', 'Grundstückseinrichtungen auf fremdem Grund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'AT-BASE-2', 'Sachanlagen', '0360', '0', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'AT-BASE-2', 'Sachanlagen', '0370', '0', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'AT-BASE-2', 'Sachanlagen', '0390', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'AT-BASE-2', 'Sachanlagen', '0400', '0', 'Fertigungsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'AT-BASE-2', 'Sachanlagen', '0410', '0', 'Antriebsmaschinen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'AT-BASE-2', 'Sachanlagen', '0420', '0', 'Energieversorgungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'AT-BASE-2', 'Sachanlagen', '0430', '0', 'Transportanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'AT-BASE-2', 'Sachanlagen', '0500', '0', 'Maschinenwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'AT-BASE-2', 'Sachanlagen', '0510', '0', 'Allgemeine Werkzeuge und Handwerkzeuge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'AT-BASE-2', 'Sachanlagen', '0520', '0', 'Vorrichtungen, Formen und Modelle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'AT-BASE-2', 'Sachanlagen', '0530', '0', 'Andere Erzeugungshilfsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'AT-BASE-2', 'Sachanlagen', '0540', '0', 'Hebezeuge und Montageanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'AT-BASE-2', 'Sachanlagen', '0550', '0', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'AT-BASE-2', 'Sachanlagen', '0600', '0', 'Beheizungs- und Beleuchtungsanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'AT-BASE-2', 'Sachanlagen', '0610', '0', 'Nachrichten- und Kontrollanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'AT-BASE-2', 'Sachanlagen', '0620', '0', 'Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'AT-BASE-2', 'Sachanlagen', '0630', '0', 'PKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'AT-BASE-2', 'Sachanlagen', '0640', '0', 'LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'AT-BASE-2', 'Sachanlagen', '0650', '0', 'Andere Beförderungsmittel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'AT-BASE-2', 'Sachanlagen', '0660', '0', 'Andere Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'AT-BASE-2', 'Sachanlagen', '0670', '0', 'Gebinde', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'AT-BASE-2', 'Sachanlagen', '0680', '0', 'Geringwertige Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'AT-BASE-2', 'Sachanlagen', '0681', '0', 'Geringwertige Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'AT-BASE-2', 'Sachanlagen', '0692', '0', 'Kumulierte Abschreibungen zu Büromaschinen, EDV-Anlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'AT-BASE-2', 'Sachanlagen', '0693', '0', 'Kumulierte Abschreibungen zu PKW und Kombis', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'AT-BASE-2', 'Sachanlagen', '0694', '0', 'Kumulierte Abschreibungen zu LKW', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'AT-BASE-2', 'Sachanlagen', '0696', '0', 'Kumulierte Abschreibungen zur Betriebs- und Geschäftsausstattung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'AT-BASE-2', 'Vorauszahlungen', '0700', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'AT-BASE-2', 'Sachanlagen', '0710', '0', 'Anlagen in Bau', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'AT-BASE-2', 'Sachanlagen', '0790', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'AT-BASE-2', 'Anlagevermögen', '0800', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'AT-BASE-2', 'Anlagevermögen', '0810', '0', 'Beteiligungen an Gemeinschaftsunternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'AT-BASE-2', 'Anlagevermögen', '0820', '0', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'AT-BASE-2', 'Anlagevermögen', '0830', '0', 'Sonstige Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'AT-BASE-2', 'Anlagevermögen', '0840', '0', 'Ausleihungen an verbundene Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'AT-BASE-2', 'Anlagevermögen', '0850', '0', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'AT-BASE-2', 'Anlagevermögen', '0860', '0', 'Sonstige Ausleihungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'AT-BASE-2', 'Anlagevermögen', '0870', '0', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'AT-BASE-2', 'Anlagevermögen', '0880', '0', 'Anteile an Personengesellschaften ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'AT-BASE-2', 'Anlagevermögen', '0900', '0', 'Genossenschaftsanteile ohne Beteiligungscharakter', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'AT-BASE-2', 'Anlagevermögen', '0910', '0', 'Anteile an Investmentfonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'AT-BASE-2', 'Vorauszahlungen', '0980', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'AT-BASE-2', 'Anlagevermögen', '0990', '0', 'Kumulierte Abschreibungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'AT-BASE-2', 'Umlaufvermögen', '1600', '0', 'Handelswaren', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'AT-BASE-2', 'Vorauszahlungen', '1800', '0', 'Geleistete Anzahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'AT-BASE-2', 'Debitoren', '2000', '0', 'Forderungen von Partnern im Inland ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'AT-BASE-2', 'Umlaufvermögen', '2080', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'AT-BASE-2', 'Umlaufvermögen', '2090', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'AT-BASE-2', 'Debitoren', '2099', '0', 'Forderungen von Partnern (Point Of Sale)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'AT-BASE-2', 'Debitoren', '2100', '0', 'Forderungen von Partnern im EU Raum ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'AT-BASE-2', 'Umlaufvermögen', '2130', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'AT-BASE-2', 'Umlaufvermögen', '2140', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'AT-BASE-2', 'Debitoren', '2150', '0', 'Forderungen von Partnern in Drittstaaten ohne eigenes Debitorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'AT-BASE-2', 'Umlaufvermögen', '2180', '0', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'AT-BASE-2', 'Umlaufvermögen', '2190', '0', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'AT-BASE-2', 'Umlaufvermögen', '2230', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'AT-BASE-2', 'Umlaufvermögen', '2240', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'AT-BASE-2', 'Umlaufvermögen', '2280', '0', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'AT-BASE-2', 'Umlaufvermögen', '2290', '0', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'AT-BASE-2', 'Umlaufvermögen', '2470', '0', 'Eingeforderte, aber noch nicht eingezahlte Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'AT-BASE-2', 'Umlaufvermögen', '2480', '0', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'AT-BASE-2', 'Umlaufvermögen', '2490', '0', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'AT-BASE-2', 'Umlaufvermögen', '2500', '0', 'Vorsteuern 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'AT-BASE-2', 'Umlaufvermögen', '2501', '0', 'Vorsteuern 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'AT-BASE-2', 'Umlaufvermögen', '2502', '0', 'Vorsteuern 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'AT-BASE-2', 'Umlaufvermögen', '2505', '0', 'Sonstige Vorsteuern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'AT-BASE-2', 'Umlaufvermögen', '2506', '0', 'Vorsteuern RC 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'AT-BASE-2', 'Umlaufvermögen', '2507', '0', 'Vorsteuern RC 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'AT-BASE-2', 'Umlaufvermögen', '2510', '0', 'Vorsteuern RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'AT-BASE-2', 'Umlaufvermögen', '2511', '0', 'Vorsteuern IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'AT-BASE-2', 'Umlaufvermögen', '2512', '0', 'Vorsteuern IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'AT-BASE-2', 'Umlaufvermögen', '2513', '0', 'Vorsteuern IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'AT-BASE-2', 'Umlaufvermögen', '2515', '0', 'Vorsteuern 20% (aus EUSt.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'AT-BASE-2', 'Umlaufvermögen', '2600', '0', 'Eigene Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'AT-BASE-2', 'Umlaufvermögen', '2610', '0', 'Anteile an verbundenen Unternehmen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'AT-BASE-2', 'Umlaufvermögen', '2620', '0', 'Sonstige Anteile', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'AT-BASE-2', 'Umlaufvermögen', '2680', '0', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'AT-BASE-2', 'Umlaufvermögen', '2690', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'AT-BASE-2', 'Liquide Mittel', '2701', '0', 'Kasse/Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'AT-BASE-2', 'Umlaufvermögen', '2730', '0', 'Postwertzeichen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'AT-BASE-2', 'Umlaufvermögen', '2740', '0', 'Stempelmarken', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'AT-BASE-2', 'Umlaufvermögen', '2780', '0', 'Schecks in Inlandswährung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'AT-BASE-2', 'Umlaufvermögen', '2801', '0', 'Bankzwischenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'AT-BASE-2', 'Umlaufvermögen', '2802', '0', 'Ausstehende Quittungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'AT-BASE-2', 'Umlaufvermögen', '2803', '0', 'Ausstehende Zahlungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'AT-BASE-2', 'Liquide Mittel', '2804', '0', 'Bank', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'AT-BASE-2', 'Umlaufvermögen', '2880', '0', 'Schwebende Geldbewegungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'AT-BASE-2', 'Umlaufvermögen', '2881', '0', 'Liquiditätstransfer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'AT-BASE-2', 'Umlaufvermögen', '2890', '0', 'Wertberichtigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'AT-BASE-2', 'Umlaufvermögen', '2900', '0', 'Aktive Rechnungsabgrenzungsposten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'AT-BASE-2', 'Umlaufvermögen', '2950', '0', 'Disagio', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'AT-BASE-2', 'Umlaufvermögen', '2960', '0', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'AT-BASE-2', 'Umlaufvermögen', '2970', '0', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'AT-BASE-2', 'Umlaufvermögen', '2980', '0', 'Steuerabgrenzung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3000', '0', 'Rückstellungen für Abfertigungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'AT-BASE-2', 'Langfristige Verbindlichkeiten', '3010', '0', 'Rückstellungen für Pensionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'AT-BASE-2', 'Umlaufvermögen', '3100', '0', 'Anleihen (einschließlich konvertibler)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'AT-BASE-2', 'Umlaufvermögen', '3200', '0', 'Erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3210', '0', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'AT-BASE-2', 'Kreditoren', '3300', '0', 'Verbindlichkeiten bei Partnern im Inland ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'AT-BASE-2', 'Kreditoren', '3360', '0', 'Verbindlichkeiten bei Partnern im EU Raum ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'AT-BASE-2', 'Kreditoren', '3370', '0', 'Verbindlichkeiten bei Partnern in Drittstaaten ohne eigenes Kreditorenkonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3480', '0', 'Verbindlichkeiten gegenüber Gesellschaftern', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3500', '0', 'Umsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3501', '0', 'Umsatzsteuer 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3502', '0', 'Umsatzsteuer 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3505', '0', 'Sonstige Umsatzsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3510', '0', 'Umsatzsteuer RC EU 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3511', '0', 'Umsatzsteuer IGE 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3512', '0', 'Umsatzsteuer IGE 10%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3513', '0', 'Umsatzsteuer IGE 13%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3515', '0', 'Einfuhrumsatzsteuer 20%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3520', '0', 'Ust. Zahllast', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'AT-BASE-2', 'Kreditoren', '3530', '0', 'Verrechnungskonto Finanzamt', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3540', '0', 'Verrechnung Lohnsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3541', '0', 'Verrechnung Dienstgeberbeitrag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3542', '0', 'Verrechnung Dienstgeberzuschlag', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3550', '0', 'Verrechnung Kommunalsteuer', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'AT-BASE-2', 'Kurzfristige Verbindlichkeiten', '3551', '0', 'Verrechnung Wiener Dienstgeberabgabe', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'AT-BASE-2', 'Kreditoren', '3600', '0', 'Verrechungskonto Sozialversicherung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'AT-BASE-2', 'Kreditoren', '3610', '0', 'Verrechnungskonto Magistrat/Gemeinde (KoSt, U-Bahn, etc.)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'AT-BASE-2', 'Kreditoren', '3740', '0', 'WERE Verrechnungskonto', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'AT-BASE-2', 'Erlöse', '4000', '0', 'Brutto-Umsatzerlöse im Inland (20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'AT-BASE-2', 'Erlöse', '4001', '0', 'Brutto-Umsatzerlöse im Inland (10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'AT-BASE-2', 'Erlöse', '4100', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 20%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'AT-BASE-2', 'Erlöse', '4110', '0', 'Brutto-Umsatzerlöse im EU Raum (RC 10%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'AT-BASE-2', 'Erlöse', '4200', '0', 'Brutto-Umsatzerlöse in Drittstaaten (0%)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '4860', '0', 'Kursgewinne aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'AT-BASE-2', 'Aufwand', '5000', '0', 'Wareneinkauf', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'AT-BASE-2', 'Aufwand', '5050', '0', 'Wareneinkauf EU', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'AT-BASE-2', 'Aufwand', '5090', '0', 'Wareneinkauf 0%', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'AT-BASE-2', 'Aufwand', '5800', '0', 'Skontoerträge auf Materialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'AT-BASE-2', 'Aufwand', '5810', '0', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'AT-BASE-2', 'Aufwand', '5900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'AT-BASE-2', 'Aufwand', '6200', '0', 'Gehälter (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'AT-BASE-2', 'Aufwand', '6205', '0', 'Geschäftsführerbezug', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1157, 'AT-BASE-2', 'Aufwand', '6242', '0', 'Urlaubsabfindung (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1158, 'AT-BASE-2', 'Aufwand', '6260', '0', 'Sonstige Bezüge (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1159, 'AT-BASE-2', 'Aufwand', '6270', '0', 'Sachbezug (Angestellte)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1160, 'AT-BASE-2', 'Aufwand', '6271', '0', 'Sachbezug (Geschäftsführer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1161, 'AT-BASE-2', 'Aufwand', '6310', '0', 'Grundgehälter (Überstunden)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1162, 'AT-BASE-2', 'Aufwand', '6330', '0', 'Gehälter (Überstundenzuschläge)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1163, 'AT-BASE-2', 'Aufwand', '6340', '0', 'Veränderung noch nicht konsumierter Urlaub', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1164, 'AT-BASE-2', 'Aufwand', '6400', '0', 'Beiträge für betriebliche Mitarbeitervorsorgekasse', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1165, 'AT-BASE-2', 'Aufwand', '6560', '0', 'Gesetzlicher Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1166, 'AT-BASE-2', 'Aufwand', '6660', '0', 'Kommunalsteuer (KoSt)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1167, 'AT-BASE-2', 'Aufwand', '6661', '0', 'Dienstgeberbeitrag zum Familienlastenausgleichsfonds (DB)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1168, 'AT-BASE-2', 'Aufwand', '6662', '0', 'Zuschlag zum Dienstnehmerbeitrag (DZ)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1169, 'AT-BASE-2', 'Aufwand', '6663', '0', 'Dienstgeberabgabe der Gemeinde Wien (U-Bahn Steuer)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1170, 'AT-BASE-2', 'Aufwand', '6700', '0', 'Sonstiger freiwilliger Sozialaufwand', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1171, 'AT-BASE-2', 'Aufwand', '6900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1172, 'AT-BASE-2', 'Abschreibungen', '7000', '0', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1173, 'AT-BASE-2', 'Abschreibungen', '7090', '0', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1174, 'AT-BASE-2', 'Aufwand', '7600', '0', 'Büromaterial und Drucksorten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1175, 'AT-BASE-2', 'Aufwand', '7630', '0', 'Fachliteratur und Zeitungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1176, 'AT-BASE-2', 'Aufwand', '7690', '0', 'Spenden und Trinkgelder', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1177, 'AT-BASE-2', 'Aufwand', '7770', '0', 'Aus- und Fortbildung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1178, 'AT-BASE-2', 'Aufwand', '7780', '0', 'Mitgliedsbeiträge', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1179, 'AT-BASE-2', 'Aufwand', '7790', '0', 'Spesen des Geldverkehrs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1180, 'AT-BASE-2', 'Aufwand', '7820', '0', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1181, 'AT-BASE-2', 'Aufwand', '7830', '0', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1182, 'AT-BASE-2', 'Aufwand', '7860', '0', 'Kursverluste aus Fremdwährungstransaktionen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1183, 'AT-BASE-2', 'Aufwand', '7890', '0', 'Skontoerträge auf sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1184, 'AT-BASE-2', 'Aufwand', '7900', '0', 'Aufwandsstellenrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1185, 'AT-BASE-2', 'Aufwand', '7960', '0', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1186, 'AT-BASE-2', 'Aufwand', '7970', '0', 'Vertriebskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1187, 'AT-BASE-2', 'Aufwand', '7980', '0', 'Verwaltungskosten', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1188, 'AT-BASE-2', 'Aufwand', '7990', '0', 'Sonstige betriebliche Aufwendungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1189, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8140', '0', 'Erlöse aus dem Abgang von Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1190, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8150', '0', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1191, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8160', '0', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1192, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8170', '0', 'Buchwert abgegangener Beteiligungen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1193, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8180', '0', 'Buchwert abgegangener sonstiger Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1194, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8190', '0', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1195, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8200', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1196, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8210', '0', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1197, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8350', '0', 'Nicht ausgenützte Lieferantenskonti', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1198, 'AT-BASE-2', 'Sonstige betriebliche Erträge', '8990', '0', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1199, 'AT-BASE-2', 'Eigenkapital', '9190', '0', 'Nicht eingeforderte ausstehende Einlagen', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1200, 'AT-BASE-2', 'Eigenkapital', '9390', '0', 'Bilanzgewinn (-verlust)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1201, 'AT-BASE-2', 'Eigenkapital', '9800', '0', 'Eröffnungsbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1202, 'AT-BASE-2', 'Eigenkapital', '9850', '0', 'Schlussbilanz', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1203, 'AT-BASE-2', 'Eigenkapital', '9890', '0', 'Gewinn- und Verlustrechnung', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1204, 'AT-BASE-2', 'Aufwand', '9991', '0', 'Bargelddifferenz Verlust', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1205, 'AT-BASE-2', 'Erlöse', '9992', '0', 'Bargelddifferenz Gewinn', 1); From 55dcf19efd1fdc74fea391d76f60604bb696bc36 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 Aug 2022 17:22:06 +0200 Subject: [PATCH 04/60] FIX missing hook context and some parameters --- htdocs/accountancy/admin/account.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 48d8ab23d96..84eab31849d 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -97,6 +97,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) { $accounting = new AccountingAccount($db); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('accountancyadminaccount')); + /* * Actions @@ -109,8 +112,8 @@ if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; } -$parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been monowraponalldified by some hooks +$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $accounting, $action); // Note that $action and $object may have been monowraponalldified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } From 594bbcb1f194460dfa59543ed5a37c8cbb14ccd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 17:32:38 +0200 Subject: [PATCH 05/60] Fix regression --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 0db718f28b4..40449d5da1f 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -130,7 +130,7 @@ $error = 0; $listofchoices = array( 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)), + 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)), From 0bfa7a2a8f864cd079c63bb56bb39258b9e2e4bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2022 18:09:46 +0200 Subject: [PATCH 06/60] Fix delete dir --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 3024d3b1e61..abf16cee764 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -632,7 +632,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`; From 92f9f36dd68e7993728a51cabb1727de0e4efd5e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 Aug 2022 18:39:41 +0200 Subject: [PATCH 07/60] FIX add hook formobjectoptions --- htdocs/accountancy/admin/account.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 84eab31849d..15931b19c57 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -399,6 +399,11 @@ if ($resql) { print ''; print '
'; + + $parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; From 7374974880038016788d8933da92b168eb6c0efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 31 Aug 2022 18:40:28 +0200 Subject: [PATCH 08/60] add tables for bank lines extrafields --- .../install/mysql/migration/16.0.0-17.0.0.sql | 10 ++++++++ .../mysql/tables/llx_bank_extrafields.key.sql | 20 +++++++++++++++ .../mysql/tables/llx_bank_extrafields.sql | 25 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_bank_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_bank_extrafields.sql diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 5db36ee955b..187106f679c 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -129,3 +129,13 @@ ALTER TABLE llx_societe_rib ADD COLUMN currency_code varchar(3) AFTER fk_country ALTER TABLE llx_user_rib ADD COLUMN state_id integer AFTER owner_address; ALTER TABLE llx_user_rib ADD COLUMN fk_country integer AFTER state_id; ALTER TABLE llx_user_rib ADD COLUMN currency_code varchar(3) AFTER fk_country; + +CREATE TABLE llx_bank_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql b/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql new file mode 100644 index 00000000000..3d308e79684 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bank_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2022 Frédéric France +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_bank_extrafields ADD INDEX idx_bank_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_bank_extrafields.sql b/htdocs/install/mysql/tables/llx_bank_extrafields.sql new file mode 100644 index 00000000000..3ca4f7a84d4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_bank_extrafields.sql @@ -0,0 +1,25 @@ +-- =================================================================== +-- Copyright (C) 2022 Frédéric France +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +CREATE TABLE llx_bank_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_object integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; From 194c76727e31f64a07106da4e2c6f1dd82b1a940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:37:10 +0200 Subject: [PATCH 09/60] fix php8 warnings --- htdocs/expedition/class/expedition.class.php | 8 ++++---- htdocs/expensereport/card.php | 2 +- htdocs/product/inventory/inventory.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5df7108e895..ec7d7ff3cab 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php'; @@ -625,7 +625,7 @@ class Expedition extends CommonObject $this->fetch_optionals(); // Fix Get multicurrency param for transmited - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { if (!empty($this->multicurrency_code)) { $this->multicurrency_code = $this->thirdparty->multicurrency_code; } @@ -1291,7 +1291,7 @@ class Expedition extends CommonObject } // delete batch expedition line - if (!$error && $conf->productbatch->enabled) { + if (!$error && isModEnabled('productbatch')) { $shipmentlinebatch = new ExpeditionLineBatch($this->db); if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); @@ -2901,7 +2901,7 @@ class ExpeditionLigne extends CommonObjectLine // update lot - if (!empty($batch) && $conf->productbatch->enabled) { + if (!empty($batch) && isModEnabled('productbatch')) { dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch"); if (empty($batch_id) || empty($this->fk_product)) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 05831c5dd97..9daa03a3ec8 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index cdcfe74cb73..f7b3ddd5ac6 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -161,7 +161,7 @@ if (empty($reshook)) { // Get the real quantity in stock now, but before the stock move for inventory. $realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->real; - if ($conf->productbatch->enabled && $product_static->hasbatch()) { + if (isModEnabled('productbatch') && $product_static->hasbatch()) { $realqtynow = $product_static->stock_warehouse[$line->fk_warehouse]->detail_batch[$line->batch]->qty; } From ece2f5553ae85c9e421a0f7d36d6a64f978eaa2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:49:10 +0200 Subject: [PATCH 10/60] fix php8 warnings --- htdocs/admin/dict.php | 18 +++++++++--------- htdocs/comm/card.php | 2 +- htdocs/contact/card.php | 8 ++++---- htdocs/contact/list.php | 14 +++++++------- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 4 ++-- htdocs/core/modules/modCategorie.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 8 ++++---- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/fourn/facture/card.php | 4 ++-- htdocs/hrm/index.php | 10 +++++----- htdocs/societe/card.php | 10 +++++----- htdocs/societe/website.php | 2 +- htdocs/user/bank.php | 8 ++++---- htdocs/user/card.php | 20 ++++++++++---------- htdocs/user/list.php | 2 +- htdocs/user/param_ihm.php | 2 +- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e2b8ace4783..ca5757dc452 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -506,24 +506,24 @@ $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW $tabcond[21] = isModEnabled("propal"); $tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); $tabcond[23] = true; -$tabcond[24] = !empty($conf->resource->enabled); -$tabcond[25] = !empty($conf->website->enabled); +$tabcond[24] = isModEnabled('resource'); +$tabcond[25] = isModEnabled('website'); //$tabcond[26]= isModEnabled("product"); $tabcond[27] = isModEnabled("societe"); -$tabcond[28] = !empty($conf->holiday->enabled); +$tabcond[28] = isModEnabled('holiday'); $tabcond[29] = !empty($conf->project->enabled); -$tabcond[30] = !empty($conf->label->enabled); +$tabcond[30] = isModEnabled('label'); //$tabcond[31]= !empty($conf->accounting->enabled); -$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); -$tabcond[33] = !empty($conf->hrm->enabled); -$tabcond[34] = !empty($conf->hrm->enabled); +$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); +$tabcond[33] = isModEnabled('hrm'); +$tabcond[34] = isModEnabled('hrm'); $tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[37] = isModEnabled("product"); -$tabcond[38] = !empty($conf->socialnetworks->enabled); +$tabcond[38] = isModEnabled('socialnetworks'); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); -$tabcond[41] = !empty($conf->intracommreport->enabled); +$tabcond[41] = isModEnabled('intracommreport'); $tabcond[42] = isModEnabled("product"); $tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[44] = isModEnabled('asset'); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ec8ebdd67e6..3e388677605 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -584,7 +584,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { // Transport mode by default print ''; print ''; @@ -1146,7 +1146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d5c0d333d03..6d66f70ceeb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -83,7 +83,7 @@ if (!empty($conf->mailing->enabled)) { } else { $search_no_email = -1; } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $search_[$key] = GETPOST("search_".$key, 'alpha'); @@ -221,7 +221,7 @@ $arrayfields['unsubscribed'] = array( 'enabled'=>(!empty($conf->mailing->enabled)), 'position'=>111); -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $arrayfields['p.'.$key] = array( @@ -289,7 +289,7 @@ if (empty($reshook)) { $search_fax = ""; $search_email = ""; $search_no_email = -1; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { $search_[$key] = ""; @@ -499,7 +499,7 @@ if (strlen($search_phone_mobile)) { if (strlen($search_fax)) { $sql .= natural_search('p.fax', $search_fax); } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && strlen($search_[$key])) { $sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'"; @@ -880,7 +880,7 @@ if (!empty($arrayfields['unsubscribed']['checked'])) { print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); print ''; } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { if (!empty($arrayfields['p.'.$key]['checked'])) { @@ -1004,7 +1004,7 @@ if (!empty($arrayfields['p.email']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) { print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center '); } -if (!empty($conf->socialnetworks->enabled)) { +if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder); @@ -1219,7 +1219,7 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5b5de36406a..2c438fdd98c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -968,7 +968,7 @@ abstract class CommonObject $outdone++; } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $outsocialnetwork = ''; if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 17235576394..a1446bf6964 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -124,7 +124,7 @@ function product_prepare_head($object) } // Tab to link resources - if (!empty($conf->resource->enabled)) { + if (isModEnabled('resource')) { if ($object->isProduct() && !empty($conf->global->RESOURCE_ON_PRODUCTS)) { $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&ref='.$object->ref; $head[$h][1] = $langs->trans("Resources"); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 65b512ec18e..19578ec9fe3 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -142,9 +142,9 @@ function user_prepare_head(User $object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'user'); if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read)) + || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read)) || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) - || (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) + || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) ) { // Bank $head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index e70cdad999e..2e31bdef7db 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -160,7 +160,7 @@ class modCategorie extends DolibarrModules if (isModEnabled('agenda')) { $typeexample .= ($typeexample ? " / " : "")."10=Agenda event"; } - if (!empty($conf->website->enabled)) { + if (isModEnabled('website')) { $typeexample .= ($typeexample ? " / " : "")."11=Website page"; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c11c37d11ef..7e7d010ed5d 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -520,7 +520,7 @@ class modSociete extends DolibarrModules $this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); } // Add social networks fields - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -693,7 +693,7 @@ class modSociete extends DolibarrModules 's.code_compta' => 'CustomerAccountancyCode', 's.code_compta_fournisseur' => 'SupplierAccountancyCode' ); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -757,7 +757,7 @@ class modSociete extends DolibarrModules 's.note_public' => "NotePublic" ); // Add social networks fields - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { @@ -835,7 +835,7 @@ class modSociete extends DolibarrModules 's.rowid' => 'Id', 's.lastname' => "Lastname", ); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $resql = $this->db->query($sql); while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 49bd25d0b90..c37ce4690f4 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -359,7 +359,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 6bbca0026e1..7572dd3f3d8 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -152,7 +152,7 @@ if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->expensereport->enabled)) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } if (isModEnabled("banque")) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ddf54ba0727..f5ed12fd984 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2465,7 +2465,7 @@ if ($action == 'create') { } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7eb7f53d82..ff7c0051a29 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -215,7 +215,7 @@ if (empty($reshook)) { //$object->facebook = GETPOST("facebook", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); @@ -427,7 +427,7 @@ if (empty($reshook)) { //$object->facebook = GETPOST("facebook", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); @@ -859,7 +859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print '
'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'
'.$langs->trans('IntracommReportTransportMode').''; $form->selectTransportMode(GETPOSTISSET('transport_mode_id') ? GETPOST('transport_mode_id') : $transport_mode_id, 'transport_mode_id'); @@ -3137,7 +3137,7 @@ if ($action == 'create') { } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
'; print ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -1929,7 +1929,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -2287,7 +2287,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Social network - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 424d18c2058..b8111274969 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -249,7 +249,7 @@ print ''; print dol_get_fiche_end(); $newcardbutton = ''; -if (!empty($conf->website->enabled)) { +if (isModEnabled('website')) { if (!empty($user->rights->societe->lire)) { $newcardbutton .= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id)); } else { diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index fed40e6a1bd..0dd8a7f9d08 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } if (!empty($conf->expensereport->enabled)) { @@ -377,7 +377,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -1242,7 +1242,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($id, $childids)) || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // THM @@ -1514,7 +1514,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print ''; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -2721,7 +2721,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // Salary diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e98922f7e01..e22f95d1055 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -941,7 +941,7 @@ while ($i < $imaxinloop) { $canreadhrmdata = 0; if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($obj->rowid, $childids)) || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $canreadhrmdata = 1; } $canreadsecretapi = 0; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 49dc7e7f7a3..6d5a27cd8ba 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -192,7 +192,7 @@ if (isModEnabled("societe")) { if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } -if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) { +if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) { $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus } if (isModEnabled("product") || isModEnabled("service")) { From fc01cc66cdb53f895b341f5c1fceb2040eef42c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:55:55 +0200 Subject: [PATCH 11/60] fix php8 warnings --- htdocs/admin/dict.php | 18 +++++++------- htdocs/admin/fckeditor.php | 4 ++-- htdocs/admin/mails_templates.php | 8 +++---- htdocs/admin/stock.php | 6 ++--- htdocs/admin/workflow.php | 12 +++++----- htdocs/blockedlog/class/blockedlog.class.php | 2 +- .../comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/card.php | 20 ++++++++-------- htdocs/comm/index.php | 6 ++--- htdocs/comm/propal/card.php | 6 ++--- htdocs/commande/card.php | 2 +- htdocs/commande/index.php | 6 ++--- htdocs/commande/list.php | 2 +- htdocs/compta/facture/card.php | 2 +- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 4 ++-- htdocs/contact/consumption.php | 2 +- htdocs/contrat/card.php | 2 +- htdocs/core/boxes/box_activity.php | 2 +- .../boxes/box_graph_product_distribution.php | 4 ++-- htdocs/core/boxes/box_members_by_type.php | 2 +- .../core/boxes/box_members_last_modified.php | 2 +- .../boxes/box_members_last_subscriptions.php | 2 +- .../box_members_subscriptions_by_year.php | 2 +- htdocs/core/class/html.formmail.class.php | 8 +++---- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++--- htdocs/core/lib/ldap.lib.php | 4 ++-- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/core/lib/project.lib.php | 12 +++++----- htdocs/core/lib/usergroups.lib.php | 2 +- htdocs/core/modules/modCategorie.class.php | 6 ++--- htdocs/core/modules/modStock.class.php | 4 ++-- .../doc/doc_generic_project_odt.modules.php | 4 ++-- .../task/doc/doc_generic_task_odt.modules.php | 4 ++-- .../stocktransfer/doc/pdf_eagle.modules.php | 4 ++-- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 4 ++-- ...e_20_modWorkflow_WorkflowManager.class.php | 8 +++---- htdocs/datapolicy/admin/setup.php | 2 +- htdocs/delivery/card.php | 4 ++-- htdocs/delivery/class/delivery.class.php | 2 +- htdocs/ecm/index_auto.php | 6 ++--- htdocs/ecm/search.php | 6 ++--- htdocs/expedition/card.php | 24 +++++++++---------- htdocs/expedition/class/expedition.class.php | 4 ++-- htdocs/expedition/contact.php | 4 ++-- htdocs/expedition/note.php | 2 +- htdocs/fourn/card.php | 4 ++-- .../class/fournisseur.commande.class.php | 2 +- .../fourn/class/fournisseur.product.class.php | 2 +- htdocs/fourn/commande/dispatch.php | 14 +++++------ htdocs/hrm/index.php | 10 ++++---- htdocs/install/upgrade2.php | 2 +- htdocs/main.inc.php | 4 ++-- htdocs/mrp/mo_movements.php | 6 ++--- htdocs/mrp/mo_production.php | 2 +- htdocs/product/card.php | 10 ++++---- htdocs/product/class/product.class.php | 6 ++--- htdocs/product/inventory/inventory.php | 12 +++++----- htdocs/product/list.php | 4 ++-- .../stock/class/mouvementstock.class.php | 8 +++---- htdocs/product/stock/index.php | 4 ++-- htdocs/product/stock/movement_card.php | 10 ++++---- htdocs/product/stock/movement_list.php | 10 ++++---- htdocs/product/stock/product.php | 16 ++++++------- htdocs/product/stock/productlot_document.php | 2 +- htdocs/product/stock/replenish.php | 2 +- .../product/stock/tpl/stocktransfer.tpl.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/projet/element.php | 14 +++++------ htdocs/projet/info.php | 2 +- htdocs/reception/card.php | 20 ++++++++-------- htdocs/reception/class/reception.class.php | 4 ++-- htdocs/reception/note.php | 2 +- .../canvas/actions_card_common.class.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/card.php | 8 +++---- htdocs/societe/class/societe.class.php | 6 ++--- htdocs/societe/consumption.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/societecontact.php | 2 +- htdocs/user/bank.php | 6 ++--- htdocs/user/card.php | 12 +++++----- htdocs/user/param_ihm.php | 6 ++--- htdocs/webhook/target_agenda.php | 4 ++-- htdocs/webservices/admin/index.php | 4 ++-- 90 files changed, 243 insertions(+), 243 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ca5757dc452..1db1afd124c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -487,24 +487,24 @@ $tabcond[1] = (isModEnabled("societe")); $tabcond[2] = true; $tabcond[3] = true; $tabcond[4] = true; -$tabcond[5] = (isModEnabled("societe") || !empty($conf->adherent->enabled)); +$tabcond[5] = (isModEnabled("societe") || isModEnabled('adherent')); $tabcond[6] = isModEnabled('agenda'); -$tabcond[7] = !empty($conf->tax->enabled); +$tabcond[7] = isModEnabled('tax'); $tabcond[8] = isModEnabled("societe"); $tabcond[9] = true; $tabcond[10] = true; $tabcond[11] = (isModEnabled("societe")); -$tabcond[12] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); -$tabcond[13] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); +$tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); +$tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[15] = true; $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); -$tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled)); +$tabcond[17] = (isModEnabled('deplacement') || isModEnabled('expensereport')); $tabcond[18] = isModEnabled("expedition") || isModEnabled("reception"); $tabcond[19] = isModEnabled("societe"); $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order"); $tabcond[21] = isModEnabled("propal"); -$tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); +$tabcond[22] = (isModEnabled('commande') || isModEnabled("propal")); $tabcond[23] = true; $tabcond[24] = isModEnabled('resource'); $tabcond[25] = isModEnabled('website'); @@ -517,15 +517,15 @@ $tabcond[30] = isModEnabled('label'); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[33] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm'); -$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); -$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); +$tabcond[35] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK); +$tabcond[36] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[37] = isModEnabled("product"); $tabcond[38] = isModEnabled('socialnetworks'); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[41] = isModEnabled('intracommreport'); $tabcond[42] = isModEnabled("product"); -$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; +$tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[44] = isModEnabled('asset'); // List of help for fields (no more used, help is defined into tabcomplete) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 04048ac83db..3c15fc9f48f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -63,10 +63,10 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), - 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled)), + 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), 'TICKET' => !empty($conf->ticket->enabled), ); // Picto diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7f60b2260d7..a60f3f407d1 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langsArray=array("errors", "admin", "mails", "languages"); -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $langsArray[]='members'; } if (!empty($conf->eventorganization->enabled)) { @@ -179,7 +179,7 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); -if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) { +if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) { $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); } if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { @@ -194,7 +194,7 @@ if (!empty($conf->project->enabled)) { if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { $elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); } -if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { +if (isModEnabled('commande') && !empty($user->rights->commande->lire)) { $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); } if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { @@ -224,7 +224,7 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); } -if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { +if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) { $elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport')); } if (isModEnabled('agenda')) { diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index ade62c29081..4103c8cd354 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -180,7 +180,7 @@ $formproduct = new FormProduct($db); $disabled = ''; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); $disabled = ' disabled'; print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); @@ -226,7 +226,7 @@ $found++; print ''; print ''; print '\n"; print "\n"; /* Disabled. Would be better to be managed with a user cookie -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { print ''; print ''; print ''; print '
'; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 861bde0fb51..dfa47df91a3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -47,7 +47,7 @@ if (!empty($conf->recruitment->enabled)) { require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php'; } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } @@ -79,7 +79,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; */ // Update sold -if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { +if (isModEnabled('holiday') && !empty($setupcompanynotcomplete)) { $holidaystatic = new Holiday($db); $result = $holidaystatic->updateBalance(); } @@ -112,7 +112,7 @@ if (!empty($setupcompanynotcomplete)) { print '
'; if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { + if (isModEnabled('holiday') && $user->rights->holiday->read) { $langs->load("holiday"); $listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP'); } @@ -150,7 +150,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel } -if (!empty($conf->holiday->enabled)) { +if (isModEnabled('holiday')) { if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { $holidaystatic = new Holiday($db); $user_id = $user->id; @@ -187,7 +187,7 @@ print '
'; // Latest leave requests -if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) { +if (isModEnabled('holiday') && $user->rights->holiday->read) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,"; $sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 06fdbfba0a5..d5ccb96eaf7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -463,7 +463,7 @@ if (empty($reshook)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -1083,7 +1083,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->state_id = GETPOST('state_id', 'int'); $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST($key, 'alphanohtml'); @@ -1600,7 +1600,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -407,7 +407,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) - || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))) { $langs->load("salaries"); // Salary @@ -635,7 +635,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Latest leave requests - if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) { + if (isModEnabled('holiday') && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) { $holiday = new Holiday($db); $sql = "SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday"; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c4e2715f664..45d7c91a8bb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -262,7 +262,7 @@ if (empty($reshook)) { $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $object->socialnetworks = array(); foreach ($socialnetworks as $key => $value) { if (GETPOST($key, 'alphanohtml')) { @@ -432,7 +432,7 @@ if (empty($reshook)) { $object->office_fax = GETPOST("office_fax", 'alphanohtml'); $object->user_mobile = GETPOST("user_mobile", 'alphanohtml'); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { $object->socialnetworks = array(); foreach ($socialnetworks as $key => $value) { if (GETPOST($key, 'alphanohtml')) { @@ -962,7 +962,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1128,7 +1128,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$langs->trans($value['label']).'
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1544,7 +1544,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Sensitive salary/value information if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates || (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall")) - || (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) { + || (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) { $langs->load("salaries"); // Salary @@ -2258,7 +2258,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Holiday request validator - if (!empty($conf->holiday->enabled)) { + if (isModEnabled('holiday')) { print '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -2507,7 +2507,7 @@ if ($action == 'create' || $action == 'adduserldap') { } print '
'.$langs->trans($value['label']).'
'.$langs->trans("DeStockOnValidateOrder").''; -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); } else { @@ -763,7 +763,7 @@ print "
' . $langs->trans("ShowAllBatchByDefault") . ''; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index e1899b35a56..c4a8790896e 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -62,13 +62,13 @@ $workflowcodes = array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'family'=>'create', 'position'=>10, - 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), + 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( @@ -84,7 +84,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>30, - 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), 'picto'=>'propal', 'warning'=>'' ), @@ -100,19 +100,19 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, - 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, - 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), 'picto'=>'order' ), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), + 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')), 'picto'=>'order', 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 3ab2b63ad3f..ea9e5efca76 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -179,7 +179,7 @@ class BlockedLog } */ - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index db9f28c7763..50aaca466e2 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -201,7 +201,7 @@ class CActionComm if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) { $qualified = 1; } - if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { + if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3e388677605..267b84285ee 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -47,7 +47,7 @@ if (isModEnabled('facture')) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("expedition")) { @@ -56,7 +56,7 @@ if (isModEnabled("expedition")) { if (!empty($conf->contrat->enabled)) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->ficheinter->enabled)) { @@ -69,7 +69,7 @@ $langs->loadLangs(array('companies', 'banks')); if (!empty($conf->contrat->enabled)) { $langs->load("contracts"); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $langs->load("orders"); } if (isModEnabled("expedition")) { @@ -510,7 +510,7 @@ if ($object->id > 0) { } if ($object->client) { - if (!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { + if (isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { print ''."\n"; print '
'; @@ -621,7 +621,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $langs->load("users"); @@ -718,7 +718,7 @@ if ($object->id > 0) { } } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { // Box commandes $tmp = $object->getOutstandingOrders(); $outstandingOpened = $tmp['opened']; @@ -913,7 +913,7 @@ if ($object->id > 0) { /* * Latest orders */ - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $param =""; $sql = "SELECT s.nom, s.rowid"; @@ -1553,7 +1553,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status == 1) { + if (isModEnabled('commande') && $user->rights->commande->creer && $object->status == 1) { $langs->load("orders"); print ''; } @@ -1570,7 +1570,7 @@ if ($object->id > 0) { // Add invoice if ($user->socid == 0) { - if (!empty($conf->deplacement->enabled) && $object->status == 1) { + if (isModEnabled('deplacement') && $object->status == 1) { $langs->load("trips"); print ''; } @@ -1581,7 +1581,7 @@ if ($object->id > 0) { } else { $langs->loadLangs(array("orders", "bills")); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if ($object->client != 0 && $object->client != 2) { if (!empty($orders2invoice) && $orders2invoice > 0) { print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 9eb37d80799..419f85cb28f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -96,7 +96,7 @@ if (isModEnabled("propal")) { if (!empty($conf->supplier_proposal->enabled)) { $supplierproposalstatic = new SupplierProposal($db); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $orderstatic = new Commande($db); } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { @@ -323,7 +323,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa * Draft customer orders */ -if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { +if (isModEnabled('commande') && $user->rights->commande->lire) { $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -1007,7 +1007,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) { /* * Opened (validated) order */ -if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { +if (isModEnabled('commande') && $user->rights->commande->lire) { $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e02ff5d8875..a0b181230fa 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1792,7 +1792,7 @@ if ($action == 'create') { // Delivery delay print '
'.$langs->trans('AvailabilityPeriod'); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print ' ('.$langs->trans('AfterOrder').')'; } print ''; @@ -2441,7 +2441,7 @@ if ($action == 'create') { // Delivery delay print '
'; print ''; @@ -1498,7 +1498,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->commande->enabled) || isModEnabled("expedition")) { + if (isModEnabled('commande') || isModEnabled("expedition")) { print ''; } // Customer orders - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $nblines++; $ret = $product->load_stats_commande($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 8e514a505bf..ba71d22b7f8 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -125,9 +125,9 @@ function project_prepare_head(Project $project, $moreparam = '') } if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) - || isModEnabled("propal") || !empty($conf->commande->enabled) + || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('facture') || !empty($conf->contrat->enabled) - || !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { + || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -141,7 +141,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("propal")) { $nbElements += $project->getElementCount('propal', 'propal'); } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $nbElements += $project->getElementCount('order', 'commande'); } if (isModEnabled('facture')) { @@ -171,10 +171,10 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->mrp->enabled)) { $nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project'); } - if (!empty($conf->deplacement->enabled)) { + if (isModEnabled('deplacement')) { $nbElements += $project->getElementCount('trip', 'deplacement'); } - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $nbElements += $project->getElementCount('expensereport', 'expensereport'); } if (!empty($conf->don->enabled)) { @@ -183,7 +183,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->loan->enabled)) { $nbElements += $project->getElementCount('loan', 'loan'); } - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $nbElements += $project->getElementCount('chargesociales', 'chargesociales'); } if (!empty($conf->project->enabled)) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 19578ec9fe3..aef55e09bd6 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -143,7 +143,7 @@ function user_prepare_head(User $object) if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read)) - || (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) + || (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) ) { // Bank diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 2e31bdef7db..73606987d9d 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules if (isModEnabled("societe")) { $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; } - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $typeexample .= ($typeexample ? " / " : "")."3=Member"; } if (isModEnabled("societe")) { @@ -297,7 +297,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_label[$r] = 'CatMemberList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->adherent->enabled)'; + $this->export_enabled[$r] = 'isModEnabled('adherent')'; $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); @@ -527,7 +527,7 @@ class modCategorie extends DolibarrModules } // 3 Members - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $r++; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_label[$r] = "CatMembersLinks"; // Translation key diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 7aa9abb3bff..87ea6303742 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -266,7 +266,7 @@ class modStock extends DolibarrModules $this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')'; // Export stock including batch number - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch @@ -340,7 +340,7 @@ class modStock extends DolibarrModules 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product' ); // We define here only fields that use another icon that the one defined into export_icon - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $this->export_fields_array[$r]['sm.batch'] = 'Batch'; $this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; $this->export_entities_array[$r]['sm.batch'] = 'movement'; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 420dfd61909..beec387020a 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -46,7 +46,7 @@ if (isModEnabled('facture')) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -61,7 +61,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->ficheinter->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } if (isModEnabled('agenda')) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 8433aaa6331..07bd3ee03ab 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -47,7 +47,7 @@ if (isModEnabled('facture')) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -62,7 +62,7 @@ if (!empty($conf->contrat->enabled)) { if (!empty($conf->ficheinter->enabled)) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } if (isModEnabled('agenda')) { diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 7722698593c..87a6bcf0e38 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -531,7 +531,7 @@ class pdf_eagle extends ModelePdfStockTransfer $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut // Lot / série - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $pdf->SetXY($this->posxlot, $curY); $pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C'); } @@ -813,7 +813,7 @@ class pdf_eagle extends ModelePdfStockTransfer $pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); } - if (!empty($conf->productbatch->enabled) && $this->atLeastOneBatch) { + if (isModEnabled('productbatch') && $this->atLeastOneBatch) { $pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxlot, $tab_top + 1); diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 657d32a0a36..1615dbe87ed 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -30,7 +30,7 @@ print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'free')."

\n"; -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'order')."
\n"; @@ -96,7 +96,7 @@ if (!empty($conf->contrat->enabled)) { } print '
'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'membersubscription')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 9a8414c7a69..49f2873f472 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -71,7 +71,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Proposals to order if ($action == 'PROPAL_CLOSE_SIGNED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { + if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { $object->fetchObjectLinked(); if (!empty($object->linkedObjectsIds['commande'])) { setEventMessages($langs->trans("OrderExists"), null, 'warnings'); @@ -142,7 +142,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (!empty($conf->commande->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { + if (isModEnabled('commande') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -272,7 +272,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_PAYED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { + if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -296,7 +296,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (!empty($conf->commande->enabled) && isModEnabled("expedition") && !empty($conf->workflow->enabled) && + if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) && ( (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 8f25461eb64..26b71ce60e1 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -50,7 +50,7 @@ if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) { 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), ); } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $arrayofparameters['Member'] = array( 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), ); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 108f81751b3..40d73b0f298 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -308,7 +308,7 @@ if ($action == 'create') { // Create. Seems to no be used * Delivery */ - if ($typeobject == 'commande' && $expedition->origin_id > 0 && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($expedition->origin_id); } @@ -400,7 +400,7 @@ if ($action == 'create') { // Create. Seems to no be used */ // Document origine - if ($typeobject == 'commande' && $expedition->origin_id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) { print '
'; $order = new Commande($db); $order->fetch($expedition->origin_id); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 9af06f87541..55f6293a9d2 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index c37ce4690f4..c7a4a570a5c 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -322,7 +322,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } if (isModEnabled('facture')) { @@ -338,7 +338,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) { $rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } - if (!empty($conf->tax->enabled)) { + if (isModEnabled('tax')) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT"))); @@ -355,7 +355,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 7572dd3f3d8..ac986ad00f4 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -125,7 +125,7 @@ if (isModEnabled("propal")) { if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } if (isModEnabled('facture')) { @@ -140,7 +140,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); } -if (!empty($conf->tax->enabled)) { +if (isModEnabled('tax')) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); } if (!empty($conf->project->enabled)) { @@ -149,7 +149,7 @@ if (!empty($conf->project->enabled)) { if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); } if (isModEnabled('holiday')) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3a0a9869571..333c93fdfd7 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -53,7 +53,7 @@ if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -67,7 +67,7 @@ $langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders' if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -258,7 +258,7 @@ if (empty($reshook)) { $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number + if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; @@ -875,7 +875,7 @@ if ($action == 'create') { // Ref print ''."\n"; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Customer Categories print '"; // Contract - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load('contracts'); print ''; print ''; print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } if (!empty($conf->project->enabled)) { @@ -834,7 +834,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; // Contract - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $langs->load('contracts'); print ''; print ''; print '
'; - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); } else { print $langs->trans('AvailabilityPeriod'); @@ -2826,7 +2826,7 @@ if ($action == 'create') { } // Create a sale order - if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateorder) { print ''.$langs->trans("AddOrder").''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b97bf147dbb..c5b00c3c41e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -71,7 +71,7 @@ if (!empty($conf->incoterm->enabled)) { if (!empty($conf->margin->enabled)) { $langs->load('margins'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 57f61f3d9f7..9ee103911f7 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -92,7 +92,7 @@ if ($tmp) { /* * Draft orders */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -244,7 +244,7 @@ $max = 10; /* * Orders to process */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled)) { /* * Orders that are in process */ -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ba2f410cc9..84dafaba2e8 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2389,7 +2389,7 @@ if ($resql) { $stock_order = 0; $stock_order_supplier = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 839a61b2413..f9c6f4edd3e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2321,7 +2321,7 @@ if (empty($reshook)) { if (!$error) { // Add batchinfo if the detail_batch array is defined - if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 2c7ac145b78..a0834139bd2 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -191,7 +191,7 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index ff7c0051a29..d3b050e5e0b 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1225,7 +1225,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->load_ref_elements(); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande ? $object->ref_commande : (''.$langs->trans("NoContactForAnyOrder").''); print '
'; if (isModEnabled("expedition")) { print $langs->trans("ContactForOrdersOrShipments"); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fff1ba17644..569a155cc99 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -159,7 +159,7 @@ if ($object->thirdparty->client) { if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 439f312bef6..564122f3137 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2116,7 +2116,7 @@ if ($action == 'create') { } } - if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { + if (isModEnabled('commande') && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("orders"); if ($user->rights->commande->creer) { print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 12656518efc..20c2e814d82 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic = new Commande($this->db); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 42a77f14b9c..92a8b471e5f 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -214,7 +214,7 @@ class box_graph_product_distribution extends ModeleBoxes } } - if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { + if (isModEnabled('commande') && !empty($user->rights->commande->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { $langs->load("orders"); @@ -369,7 +369,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } - if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { + if (isModEnabled('commande') || !empty($user->rights->commande->lire)) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 23542999b47..2e25da59564 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 91ce3c93c36..52bc75e1fd1 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 39ae0140ca4..b5472b979a2 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 479d2424f09..716b8ed0482 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); + $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire); } /** diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index f12acbe1901..0c5aa54b5ca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1630,7 +1630,7 @@ class FormMail extends Form if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { $tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; } if (!empty($conf->don->enabled)) { @@ -1639,7 +1639,7 @@ class FormMail extends Form if (isModEnabled('facture')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } if (!empty($conf->contrat->enabled)) { @@ -1647,7 +1647,7 @@ class FormMail extends Form } //Online payement link - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; } if (!empty($conf->don->enabled)) { @@ -1656,7 +1656,7 @@ class FormMail extends Form if (isModEnabled('facture')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index ad9c47f4c48..ad5c07e9a7e 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 32526574294..42d0d96f7a9 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2933,7 +2933,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $original_file = $conf->productbatch->multidir_output[$entity].'/'.$original_file; } } elseif ($modulepart == 'movement' || $modulepart == 'mouvement') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 53204c4cc41..a0e57c173c8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2976,7 +2976,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); } - if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $type = 'AC_EMAIL'; $link = ''; if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) { @@ -3082,7 +3082,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor $htmllink .= '?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">'; $htmllink .= ''; $htmllink .= ''; - if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { + if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) { $addlink = 'AC_SKYPE'; $link = ''; if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) { @@ -7371,7 +7371,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } - if (!empty($conf->adherent->enabled) && (!is_object($object) || $object->element == 'adherent')) { + if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent')) { $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 7e173bd269e..94e14a90267 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -64,14 +64,14 @@ function ldap_prepare_head() $h++; } - if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { + if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][2] = 'members'; $h++; } - if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { + if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][2] = 'memberstypes'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 9a5e9ae56a5..9128be56ea1 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object) $h = 0; $head = array(); - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][2] = 'order'; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a1446bf6964..710b2462afa 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -417,7 +417,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("RefOrder").'
'; - if ($origin == 'commande' && !empty($conf->commande->enabled)) { + if ($origin == 'commande' && isModEnabled('commande')) { print $langs->trans("RefOrder"); } if ($origin == 'propal' && isModEnabled("propal")) { @@ -1033,7 +1033,7 @@ if ($action == 'create') { $i = 0; while ($i < $numAsked) { print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; } $i++; @@ -1552,7 +1552,7 @@ if ($action == 'create') { if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $disabled = ''; - if (!empty($conf->productbatch->enabled) && $product->hasbatch()) { + if (isModEnabled('productbatch') && $product->hasbatch()) { $disabled = 'disabled="disabled"'; } if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. @@ -1714,7 +1714,7 @@ if ($action == 'create') { $totalVolume = $tmparray['volume']; - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1779,7 +1779,7 @@ if ($action == 'create') { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; print ''; @@ -2062,7 +2062,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; } } @@ -2358,7 +2358,7 @@ if ($action == 'create') { } // Batch number managment - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (isset($lines[$i]->detail_batch)) { print ''; print ''; } // Supplier proposals - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { + if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $nblines++; $ret = $product->load_stats_proposal_supplier($socid); if ($ret < 0) { @@ -513,7 +513,7 @@ function show_stats_for_company($product, $socid) } // Contracts - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $nblines++; $ret = $product->load_stats_contrat($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ba71d22b7f8..3d0ab7f083d 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) || isModEnabled("propal") || isModEnabled('commande') - || isModEnabled('facture') || !empty($conf->contrat->enabled) + || isModEnabled('facture') || isModEnabled('contrat') || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) { $nbElements = 0; // Enable caching of thirdrparty count Contacts @@ -150,7 +150,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('facture')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $nbElements += $project->getElementCount('proposal_supplier', 'supplier_proposal'); } if (isModEnabled("supplier_order")) { @@ -159,7 +159,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("supplier_invoice")) { $nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn'); } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $nbElements += $project->getElementCount('contract', 'contrat'); } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index beec387020a..29050c6b780 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -55,7 +55,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 07bd3ee03ab..35f00912143 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -56,7 +56,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 86292ec0ff4..07595012466 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -254,7 +254,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) { print ''."\n"; } -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Customer Categories print '
'; print $langs->trans("RefOrder").''; @@ -2048,7 +2048,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print $langs->trans("WarehouseSource").' - '; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print $langs->trans("Batch"); } print ''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''; @@ -2437,7 +2437,7 @@ if ($action == 'create') { if ($origin && $origin_id > 0) { $colspan++; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $colspan++; } if (!empty($conf->stock->enabled)) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ec7d7ff3cab..b1a767e197d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -965,7 +965,7 @@ class Expedition extends CommonObject } // If product need a batch number, we should not have called this function but addline_batch instead. - if (!empty($conf->productbatch->enabled) && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { + if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH'; return -4; } @@ -1716,7 +1716,7 @@ class Expedition extends CommonObject } // Detail of batch - if (!empty($conf->productbatch->enabled) && $obj->line_id > 0 && $obj->product_tobatch > 0) { + if (isModEnabled('productbatch') && $obj->line_id > 0 && $obj->product_tobatch > 0) { $newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product); if (is_array($newdetailbatch)) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 112d35a63aa..cdf6a982054 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -53,7 +53,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c794a227afa..b90b03a06cb 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonorder.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index cbf961b8ff9..25b26c75852 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1173,7 +1173,7 @@ class ProductFournisseur extends Product $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); $label .= "
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); } diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 2f0f7966679..c7baf022d8e 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -46,7 +46,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks", "receptions")); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -721,7 +721,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -820,7 +820,7 @@ if ($id > 0 || !empty($ref)) { $linktoprod = $tmpproduct->getNomUrl(1); $linktoprod .= ' - '.$objp->label."\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($objp->tobatch) { // Product print ''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { + if (isModEnabled('productbatch') && $objp->tobatch > 0) { $type = 'batch'; print ''; // Qty to dispatch @@ -981,7 +981,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -1227,7 +1227,7 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($objp->batch) { include_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; $lot = new Productlot($db); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index dfa47df91a3..a86783db2d3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (!empty($conf->recruitment->enabled)) { @@ -116,11 +116,11 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel $langs->load("holiday"); $listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP'); } - if (!empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { + if (isModEnabled('deplacement') && $user->rights->deplacement->lire) { $langs->load("trips"); $listofsearchfields['search_deplacement'] = array('text'=>'ExpenseReport'); } - if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { + if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { $langs->load("trips"); $listofsearchfields['search_expensereport'] = array('text'=>'ExpenseReport'); } @@ -270,7 +270,7 @@ if (isModEnabled('holiday') && $user->rights->holiday->read) { // Latest expense report -if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { +if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,"; $sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a7216b6ad72..02b3ce48ca4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2024,7 +2024,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6a0fda06cb0..989e856b690 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2432,7 +2432,7 @@ function printDropdownQuickadd() "title" => "MenuNewMember@members", "name" => "Adherent@members", "picto" => "object_member", - "activation" => !empty($conf->adherent->enabled) && $user->hasRight("adherent", "write"), // vs hooking + "activation" => isModEnabled('adherent') && $user->hasRight("adherent", "write"), // vs hooking "position" => 5, ), array( @@ -2465,7 +2465,7 @@ function printDropdownQuickadd() "title" => "NewOrder@orders", "name" => "Order@orders", "picto" => "object_order", - "activation" => !empty($conf->commande->enabled) && $user->hasRight("commande", "write"), // vs hooking + "activation" => isModEnabled('commande') && $user->hasRight("commande", "write"), // vs hooking "position" => 40, ), array( diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 1384852ace8..19533e05c06 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -119,9 +119,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 0f734df6ae9..88788da8b43 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -278,7 +278,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref), null, 'errors'); $error++; } - if (!empty($conf->productbatch->enabled) && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { + if (isModEnabled('productbatch') && $tmpproduct->status_batch && (!GETPOST('batchtoproduce-'.$line->id.'-'.$i))) { $langs->load("errors"); setEventMessages($langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref), null, 'errors'); $error++; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5f0159ce567..d9b943fb40f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -62,7 +62,7 @@ if (isModEnabled("propal")) { if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -82,7 +82,7 @@ if (!empty($conf->stock->enabled)) { if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -1353,7 +1353,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Batch number management - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; @@ -944,7 +944,7 @@ if ($object->id > 0) { print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; @@ -1022,7 +1022,7 @@ if ($object->id > 0) { print $product_static->getNomUrl(1).' - '.$product_static->label; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print '"; print ''; print ''; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; /*if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -204,7 +204,7 @@ if ($resql) { print '\n"; - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 32c95537947..c31bbbc3101 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -44,7 +44,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -106,9 +106,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>$langs->trans("Date"), 'checked'=>1), 'p.ref'=>array('label'=>$langs->trans("ProductRef"), 'checked'=>1, 'css'=>'maxwidth100'), 'p.label'=>array('label'=>$langs->trans("ProductLabel"), 'checked'=>1), - 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), @@ -273,7 +273,7 @@ if ($action == "transfert_stock" && !$cancel) { $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $product = new Product($db); $result = $product->fetch($product_id); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 9f097e1c4e3..d2639000270 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -45,7 +45,7 @@ if (!empty($conf->project->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'orders')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -125,9 +125,9 @@ $arrayfields = array( 'm.datem'=>array('label'=>"Date", 'checked'=>1, 'position'=>2), 'p.ref'=>array('label'=>"ProductRef", 'checked'=>1, 'css'=>'maxwidth100', 'position'=>3), 'p.label'=>array('label'=>"ProductLabel", 'checked'=>0, 'position'=>5), - 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(!empty($conf->productbatch->enabled))), - 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(!empty($conf->productbatch->enabled))), + 'm.batch'=>array('label'=>"BatchNumberShort", 'checked'=>1, 'position'=>8, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.eatby'=>array('label'=>"EatByDate", 'checked'=>0, 'position'=>9, 'enabled'=>(isModEnabled('productbatch'))), + 'pl.sellby'=>array('label'=>"SellByDate", 'checked'=>0, 'position'=>10, 'enabled'=>(isModEnabled('productbatch'))), 'e.ref'=>array('label'=>"Warehouse", 'checked'=>1, 'position'=>100, 'enabled'=>(!($id > 0))), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>"Author", 'checked'=>0, 'position'=>120), 'm.inventorycode'=>array('label'=>"InventoryCodeShort", 'checked'=>1, 'position'=>130), @@ -448,7 +448,7 @@ if ($action == "transfert_stock" && !$cancel) { $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $product = new Product($db); $result = $product->fetch($product_id); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 51b12d4a6b1..ca3624fe147 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class.php'; -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -56,7 +56,7 @@ if (!empty($conf->variants->enabled)) { // Load translation files required by the page $langs->loadlangs(array('products', 'suppliers', 'orders', 'bills', 'stocks', 'sendings', 'margins')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -248,7 +248,7 @@ if ($action == "correct_stock" && !$cancel) { $action = 'correction'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $object = new Product($db); $result = $object->fetch($id); @@ -345,7 +345,7 @@ if ($action == "transfert_stock" && !$cancel) { $error++; $action = 'transfert'; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $object = new Product($db); $result = $object->fetch($id); @@ -761,7 +761,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
'; // Number of customer orders running - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { if ($found) { $helpondiff .= '
'; } else { @@ -959,7 +959,7 @@ if (!$variants) { print ''; print ''; - if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { + if ((isModEnabled('productbatch')) && $object->hasbatch()) { $colspan = 3; print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; @@ -1216,7 +1216,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (!empty($product->status_batch)) { print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { @@ -1358,7 +1358,7 @@ if ($action == 'create') { $totalVolume = $tmparray['volume']; - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1427,7 +1427,7 @@ if ($action == 'create') { print '
'; $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index c8fc0ff35be..a6a6a1b0e3b 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 7234e54e8f1..9d5c5b70fe4 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->categorie->enabled)) { @@ -353,7 +353,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $langs->load("users"); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans("Description").''.$langs->trans("batch_number").''.$langs->trans("SellByDate").''; @@ -869,7 +869,7 @@ if ($id > 0 || !empty($ref)) { // Already dispatched print ''.$products_dispatched[$objp->rowid].''; print ''; - if (!empty($conf->productbatch->enabled) && $objp->tobatch > 0) { + if (isModEnabled('productbatch') && $objp->tobatch > 0) { $type = 'batch'; print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); } else { @@ -1162,7 +1162,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("Product").''.$langs->trans("DateCreation").''.$langs->trans("DateDeliveryPlanned").''.$langs->trans("batch_number").''.$langs->trans("SellByDate").''.dol_print_date($db->jdate($objp->datec), 'day').''.dol_print_date($db->jdate($objp->date_delivery), 'day').'
'.$langs->trans("ManageLotSerial").''; $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); @@ -2368,7 +2368,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Batch number management (to batch) - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { print '
'.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); @@ -2823,7 +2823,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == } // Commande - if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { + if (isModEnabled('commande') && $user->rights->commande->creer) { $commande = new Commande($db); $langs->load("orders"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1a157ed9171..360709dc5a0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4943,7 +4943,7 @@ class Product extends CommonObject $label .= '
'.$langs->trans('ProductLabel').': '.$this->label; } if ($this->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); $label .= "
".$langs->trans("ManageLotSerial").': '.$this->getLibStatut(0, 2); } @@ -5141,7 +5141,7 @@ class Product extends CommonObject $labelStatus = $labelStatusShort = ''; $langs->load('products'); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -5456,7 +5456,7 @@ class Product extends CommonObject //dol_syslog("load_virtual_stock"); - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $result = $this->load_stats_commande(0, '1,2', 1); if ($result < 0) { dol_print_error($this->db, $this->error); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index f7b3ddd5ac6..c1ef43c5c02 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -348,7 +348,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); } - if (!$error && !empty($conf->productbatch->enabled)) { + if (!$error && isModEnabled('productbatch')) { $tmpproduct = new Product($db); $result = $tmpproduct->fetch($fk_product); @@ -608,7 +608,7 @@ if ($object->id > 0) { if (!empty($conf->use_javascript_ajax)) { if ($permissiontoadd) { // Link to launch scan tool - if (isModEnabled('barcode') || !empty($conf->productbatch->enabled)) { + if (isModEnabled('barcode') || isModEnabled('productbatch')) { print ''.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").''; } @@ -906,7 +906,7 @@ if ($object->id > 0) { print '
'.$langs->trans("Warehouse").''.$langs->trans("Product").''; print $langs->trans("Batch"); print ''; print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOST('fk_product', 'int') : $object->fk_product), 'fk_product', '', 0, 0, -1, 2, '', 0, null, 0, '1', 0, 'maxwidth300'); print ''; print ''; print ''; $batch_static = new Productlot($db); $res = $batch_static->fetch(0, $product_static->id, $obj->batch); @@ -1039,7 +1039,7 @@ if ($object->id > 0) { $valuetoshow = $obj->qty_stock; // For inventory not yet close, we overwrite with the real value in stock now if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { - if (!empty($conf->productbatch->enabled) && $product_static->hasbatch()) { + if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->real; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 38c3c0c80ea..dcea4f4b8f7 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -49,7 +49,7 @@ if (!empty($conf->categorie->enabled)) { // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'suppliers', 'companies', 'margins')); -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load("productbatch"); } @@ -238,7 +238,7 @@ $arrayfields = array( 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51), 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52), 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53), - 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60), + 'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(isModEnabled('productbatch')), 'position'=>60), 'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100), 'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101), $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400), diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5653a564b9e..8edb3be32da 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -272,7 +272,7 @@ class MouvementStock extends CommonObject } // Test if product require batch data. If yes, and there is not or values are not correct, we throw an error. - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if (empty($batch)) { $langs->load("errors"); $this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref); @@ -384,7 +384,7 @@ class MouvementStock extends CommonObject // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { $foundforbatch = 0; $qtyisnotenough = 0; @@ -544,7 +544,7 @@ class MouvementStock extends CommonObject } // Update detail of stock for the lot. - if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if ($id_product_batch > 0) { $result = $this->createBatch($id_product_batch, $qty); } else { @@ -596,7 +596,7 @@ class MouvementStock extends CommonObject // End call triggers // Check unicity for serial numbered equipments once all movement were done. - if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (!$error && isModEnabled('productbatch') && $product->hasbatch() && !$skip_batch) { if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty if ($this->getBatchCount($fk_product, $batch) > 1) { $error++; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 6efe9f0d9e8..0f9deb92772 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -164,7 +164,7 @@ if ($resql) { print "
'.$langs->trans("LastMovements", min($num, $max)).''.$langs->trans("Product").''.$langs->trans("Batch").''.$langs->trans("SellByDate").''; print $producttmp->getNomUrl(1); print "'; print $tmplotstatic->getNomUrl(0, 'nolink'); print '
'; if (!empty($conf->use_javascript_ajax)) { @@ -1029,7 +1029,7 @@ if (!$variants) { // Warehouse print ''; print $entrepotstatic->getNomUrl(1); - if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) { + if (!empty($conf->use_javascript_ajax) && isModEnabled('productbatch') && $object->hasbatch()) { print ''; print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); print ''; @@ -1096,7 +1096,7 @@ if (!$variants) { $totalvalue = $totalvalue + ($object->pmp * $obj->reel); $totalvaluesell = $totalvaluesell + ($object->price * $obj->reel); // Batch Detail - if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { + if ((isModEnabled('productbatch')) && $object->hasbatch()) { $details = Productbatch::findAll($db, $obj->product_stock_id, 0, $object->id); if ($details < 0) { dol_print_error($db); diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 89ba063e8d7..842aa83bd07 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -85,7 +85,7 @@ if ($id || $ref) { $object->fetch($id, $productid, $batch); $object->ref = $object->batch; // Old system for document management ( it uses $object->ref) - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart); $filearray = dol_dir_list($upload_dir, "files"); if (empty($filearray)) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index f2821eab8ce..1eb8a444d8a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -413,7 +413,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre $sql .= ', s.fk_product'; if ($usevirtualstock) { - if (!empty($conf->commande->enabled)) { + if (isModEnabled('commande')) { $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(!empty($conf->global->STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE) ? 'stock' : 'commande').")"; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index f2ecfa1d73c..819fa404d52 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -93,7 +93,7 @@ print '
'.$langs->trans("NumberOfUnit").''; // Serial / Eat-by date -if (!empty($conf->productbatch->enabled) && +if (isModEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 246ae6b7ba8..bc182efa3f2 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1348,7 +1348,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("propal"); print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->commande->enabled) && $user->rights->commande->creer) { + if (isModEnabled('commande') && $user->rights->commande->creer) { $langs->load("orders"); print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } @@ -1376,7 +1376,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("contracts"); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) { + if (isModEnabled('expensereport') && $user->rights->expensereport->creer) { $langs->load("trips"); print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a96ba8c2819..57583a538fb 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -46,7 +46,7 @@ if (isModEnabled('facture')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (!empty($conf->supplier_proposal->enabled)) { @@ -67,10 +67,10 @@ if (!empty($conf->ficheinter->enabled)) { if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (isModEnabled('agenda')) { @@ -86,7 +86,7 @@ if (!empty($conf->loan->enabled)) { if (!empty($conf->stock->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; } -if (!empty($conf->tax->enabled)) { +if (isModEnabled('tax')) { require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; } if (isModEnabled("banque")) { @@ -107,7 +107,7 @@ $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { $langs->load("orders"); } if (isModEnabled("propal")) { @@ -116,10 +116,10 @@ if (isModEnabled("propal")) { if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); } -if (!empty($conf->deplacement->enabled)) { +if (isModEnabled('deplacement')) { $langs->load("trips"); } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { $langs->load("trips"); } if (!empty($conf->don->enabled)) { diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index e3532fb6471..8964cca8c19 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { } $object->info($object->id); } -$agenda = (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; +$agenda = (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) ? '/'.$langs->trans("Agenda") : ''; $title = $langs->trans('Events').$agenda.' - '.$object->ref.' '.$object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 00f534a388c..6ca72ea2d97 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -54,7 +54,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } if (!empty($conf->project->enabled)) { @@ -67,7 +67,7 @@ $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'order if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } -if (!empty($conf->productbatch->enabled)) { +if (isModEnabled('productbatch')) { $langs->load('productbatch'); } @@ -626,7 +626,7 @@ if (empty($reshook)) { $line->qty = GETPOST($qty, 'int'); $line->comment = GETPOST($comment, 'alpha'); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $batch = "batch".$line_id; $dlc = "dlc".$line_id; $dluo = "dluo".$line_id; @@ -1041,7 +1041,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print ''.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'.$langs->trans("batch_number").''.$langs->trans("SellByDate").'
'; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { print ''; print ''; @@ -1721,7 +1721,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print ''; } } @@ -1957,7 +1957,7 @@ if ($action == 'create') { } // Batch number managment - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { if (isset($lines[$i]->batch)) { print ''; print ' -adherent->enabled)) { ?> + diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index bfbf6271711..98979c917d4 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -174,7 +174,7 @@ if ($this->control->tpl['action_delete']) { -adherent->enabled)) { ?> + diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d5ccb96eaf7..331fb58ae9c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -68,7 +68,7 @@ if (! empty($conf->eventorganization->enabled)) { $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $langs->load("members"); } if (!empty($conf->categorie->enabled)) { @@ -3035,7 +3035,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print ''; print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print ''; print '\n"; // Expense report validator - if (!empty($conf->expensereport->enabled)) { + if (isModEnabled('expensereport')) { print ''; print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; // Tags-Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { print '"; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 267b84285ee..27391a4cd3d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -53,7 +53,7 @@ if (isModEnabled('commande')) { if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (isModEnabled('adherent')) { @@ -66,7 +66,7 @@ if (!empty($conf->ficheinter->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'banks')); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $langs->load("contracts"); } if (isModEnabled('commande')) { @@ -605,7 +605,7 @@ if ($object->id > 0) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load("categories"); print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $arrayselected = array(); print ''; print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; @@ -1471,7 +1471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print $langs->trans("RefOrder").''; @@ -1700,7 +1700,7 @@ if ($action == 'create') { if (!empty($conf->stock->enabled)) { print $langs->trans("WarehouseSource").' - '; } - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { print $langs->trans("Batch"); } print ''.$langs->trans("WarehouseSource").''.$langs->trans("Batch").''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ceb71624292..85071a49b94 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } @@ -849,7 +849,7 @@ class Reception extends CommonObject // Check batch is set $product = new Product($this->db); $product->fetch($fk_product); - if (!empty($conf->productbatch->enabled)) { + if (isModEnabled('productbatch')) { $langs->load("errors"); if (!empty($product->status_batch) && empty($batch)) { $this->error = $langs->trans('ErrorProductNeedBatchNumber', $product->ref); diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index fadf222aa3e..cb2c84ebd76 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 5a26946913c..e71ee255981 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -342,7 +342,7 @@ abstract class ActionsCardCommon } // Linked member - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 0c6f2caf1e1..d1ba18f82fd 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -247,7 +247,7 @@ for ($i = 1; $i <= 4; $i++) { control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>
'.$langs->trans("LinkedToDolibarrMember").''; @@ -3108,7 +3108,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $adh = new Adherent($db); $result = $adh->fetch('', '', $object->id); if ($result == 0 && ($object->client == 1 || $object->client == 3) && !empty($conf->global->MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS)) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ee2d71f6d12..3f7bb239c51 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -214,8 +214,8 @@ class Societe extends CommonObject 'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305), 'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308), 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1), - 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), - 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), + 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), + 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330), 'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335), 'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340), @@ -1561,7 +1561,7 @@ class Societe extends CommonObject if (!$error && $nbrowsaffected) { // Update information on linked member if it is an update - if (!$nosyncmember && !empty($conf->adherent->enabled)) { + if (!$nosyncmember && isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; dol_syslog(get_class($this)."::update update linked member"); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 53408fd00ff..a8f250f29d5 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -170,7 +170,7 @@ if ($object->client) { if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 1bc64658735..14c1347c98c 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 5b9bd1046ef..f22a5fb440b 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -791,7 +791,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled("propal") && $user->rights->propal->lire) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + if (isModEnabled('commande') && $user->rights->commande->lire) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } if (isModEnabled('facture') && $user->rights->facture->lire) { diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index a061933ba11..1767973a001 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { } // additionnal list with adherents of company - if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { + if (isModEnabled('adherent') && $user->rights->adherent->lire) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0dd8a7f9d08..2c6dd47b234 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; if (isModEnabled('holiday')) { require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; } -if (!empty($conf->expensereport->enabled)) { +if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (!empty($conf->salaries->enabled)) { @@ -361,7 +361,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -691,7 +691,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } // Latest expense report - if (!empty($conf->expensereport->enabled) && + if (isModEnabled('expensereport') && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { $exp = new ExpenseReport($db); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 45d7c91a8bb..7ae7bb70566 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (!empty($conf->ldap->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (!empty($conf->categorie->enabled)) { @@ -950,7 +950,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1498,7 +1498,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1707,7 +1707,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; @@ -2239,7 +2239,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
'; $text = $langs->trans("ForceUserExpenseValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -2629,7 +2629,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (!empty($conf->adherent->enabled)) { + if (isModEnabled('adherent')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 6d5a27cd8ba..1df44179461 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -192,19 +192,19 @@ if (isModEnabled("societe")) { if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } -if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) { +if (isModEnabled('holiday') || isModEnabled('expensereport')) { $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus } if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; } -if (isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { +if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) { $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea'; } if (isModEnabled('agenda')) { diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index ccc61d806af..a8d110eb081 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -227,7 +227,7 @@ if ($object->id > 0) { print '
'; - if (!empty($conf->agenda->enabled)) { + if (isModEnabled('agenda')) { if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { print ''.$langs->trans("AddAction").''; } else { @@ -237,7 +237,7 @@ if ($object->id > 0) { print '
'; - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { $param = '&id='.$object->id.'&socid='.$socid; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 97b8a4768a0..79d222f7e84 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -103,10 +103,10 @@ $webservices = array( 'thirdparty' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', - 'order' => '!empty($conf->commande->enabled)', + 'order' => 'isModEnabled('commande')', 'invoice' => 'isModEnabled("facture")', 'supplier_invoice' => 'isModEnabled("fournisseur")', - 'actioncomm' => '!empty($conf->agenda->enabled)', + 'actioncomm' => 'isModEnabled('agenda')', 'category' => '!empty($conf->categorie->enabled)', 'project' => '!empty($conf->project->enabled)', 'other' => '' From 6cf7a80ce3e887d05495af51f6a4006f16508e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 21:57:05 +0200 Subject: [PATCH 12/60] fix php8 warnings --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1db1afd124c..3503421d7fe 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2022 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2020-2022 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -496,7 +496,7 @@ $tabcond[10] = true; $tabcond[11] = (isModEnabled("societe")); $tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); -$tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); +$tabcond[14] = (isModEnabled("product") && (isModEnabled('ecotax') || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[15] = true; $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); $tabcond[17] = (isModEnabled('deplacement') || isModEnabled('expensereport')); From e71692e7456bb82bf131c68b552ac81b5ef9f08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:02:31 +0200 Subject: [PATCH 13/60] fix php8 warnings --- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/mails_templates.php | 4 ++-- htdocs/admin/workflow.php | 2 +- htdocs/comm/action/card.php | 6 +++--- htdocs/comm/card.php | 8 ++++---- htdocs/comm/index.php | 6 +++--- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/list.php | 4 ++-- htdocs/commande/card.php | 2 +- htdocs/commande/list.php | 4 ++-- htdocs/compta/facture/card.php | 2 +- .../stats/supplier_turnover_by_thirdparty.php | 2 +- .../canvas/actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 10 +++++----- htdocs/contact/consumption.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/core/class/html.formmail.class.php | 4 ++-- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/product.lib.php | 4 ++-- htdocs/core/lib/project.lib.php | 6 +++--- .../doc/doc_generic_project_odt.modules.php | 2 +- .../task/doc/doc_generic_task_odt.modules.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 6 +++--- htdocs/core/tpl/notes.tpl.php | 6 +++--- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 2 +- ...erface_20_modWorkflow_WorkflowManager.class.php | 2 +- htdocs/ecm/index_auto.php | 4 ++-- htdocs/ecm/search.php | 4 ++-- htdocs/expedition/list.php | 4 ++-- htdocs/fichinter/card-rec.php | 14 +++++++------- htdocs/fichinter/card.php | 4 ++-- htdocs/fichinter/list.php | 10 +++++----- htdocs/fourn/card.php | 8 ++++---- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/list.php | 4 ++-- .../knowledgemanagement/knowledgerecord_card.php | 4 ++-- .../knowledgemanagement/knowledgerecord_list.php | 4 ++-- htdocs/main.inc.php | 4 ++-- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 6 +++--- htdocs/product/index.php | 2 +- htdocs/product/inventory/list.php | 4 ++-- htdocs/product/list.php | 4 ++-- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 2 +- htdocs/product/stock/card.php | 2 +- htdocs/product/stock/list.php | 10 +++++----- htdocs/projet/card.php | 6 +++--- htdocs/projet/element.php | 6 +++--- htdocs/projet/list.php | 10 +++++----- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/societe/card.php | 12 ++++++------ htdocs/societe/consumption.php | 2 +- htdocs/societe/contact.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 4 ++-- htdocs/societe/paymentmodes.php | 2 +- htdocs/supplier_proposal/index.php | 4 ++-- htdocs/supplier_proposal/list.php | 2 +- htdocs/user/card.php | 8 ++++---- htdocs/user/list.php | 4 ++-- htdocs/user/param_ihm.php | 2 +- htdocs/webservices/admin/index.php | 2 +- htdocs/website/index.php | 8 ++++---- 77 files changed, 151 insertions(+), 151 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 3c15fc9f48f..3c3cd731a7d 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -63,7 +63,7 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index a60f3f407d1..f53e8c6b0d0 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -209,7 +209,7 @@ if (isModEnabled("reception")) { if (!empty($conf->ficheinter->enabled)) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); } if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) { @@ -218,7 +218,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande- if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } -if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { +if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index c4a8790896e..e29a351a705 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -123,7 +123,7 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array( 'family'=>'classify_supplier_proposal', 'position'=>60, - 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), + 'enabled'=>(isModEnabled('supplier_proposal') && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), 'picto'=>'supplier_proposal', 'warning'=>'' ), diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 6f6ddc5383e..0d7953db900 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1362,7 +1362,7 @@ if ($action == 'create') { $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); @@ -1870,7 +1870,7 @@ if ($id > 0) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2285,7 +2285,7 @@ if ($id > 0) { } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1); print "
'.$langs->trans("CustomersCategoriesShort").''; @@ -1122,7 +1122,7 @@ if ($object->id > 0) { /* * Latest contracts */ - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,"; $sql .= " c.last_main_doc, c.model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 419f85cb28f..c2852cd45c9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -93,7 +93,7 @@ $companystatic = new Societe($db); if (isModEnabled("propal")) { $propalstatic = new Propal($db); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $supplierproposalstatic = new SupplierProposal($db); } if (isModEnabled('commande')) { @@ -226,7 +226,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) { * Draft supplier proposals */ -if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { +if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -810,7 +810,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM /* * Latest contracts */ -if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT $staticcontrat = new Contrat($db); $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index bd052f4161e..8f0a2b38c7d 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('mails', 'companies')); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index eb1b50cee1b..ed1fa3f523e 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -980,7 +980,7 @@ if ($action == 'create') { } if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { - if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { + if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { print ''.$langs->trans("EditWithEditor").''; } else { print ''.$langs->trans("EditWithTextEditor").''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a0b181230fa..f0e1e57249e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2850,7 +2850,7 @@ if ($action == 'create') { } // Create contract - if (!empty($conf->contrat->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6b717d3ea6f..31c4489d47f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1057,7 +1057,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view products - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1065,7 +1065,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1); $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c5b00c3c41e..507a24fd758 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2836,7 +2836,7 @@ if ($action == 'create' && $usercancreate) { } // Create contract - if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { + if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); if ($user->hasRight('contrat', 'creer')) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 84dafaba2e8..7acd7c78261 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1343,7 +1343,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1351,7 +1351,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f9c6f4edd3e..04c6df7ff1e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5511,7 +5511,7 @@ if ($action == 'create') { // Create contract if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) { - if (!empty($conf->contrat->enabled) && $object->statut == Facture::STATUS_VALIDATED) { + if (isModEnabled('contrat') && $object->statut == Facture::STATUS_VALIDATED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index 2a405ba870f..28e932dcb4a 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -587,7 +587,7 @@ if (count($amount)) { // Other stats print '
'; - if (!empty($conf->supplier_proposal->enabled) && $key > 0) { + if (isModEnabled('supplier_proposal') && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) { diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index a0834139bd2..c4bfc127262 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -201,7 +201,7 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $i++; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d3b050e5e0b..3028a3719f1 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -892,7 +892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); @@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; @@ -1237,7 +1237,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").''); print '
'; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''; print ''; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 569a155cc99..e4cc743159e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -165,7 +165,7 @@ if ($object->thirdparty->client) { if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6d66f70ceeb..ec56b4f7c2a 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -734,7 +734,7 @@ if ($search_firstlast_only) { } $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ContactCategoriesShort'); diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 62b60d9a091..d537934a299 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -239,7 +239,7 @@ print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); @@ -1514,7 +1514,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print '

"; // Draft contracts -if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { +if (isModEnabled('contrat') && $user->rights->contrat->lire) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 5ceec0a4cb9..0630f664b8d 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -571,7 +571,7 @@ if ($user->rights->user->user->lire) { $moreforfilter .= ''; } // If the user can view categories of products -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2c438fdd98c..a16881cd61e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6902,7 +6902,7 @@ abstract class CommonObject } elseif (preg_match('/^html/', $type)) { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss); } else { $out = ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 2be0c36c56c..b529d23ebda 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -152,7 +152,7 @@ class DolEditor $out .= htmlspecialchars($this->content); $out .= ''; - if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) { + if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && isModEnabled('fckeditor')) { if (!defined('REQUIRE_CKEDITOR')) { define('REQUIRE_CKEDITOR', '1'); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..cea529726e5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1098,7 +1098,7 @@ class ExtraFields } elseif ($type == 'html') { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $out = $doleditor->Create(1); } else { $out = ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c2f17314c81..1ecd05cc3a5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -529,7 +529,7 @@ class Form $savemethod = $tmp[4]; } - if (!empty($conf->fckeditor->enabled)) { + if (isModEnabled('fckeditor')) { $out .= ''."\n"; } else { $inputType = 'textarea'; @@ -8721,7 +8721,7 @@ class Form 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array( - 'enabled'=>(!empty($conf->supplier_proposal->enabled) ? $conf->supplier_proposal->enabled : 0), + 'enabled'=>(isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0), 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 0c5aa54b5ca..80e69a39532 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1642,7 +1642,7 @@ class FormMail extends Form if (isModEnabled('commande')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine'; } @@ -1659,7 +1659,7 @@ class FormMail extends Form if (isModEnabled('commande')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine'; } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6ba3ca18094..9b1c46d7c53 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -128,7 +128,7 @@ function societe_prepare_head(Societe $object) } } $supplier_module_enabled = 0; - if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $supplier_module_enabled = 1; } if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a0e57c173c8..dcecd69769b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7405,7 +7405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__'; $substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/ } - if (!empty($conf->contrat->enabled) && (!is_object($object) || $object->element == 'contract')) { + if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract')) { $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ca9bfcfe0e4..91e0b382b44 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1605,7 +1605,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; // Add an additional description for the category products - if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) { + if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && isModEnabled('categorie')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categstatic = new Categorie($db); // recovering the list of all the categories linked to product diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 710b2462afa..56cb195060b 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -398,7 +398,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("CustomersCategoryShort"); if (!empty($array_query['cust_categ'])) { @@ -451,7 +451,7 @@ print '
'; print '
'."\n"; print '
'.$langs->trans("ContactCategoriesShort"); if (!empty($array_query['contact_categ'])) { diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index e0f0c5d9142..1110e91b019 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -94,17 +94,17 @@ if ($module == 'propal') { } //else dol_print_error('','Bad value '.$module.' for param module'); -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdata = 'textarea:12:95%'; } -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdatapub = 'textarea:12:95%'; } -if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { +if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { $typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { $typeofdatapriv = 'textarea:12:95%'; diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 1615dbe87ed..611c556d98c 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -74,7 +74,7 @@ if (isModEnabled('facture')) { } print '
'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'contractline')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 49f2873f472..73312ec52cf 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -222,7 +222,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } // Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set. - if (!empty($conf->supplier_proposal->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { + if (isModEnabled('supplier_proposal') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { $object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index c7a4a570a5c..70e22db92a2 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -319,7 +319,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } if (isModEnabled('commande')) { @@ -328,7 +328,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index ac986ad00f4..bb22566ef1e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -122,7 +122,7 @@ if (isModEnabled("societe")) { if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } if (isModEnabled('commande')) { @@ -131,7 +131,7 @@ if (isModEnabled('commande')) { if (isModEnabled('facture')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index adc80e27b64..b693800e253 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -577,7 +577,7 @@ if ($user->rights->user->user->lire) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -588,7 +588,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use $moreforfilter .= '
'; } -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 3f644b074bd..3d10693d4e1 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -41,7 +41,7 @@ if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; } @@ -241,7 +241,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url); $form = new Form($db); $companystatic = new Societe($db); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $contratstatic = new Contrat($db); } if (!empty($conf->project->enabled)) { @@ -275,7 +275,7 @@ if ($action == 'create') { if (!empty($conf->project->enabled) && $object->fk_project > 0) { $rowspan++; } - if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { + if (isModEnabled('contrat') && $object->fk_contrat > 0) { $rowspan++; } @@ -328,7 +328,7 @@ if ($action == 'create') { } // Contrat - if (!empty($conf->contrat->enabled)) { + if (isModEnabled('contrat')) { $formcontract = new FormContract($db); print "
".$langs->trans("Contract").""; $contractid = GETPOST('contractid') ?GETPOST('contractid') : $object->fk_contract; @@ -539,7 +539,7 @@ if ($action == 'create') { print '
'.$langs->trans("Description").''.nl2br($object->description)."
'; @@ -800,7 +800,7 @@ if ($action == 'create') { print '
'.$langs->trans("None").''; if ($objp->fk_contrat > 0) { $contratstatic->fetch($objp->fk_contrat); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e2d03790f78..1c83726f7e6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -784,7 +784,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $formcontract = new FormContract($db); } if (!empty($conf->project->enabled)) { @@ -1233,7 +1233,7 @@ if ($action == 'create') { print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d8bb62f6b5d..52af477741d 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } @@ -46,7 +46,7 @@ $langs->loadLangs(array('companies', 'bills', 'interventions')); if (!empty($conf->project->enabled)) { $langs->load("projects"); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $langs->load("contracts"); } @@ -205,7 +205,7 @@ $companystatic = new Societe($db); if (!empty($conf->project->enabled)) { $projetstatic = new Project($db); } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $contratstatic = new Contrat($db); } @@ -237,7 +237,7 @@ $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.s if (!empty($conf->project->enabled)) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier"; } // Add fields from extrafields @@ -254,7 +254,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 9d5c5b70fe4..9a7a3d7dcc0 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -340,7 +340,7 @@ if ($object->id > 0) { } // Categories - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $langs->load("categories"); print '
'.$langs->trans("SuppliersCategoriesShort").''; @@ -387,7 +387,7 @@ if ($object->id > 0) { $boxstat .= ''; $boxstat .= '"; //} - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print ''; if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire)) - || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { + || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) { // Supplier print ''; print ''; print ''; print ''; print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print ''; print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load('categories'); if (!GETPOSTISSET('categories')) { @@ -4270,7 +4270,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print ''; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print '
'; print '
'; print $langs->trans("Category"); @@ -4404,7 +4404,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = // Categories - Tags print '
\n"; print ''; print ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 16500c62d59..dbcc9cfdade 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -137,7 +137,7 @@ foreach ($modulesdir as $dir) { } // We discard modules according to property disabled - //if (! empty($objMod->hidden)) $modulequalified=0; + //if (!empty($objMod->hidden)) $modulequalified=0; if ($modulequalified > 0) { $publisher = dol_escape_htmltag($objMod->getPublisher()); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 997c71bb335..eb918086720 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -378,7 +378,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index f534ff881da..3468c997a58 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -471,7 +471,7 @@ print '\n\n"; $found++; -//if (! empty($conf->expedition->enabled)) +//if (!empty($conf->expedition->enabled)) //{ print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 9482a06be41..0204f184de7 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -468,7 +468,7 @@ if (isModEnabled('banque')) { print '
'; - if (!empty($conf->supplier_proposal->enabled)) { + if (isModEnabled('supplier_proposal')) { // Box proposals $tmp = $object->getOutstandingProposals('supplier'); $outstandingOpened = $tmp['opened']; @@ -842,7 +842,7 @@ if ($object->id > 0) { print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('ThirdPartyIsClosed'), 'default', $_SERVER['PHP_SELF'].'#', '', false); } - if (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->creer)) { + if (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->creer)) { $langs->load("supplier_proposal"); if ($object->status == 1) { print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, ''); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 67ec98e3c96..769d8c451da 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } if (isModEnabled("product")) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5676cd4aae3..c6401b0a70a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1227,7 +1227,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 47e6786f2f0..e7f1785cb95 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -900,7 +900,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view prospects other than his' - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -909,7 +909,7 @@ if ($resql) { $moreforfilter .= '
'; } - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('SuppliersCategoriesShort'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 66b7b0ca160..8da0dd34b92 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -189,7 +189,7 @@ if ($action == 'create') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -236,7 +236,7 @@ if (($id || $ref) && $action == 'edit') { // Common attributes include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 18ec0d67738..ff28b79a4ad 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; // for other modules -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -475,7 +475,7 @@ $moreforfilter.= '
';*/ // Filter on categories $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 1); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 989e856b690..a2098b11a8f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2481,7 +2481,7 @@ function printDropdownQuickadd() "title" => "NewContractSubscription@contracts", "name" => "Contract@contracts", "picto" => "object_contract", - "activation" => !empty($conf->contrat->enabled) && $user->hasRight("contrat", "write"), // vs hooking + "activation" => isModEnabled('contrat') && $user->hasRight("contrat", "write"), // vs hooking "position" => 60, ), array( @@ -2489,7 +2489,7 @@ function printDropdownQuickadd() "title" => "SupplierProposalNew@supplier_proposal", "name" => "SupplierProposal@supplier_proposal", "picto" => "supplier_proposal", - "activation" => !empty($conf->supplier_proposal->enabled) && $user->hasRight("supplier_invoice", "write"), // vs hooking + "activation" => isModEnabled('supplier_proposal') && $user->hasRight("supplier_invoice", "write"), // vs hooking "position" => 70, ), array( diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d9b943fb40f..fd107c06351 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1615,7 +1615,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index e6a3b3171bc..3018312cd0e 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -179,7 +179,7 @@ if ($action == 'search') { } $sql .= natural_search($params, $key); } - if (!empty($conf->categorie->enabled) && !empty($parent) && $parent != -1) { + if (isModEnabled('categorie') && !empty($parent) && $parent != -1) { $sql .= " AND cp.fk_categorie ='".$db->escape($parent)."'"; } $sql .= " ORDER BY p.ref ASC"; @@ -590,7 +590,7 @@ if ($id > 0 || !empty($ref)) { print '
'; $rowspan = 1; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $rowspan++; } @@ -603,7 +603,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans("KeywordFilter").': '; print '   '; print ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'.$langs->trans("CategoryFilter").': '; print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent, 'parent').'  
'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index e976e176224..4e90371a3f4 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod } -if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { +if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'; print '
'; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 553f4ed8baa..00f440f1990 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -464,7 +464,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; $tmptitle = $langs->transnoentities('ProductsCategoriesShort'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index dcea4f4b8f7..6028a0a871d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -820,7 +820,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1); diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 10e70545af6..5585b8221a2 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -328,7 +328,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index a39dc246772..14d9815361d 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -481,7 +481,7 @@ if ($search_categ > 0) { // Filter on categories $moreforfilter = ''; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b4730778d32..43fb04b1ad3 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -378,7 +378,7 @@ if ($action == 'create') { // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { // Categories print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index cc94ae303ec..f182cf1847b 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -53,7 +53,7 @@ $search_ref = GETPOST("sref", "alpha") ?GETPOST("sref", "alpha") : GETPOST("sear $search_label = GETPOST("snom", "alpha") ?GETPOST("snom", "alpha") : GETPOST("search_label", "alpha"); $search_status = GETPOST("search_status", "int"); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_WAREHOUSE."_list", "array"); } @@ -226,7 +226,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_WAREHOUSE, "t.rowid"); } if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -242,7 +242,7 @@ if ($separatedPMP) { $sql .= " WHERE t.entity IN (".getEntity('stock').")"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_WAREHOUSE, "t.rowid", $search_category_list); } foreach ($search as $key => $val) { @@ -419,7 +419,7 @@ if ($search_all) { $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list); } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index bc182efa3f2..8008ed4780f 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -714,7 +714,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $doleditor->Create(); print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1356,7 +1356,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("bills"); print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) { + if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->creer) { $langs->load("supplier_proposal"); print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } @@ -1372,7 +1372,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $langs->load("interventions"); print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) { + if (isModEnabled('contrat') && $user->rights->contrat->creer) { $langs->load("contracts"); print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true)); } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 57583a538fb..cf5c8fbde86 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -49,7 +49,7 @@ if (isModEnabled('facture')) { if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; } if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { @@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (!empty($conf->contrat->enabled)) { +if (isModEnabled('contrat')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (!empty($conf->ficheinter->enabled)) { @@ -95,7 +95,7 @@ if (isModEnabled("banque")) { if (!empty($conf->salaries->enabled)) { require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->mrp->enabled)) { diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 7cfb66288e1..7deaf0a1870 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -148,7 +148,7 @@ if ($search_status == '') { $search_status = -1; // -1 or 1 } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } @@ -413,7 +413,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); } if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { @@ -436,7 +436,7 @@ if ($search_project_contact > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp_contact"; } $sql .= " WHERE p.entity IN (".getEntity('project').')'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_array); } if (empty($user->rights->projet->all->lire)) { @@ -859,7 +859,7 @@ if ($user->rights->user->user->lire) { } // Filter on categories -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array); } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 018cb5c3408..de9bdf7855c 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 5a91f47dbd9..a25b44082a0 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -671,7 +671,7 @@ if ($search_all) { $moreforfilter = ''; // Filter on categories -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d803162afc4..c1152510cca 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -542,7 +542,7 @@ if ($action == 'confirm_generateinvoice') { $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note if (!empty($withdetail)) { - if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { + if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { $arrayoftasks[$object->timespent_id]['note'] .= "
"; } else { $arrayoftasks[$object->timespent_id]['note'] .= "\n"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 331fb58ae9c..2467d9959bc 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -71,7 +71,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (isModEnabled('adherent')) { $langs->load("members"); } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } if (!empty($conf->incoterm->enabled)) { @@ -1477,7 +1477,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; @@ -1762,7 +1762,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { $langs->load('categories'); // Customer @@ -2177,7 +2177,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Supplier if (((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) - || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) { + || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) { print '
'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).''; @@ -2463,7 +2463,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Customer print '
'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).''; @@ -2888,7 +2888,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Tags / categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Customer if ($object->prospect || $object->client || !empty($conf->global->THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT)) { print ''; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index a8f250f29d5..58f568b6f6a 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -176,7 +176,7 @@ if ($object->client) { if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 14c1347c98c..313947cbb0e 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -50,7 +50,7 @@ if (isModEnabled('adherent')) { // Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { $langs->load("categories"); } if (!empty($conf->incoterm->enabled)) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index c90dc1537d1..1d0bdfe39a1 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -199,7 +199,7 @@ $thirdpartygraph .= '
'.$langs->trans("CustomersCategoriesShort").'
'; $thirdpartygraph .= ''; $thirdpartycateggraph = ''; -if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { +if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c8f0045d619..ff6de888284 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -979,7 +979,7 @@ if ($search_all) { // Filter on categories $moreforfilter = ''; if (empty($type) || $type == 'c' || $type == 'p') { - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); @@ -990,7 +990,7 @@ if (empty($type) || $type == 'c' || $type == 'p') { } if (empty($type) || $type == 'f') { - if (isModEnabled("fournisseur") && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) { + if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index f22a5fb440b..02d58d0dfe3 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -797,7 +797,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('facture') && $user->rights->facture->lire) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + if (isModEnabled('contrat') && $user->rights->contrat->lire) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index f151651d186..6fd6480105b 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -162,7 +162,7 @@ if ($resql) { /* * Draft askprice */ -if (!empty($conf->supplier_proposal->enabled)) { +if (isModEnabled('supplier_proposal')) { $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -297,7 +297,7 @@ if ($resql) { /* * Opened askprice */ -if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { +if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { $langs->load("supplier_proposal"); $now = dol_now(); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 03de4f7ecca..6a8ad41dbd2 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -644,7 +644,7 @@ if ($resql) { $moreforfilter .= '
'; } // If the user can view products - if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7ae7bb70566..3b8b401f372 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -54,7 +54,7 @@ if (!empty($conf->ldap->enabled)) { if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->stock->enabled)) { @@ -1171,7 +1171,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%'); @@ -1627,7 +1627,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { + if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); @@ -2575,7 +2575,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e22f95d1055..858a46887ba 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (!empty($conf->categorie->enabled)) { +if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -658,7 +658,7 @@ $moreforfilter = ''; $moreforfilter.= '';*/ // Filter on categories -if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) { +if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('Category'); $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 1df44179461..40c39ba3879 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -198,7 +198,7 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) { if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea'; } -if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) { +if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || isModEnabled('contrat')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea'; } if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) { diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 79d222f7e84..9214b4ad392 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -107,7 +107,7 @@ $webservices = array( 'invoice' => 'isModEnabled("facture")', 'supplier_invoice' => 'isModEnabled("fournisseur")', 'actioncomm' => 'isModEnabled('agenda')', - 'category' => '!empty($conf->categorie->enabled)', + 'category' => 'isModEnabled('categorie')', 'project' => '!empty($conf->project->enabled)', 'other' => '' ); diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0b599ba640b..e83ea15a34d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2767,7 +2767,7 @@ if (!GETPOST('hide_websitemenu')) { print dolButtonToOpenUrlInDialogPopup('file_manager', $langs->transnoentitiesnoconv("MediaFiles"), '', '/website/index.php?action=file_manager&website='.urlencode($website->ref).'§ion_dir='.urlencode('image/'.$website->ref.'/'), $disabled); - if (!empty($conf->categorie->enabled)) { + if (isModEnabled('categorie')) { //print ''; print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), '', '/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.urlencode($website->ref), $disabled); } @@ -3948,7 +3948,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print '
'; - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { // Get current categories $existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object'); if (is_array($existing)) { From 00da52ef8c7751cba212e62c8aa081ff2a3df094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:12:25 +0200 Subject: [PATCH 14/60] fix php8 warnings --- htdocs/adherents/class/adherent.class.php | 6 +++--- htdocs/admin/commande.php | 4 ++-- htdocs/admin/compta.php | 2 +- htdocs/modulebuilder/template/mymoduleindex.php | 4 ++-- htdocs/modulebuilder/template/myobject_document.php | 4 ++-- htdocs/website/websiteaccount_card.php | 4 ++-- test/phpunit/FactureTest.php | 2 +- test/phpunit/PricesTest.php | 2 +- test/phpunit/SocieteTest.php | 2 +- test/phpunit/UserTest.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 1d2df6c04ab..786814d30fc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2061,7 +2061,7 @@ class Adherent extends CommonObject $err = 0; // mailman - if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_mailman($this); if ($result < 0) { @@ -2081,7 +2081,7 @@ class Adherent extends CommonObject } // spip - if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) { + if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) { $result = $mailmanspip->add_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; @@ -2132,7 +2132,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) { + if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) { $result = $mailmanspip->del_to_spip($this); if ($result < 0) { $this->errors[] = $mailmanspip->error; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index eec8bb16417..4bffad16ee3 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -644,7 +644,7 @@ if ($conf->banque->enabled) { print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { @@ -664,7 +664,7 @@ if ($conf->banque->enabled) { if (isModEnabled('stock')) { print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); } else { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index d215125d51e..7bb291d521e 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -146,7 +146,7 @@ print "
'.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT -//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) +//if (!empty($conf->global->MAIN_MODULE_COMPTABILITE)) //{ // // print "
\n"; // // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 15f3d83ac54..a5620a45966 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -100,7 +100,7 @@ print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $langs->load("orders"); @@ -181,7 +181,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) +if (isModEnabled('mymodule') && $user->rights->mymodule->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject as s"; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 78d20a1863a..173bea760a0 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -190,7 +190,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -211,7 +211,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 261839940e5..39e6e10e3d7 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index e40ed6aa2e7..891eaf05b99 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -86,7 +86,7 @@ class FactureTest extends PHPUnit\Framework\TestCase if (!isModEnabled('facture')) { print __METHOD__." module customer invoice must be enabled.\n"; die(1); } - if (! empty($conf->ecotaxdeee->enabled)) { + if (!empty($conf->ecotaxdeee->enabled)) { print __METHOD__." ecotaxdeee module must not be enabled.\n"; die(1); } diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 1845bf05149..de847e68411 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -38,7 +38,7 @@ if (empty($user->id)) { } $conf->global->MAIN_DISABLE_ALL_MAILS=1; -if (! empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { +if (!empty($conf->global->MAIN_ROUNDING_RULE_TOT)) { print "Parameter MAIN_ROUNDING_RULE_TOT must be set to 0 or not set.\n"; exit(1); } diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 73363140acd..1a93fb5d21f 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -87,7 +87,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".$conf->global->SOCIETE_CODECLIENT_ADDON."'.\n"; die(1); } - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) { + if (!empty($conf->global->MAIN_DISABLEPROFIDRULES)) { print "\n".__METHOD__." constant MAIN_DISABLEPROFIDRULES must be empty (if a module set it, disable module).\n"; die(1); } diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index ea7090f2b54..d6bc1093258 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -82,7 +82,7 @@ class UserTest extends PHPUnit\Framework\TestCase { global $conf,$user,$langs,$db; - if (! empty($conf->global->MAIN_MODULE_LDAP)) { + if (!empty($conf->global->MAIN_MODULE_LDAP)) { print "\n".__METHOD__." module LDAP must be disabled.\n"; die(1); } From 8e66b7207ec587edb1b74489bcc6865495f3e881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:14:20 +0200 Subject: [PATCH 15/60] replace ! empty by !empty --- build/generate_filelist_xml.php | 2 +- dev/initdata/generate-proposal.php | 2 +- dev/initdata/purge-data.php | 2 +- dev/tools/dolibarr-postgres2mysql.php | 6 +- dev/translation/autotranslator.class.php | 6 +- dev/translation/sanity_check_en_langfiles.php | 4 +- dev/translation/strip_language_file.php | 4 +- .../class/accountancyexport.class.php | 4 +- .../actions_adherentcard_common.class.php | 2 +- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/admin/clicktodial.php | 2 +- htdocs/admin/delais.php | 4 +- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/admin/mails_templates.php | 4 +- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/paymentbybanktransfer.php | 2 +- htdocs/admin/pdf.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/admin/propal.php | 2 +- htdocs/admin/stock.php | 4 +- htdocs/admin/supplier_order.php | 2 +- htdocs/admin/tools/export.php | 2 +- htdocs/admin/tools/export_files.php | 2 +- htdocs/api/class/api_login.class.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 6 +- htdocs/bom/bom_card.php | 10 +-- htdocs/bom/bom_list.php | 2 +- htdocs/bom/bom_net_needs.php | 20 ++--- htdocs/bom/class/bom.class.php | 26 +++--- htdocs/comm/action/class/actioncomm.class.php | 4 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/mailing/cibles.php | 2 +- htdocs/comm/mailing/index.php | 2 +- htdocs/comm/propal/card.php | 12 +-- htdocs/comm/propal/class/propal.class.php | 4 +- htdocs/comm/propal/index.php | 4 +- htdocs/commande/card.php | 14 +-- htdocs/commande/class/commande.class.php | 6 +- .../compta/cashcontrol/cashcontrol_list.php | 2 +- .../cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/compta/facture/card-rec.php | 4 +- htdocs/compta/facture/card.php | 10 +-- htdocs/compta/facture/class/facture.class.php | 14 +-- htdocs/compta/localtax/index.php | 2 +- htdocs/compta/localtax/quadri_detail.php | 2 +- htdocs/compta/paiement.php | 4 +- htdocs/compta/paiement/card.php | 4 +- htdocs/compta/payment_sc/card.php | 2 +- htdocs/compta/payment_vat/card.php | 4 +- htdocs/compta/resultat/result.php | 10 +-- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 2 +- htdocs/contact/consumption.php | 4 +- htdocs/contact/list.php | 12 +-- htdocs/contact/project.php | 4 +- htdocs/contrat/agenda.php | 4 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/document.php | 2 +- htdocs/contrat/note.php | 2 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/actions_dellink.inc.php | 2 +- htdocs/core/ajax/saveinplace.php | 4 +- htdocs/core/boxes/box_contracts.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/core/boxes/modules_boxes.php | 2 +- htdocs/core/class/CMailFile.class.php | 6 +- htdocs/core/class/antivir.class.php | 2 +- htdocs/core/class/commonobject.class.php | 10 +-- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 28 +++--- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/class/html.formprojet.class.php | 4 +- htdocs/core/class/utils.class.php | 2 +- htdocs/core/customreports.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 +- htdocs/core/lib/pdf.lib.php | 44 ++++----- htdocs/core/lib/project.lib.php | 46 +++++----- htdocs/core/lib/security2.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 4 +- htdocs/core/lib/stock.lib.php | 2 +- htdocs/core/lib/usergroups.lib.php | 14 +-- htdocs/core/lib/website2.lib.php | 4 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 6 +- .../commande/doc/pdf_einstein.modules.php | 10 +-- .../commande/doc/pdf_eratosthene.modules.php | 10 +-- .../doc/pdf_standard.modules.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 12 +-- .../facture/doc/pdf_sponge.modules.php | 12 +-- htdocs/core/modules/modBlockedLog.class.php | 2 +- htdocs/core/modules/modECM.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- .../movement/doc/pdf_standard.modules.php | 2 +- .../modules/mrp/doc/pdf_vinci.modules.php | 6 +- .../product/doc/pdf_standard.modules.php | 10 +-- .../modules/propale/doc/pdf_azur.modules.php | 10 +-- .../modules/propale/doc/pdf_cyan.modules.php | 10 +-- .../societe/mod_codecompta_aquarium.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 2 +- .../doc/pdf_canelle.modules.php | 6 +- .../supplier_order/doc/pdf_cornas.modules.php | 6 +- .../doc/pdf_muscadet.modules.php | 6 +- .../doc/pdf_standard.modules.php | 6 +- .../doc/pdf_aurore.modules.php | 8 +- htdocs/core/tpl/login.tpl.php | 2 +- .../interface_80_modStripe_Stripe.class.php | 2 +- htdocs/don/card.php | 4 +- htdocs/don/class/don.class.php | 4 +- htdocs/ecm/file_card.php | 4 +- .../class/emailcollector.class.php | 2 +- .../class/conferenceorbooth.class.php | 12 +-- .../class/conferenceorboothattendee.class.php | 16 ++-- .../conferenceorbooth_contact.php | 4 +- .../conferenceorboothattendee_note.php | 4 +- .../eventorganizationindex.php | 4 +- htdocs/expedition/card.php | 8 +- htdocs/expensereport/card.php | 10 +-- htdocs/fichinter/class/fichinter.class.php | 4 +- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- .../class/fournisseur.commande.class.php | 2 +- .../class/fournisseur.facture-rec.class.php | 10 +-- .../fourn/class/fournisseur.facture.class.php | 14 +-- htdocs/fourn/commande/card.php | 4 +- htdocs/fourn/facture/card-rec.php | 90 +++++++++---------- htdocs/fourn/facture/card.php | 8 +- htdocs/fourn/facture/list.php | 2 +- htdocs/ftp/index.php | 2 +- htdocs/holiday/document.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 16 ++-- htdocs/hrm/class/job.class.php | 16 ++-- htdocs/hrm/class/position.class.php | 16 ++-- htdocs/hrm/class/skill.class.php | 16 ++-- htdocs/hrm/class/skilldet.class.php | 16 ++-- htdocs/hrm/class/skillrank.class.php | 16 ++-- htdocs/hrm/establishment/info.php | 6 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/evaluation_contact.php | 4 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/job_contact.php | 4 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/position_contact.php | 4 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/hrm/skill_contact.php | 4 +- .../PrintConnectors/ApiPrintConnector.php | 2 +- .../nusoap/lib/class.soap_transport_http.php | 6 +- .../includes/nusoap/lib/class.soapclient.php | 2 +- htdocs/includes/nusoap/lib/nusoap.php | 8 +- htdocs/includes/odtphp/Segment.php | 2 +- htdocs/includes/odtphp/odf.php | 4 +- .../vendor/illuminate/collections/Arr.php | 2 +- .../illuminate/collections/Collection.php | 2 +- .../illuminate/support/ServiceProvider.php | 2 +- .../vendor/illuminate/support/Stringable.php | 2 +- .../support/Testing/Fakes/BusFake.php | 6 +- .../support/Testing/Fakes/EventFake.php | 2 +- .../Testing/Fakes/NotificationFake.php | 2 +- .../support/Testing/Fakes/QueueFake.php | 2 +- htdocs/index.php | 4 +- htdocs/install/upgrade2.php | 4 +- htdocs/intracommreport/list.php | 6 +- .../class/knowledgerecord.class.php | 16 ++-- .../knowledgemanagementindex.php | 4 +- .../knowledgerecord_agenda.php | 6 +- .../knowledgerecord_card.php | 8 +- .../knowledgerecord_contact.php | 4 +- .../knowledgerecord_document.php | 4 +- .../knowledgerecord_list.php | 2 +- .../knowledgerecord_note.php | 4 +- .../template/class/myobject.class.php | 16 ++-- .../template/css/mymodule.css.php | 2 +- .../template/myobject_agenda.php | 6 +- .../modulebuilder/template/myobject_card.php | 6 +- .../template/myobject_contact.php | 4 +- .../modulebuilder/template/myobject_note.php | 4 +- htdocs/mrp/class/mo.class.php | 22 ++--- htdocs/mrp/mo_agenda.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/mrp/mo_list.php | 2 +- htdocs/mrp/mo_production.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 4 +- .../partnership/class/partnership.class.php | 20 ++--- .../class/partnership_type.class.php | 12 +-- htdocs/partnership/partnership_agenda.php | 6 +- htdocs/partnership/partnership_card.php | 4 +- htdocs/partnership/partnership_contact.php | 4 +- htdocs/partnership/partnership_document.php | 4 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/partnership/partnership_note.php | 4 +- htdocs/partnership/partnershipindex.php | 4 +- htdocs/product/card.php | 2 +- htdocs/product/composition/card.php | 2 +- htdocs/product/inventory/card.php | 4 +- .../inventory/class/inventory.class.php | 4 +- htdocs/product/inventory/inventory.php | 16 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 4 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../class/stocktransfer.class.php | 16 ++-- .../class/stocktransferline.class.php | 16 ++-- .../stocktransfer/stocktransfer_agenda.php | 6 +- .../stocktransfer/stocktransfer_card.php | 4 +- .../stocktransfer/stocktransfer_document.php | 6 +- .../stocktransfer/stocktransfer_list.php | 2 +- .../stocktransfer/stocktransfer_note.php | 4 +- htdocs/projet/activity/perday.php | 2 +- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 4 +- htdocs/projet/card.php | 2 +- htdocs/projet/class/task.class.php | 6 +- htdocs/projet/tasks/list.php | 2 +- htdocs/projet/tasks/time.php | 6 +- htdocs/public/opensurvey/studs.php | 2 +- htdocs/public/payment/newpayment.php | 6 +- htdocs/reception/card.php | 4 +- .../class/recruitmentcandidature.class.php | 16 ++-- .../class/recruitmentjobposition.class.php | 16 ++-- htdocs/recruitment/index.php | 2 +- .../recruitmentcandidature_agenda.php | 6 +- .../recruitmentcandidature_card.php | 4 +- .../recruitmentcandidature_document.php | 4 +- .../recruitmentcandidature_list.php | 2 +- .../recruitmentcandidature_note.php | 4 +- .../recruitmentjobposition_agenda.php | 2 +- htdocs/societe/ajax/ajaxcompanies.php | 2 +- htdocs/societe/card.php | 14 +-- .../class/companypaymentmode.class.php | 2 +- htdocs/societe/consumption.php | 4 +- htdocs/societe/notify/card.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/website.php | 2 +- htdocs/stripe/charge.php | 2 +- htdocs/stripe/payout.php | 4 +- htdocs/stripe/transaction.php | 4 +- htdocs/supplier_proposal/card.php | 2 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/user/card.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/user/param_ihm.php | 2 +- htdocs/user/perms.php | 2 +- htdocs/webhook/class/target.class.php | 16 ++-- htdocs/webhook/target_agenda.php | 6 +- htdocs/webhook/target_card.php | 6 +- htdocs/webhook/target_contact.php | 4 +- htdocs/webhook/target_note.php | 4 +- htdocs/webhook/webhookindex.php | 4 +- htdocs/website/index.php | 6 +- test/phpunit/AdherentTest.php | 6 +- test/phpunit/AllTests.php | 4 +- test/phpunit/WebservicesInvoicesTest.php | 6 +- test/phpunit/WebservicesOrdersTest.php | 2 +- test/phpunit/WebservicesOtherTest.php | 4 +- test/phpunit/WebservicesProductsTest.php | 6 +- test/phpunit/WebservicesThirdpartyTest.php | 8 +- test/phpunit/WebservicesUserTest.php | 4 +- 265 files changed, 762 insertions(+), 762 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 7065e20f92b..3d72ebe6739 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -56,7 +56,7 @@ if (empty($argv[1])) { $i=0; while ($i < $argc) { - if (! empty($argv[$i])) { + if (!empty($argv[$i])) { parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ... } if (preg_match('/includeconstant=/', $argv[$i])) { diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 0b1c24dc139..8af71d441a1 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -152,7 +152,7 @@ $user->rights->propal->creer=1; $user->rights->propal->propal_advance->validate=1; -if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { +if (!empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"; } diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 9214f34d810..d75c9fae8b2 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -218,7 +218,7 @@ if ($date == 'all') { } // Replace database handler -if (! empty($argv[4])) { +if (!empty($argv[4])) { $db->close(); unset($db); $db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); diff --git a/dev/tools/dolibarr-postgres2mysql.php b/dev/tools/dolibarr-postgres2mysql.php index 1a997ddc63c..76be3804f1a 100644 --- a/dev/tools/dolibarr-postgres2mysql.php +++ b/dev/tools/dolibarr-postgres2mysql.php @@ -487,7 +487,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) $pkey = $line; $linenumber ++; - if (! empty($lines[$linenumber])) { + if (!empty($lines[$linenumber])) { $line = $lines[$linenumber]; } else { $line = ''; @@ -517,7 +517,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if (substr($line, 0, 12) == "CREATE INDEX") { $matches = array(); preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); - if (! empty($matches[3])) { + if (!empty($matches[3])) { $indexname = $matches[1]; $tablename = str_replace('public.', '', $matches[2]); $columns = $matches[3]; @@ -529,7 +529,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true) if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") { $matches = array(); preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); - if (! empty($matches[3])) { + if (!empty($matches[3])) { $indexname = $matches[1]; $tablename = str_replace('public.', '', $matches[2]); $columns = str_replace('"', '', $matches[3]); diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 956ad95b9b6..bf1b121b03f 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -309,11 +309,11 @@ class autoTranslator { // We want to be sure that src_lang and dest_lang are using 2 chars only $tmp=explode('_', $src_lang); - if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { + if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) { $src_lang=$tmp[0]; } $tmp=explode('_', $dest_lang); - if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { + if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) { $dest_lang=$tmp[0]; } @@ -349,7 +349,7 @@ class autoTranslator // now, process the JSON string $json = json_decode($body, true); - if ((! empty($json['responseStatus']) && $json['responseStatus'] != 200) + if ((!empty($json['responseStatus']) && $json['responseStatus'] != 200) || count($json['data']['translations']) == 0) { print "Error: ".$json['responseStatus']." ".$url."\n"; return false; diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 840f09a0adb..95ea90e3f34 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -221,7 +221,7 @@ foreach ($dups as $string => $pages) { // Loop on each line keword was found into file. $listoffilesforthisentry=array(); foreach ($lines as $line => $translatedvalue) { - if (! empty($listoffilesforthisentry[$file])) { + if (!empty($listoffilesforthisentry[$file])) { $duplicateinsamefile=1; } $listoffilesforthisentry[$file]=1; @@ -300,7 +300,7 @@ if ($web) { // STEP 2 - Search key not used -if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { +if ((!empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { print "***** Strings in en_US that are never used:\n"; $unused=array(); diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index f0a0397cd6e..b2427c9f57a 100755 --- a/dev/translation/strip_language_file.php +++ b/dev/translation/strip_language_file.php @@ -303,8 +303,8 @@ foreach ($filesToProcess as $fileToProcess) { // String exists in both files and value into alternative language differs from main language but also from english files // so we keep it. - if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] - && ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) + if ((!empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] + && !empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key) ) { //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n"; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index c8c4099e67e..e4af034b1f4 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1347,7 +1347,7 @@ class AccountancyExport } print $nature_piece.$separator; // RACI - // if (! empty($line->subledger_account)) { + // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { // $racine_subledger_account = '40'; // } elseif ($line->doc_type == 'customer_invoice') { @@ -1610,7 +1610,7 @@ class AccountancyExport } print $nature_piece.$separator; // RACI - // if (! empty($line->subledger_account)) { + // if (!empty($line->subledger_account)) { // if ($line->doc_type == 'supplier_invoice') { // $racine_subledger_account = '40'; // } elseif ($line->doc_type == 'customer_invoice') { diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 502249907e8..45d9c4f8fce 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -65,7 +65,7 @@ abstract class ActionsAdherentCardCommon /*if (is_object($this->object) && method_exists($this->object,'fetch')) { - if (! empty($id)) $this->object->fetch($id); + if (!empty($id)) $this->object->fetch($id); } else {*/ diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 786814d30fc..46420995312 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1108,7 +1108,7 @@ class Adherent extends CommonObject // Mise a jour $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."'"; - //if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) + //if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) if ($isencrypted) { $sql .= ", pass = null"; } else { diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 8f98b4d25e9..8b8f2c6c921 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -107,7 +107,7 @@ print '* https://myphoneserver/phoneurl?login=__LOGIN__&password=__PASS__&caller print '* sip:__PHONETO__@my.sip.server'; print ''; -//if (! empty($user->clicktodial_url)) +//if (!empty($user->clicktodial_url)) //{ print '
'; print info_admin($langs->trans("ValueOverwrittenByUserSetup")); diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index af8fed1c197..e64d1bda876 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -317,8 +317,8 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE $offset = 0; $cursor = 10; // By default - //if (! empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; - //if (! empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; + //if (!empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; + //if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; $level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) { $level0 = $conf->global->MAIN_METEO_LEVEL0; } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index db92c33a7fb..3f72fc77c6c 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -285,7 +285,7 @@ foreach($object->fields as $key => $val) $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index f53e8c6b0d0..e9b36be353a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -823,7 +823,7 @@ if ($action == 'add') { } elseif ($tmpfieldlist == 'joinfiles') { print ''; } else { - // print ''; + // print ''; $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $okforextended = false; @@ -1074,7 +1074,7 @@ if ($num) { $okforextended = true; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false; - $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); + $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); print $doleditor->Create(1); } print '
'.$langs->trans("Parameter").''.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").''; -//if (! empty($conf->global->MAIN_MULTILANGS)) +//if (!empty($conf->global->MAIN_MULTILANGS)) //{ $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 88a02e90457..c76cccdcc5c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -392,7 +392,7 @@ print '
'; */ /* Disable this, there is no trigger with elementtype 'withdraw' -if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) +if (!empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print load_fiche_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index eea567ea27c..408c42cc3a8 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -705,7 +705,7 @@ if (isModEnabled('facture')) print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; - if (! empty($conf->use_javascript_ajax)) + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); } diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 4103c8cd354..402119e6e51 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -186,7 +186,7 @@ if (isModEnabled('productbatch')) { print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); } -//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) +//if (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //{ print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); print '
'; @@ -239,7 +239,7 @@ if (isModEnabled('commande')) { print "
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) + if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER'); } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8b1e8ebf8c0..3f3316f6996 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -153,7 +153,7 @@ if ($what == 'postgresql') { $cmddump = dol_sanitizePathName($cmddump); /* Not required, the command is output on screen but not ran for pgsql - if (! empty($dolibarr_main_restrict_os_commands)) + if (!empty($dolibarr_main_restrict_os_commands)) { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 68cb81ccc24..84bbd197a64 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -127,7 +127,7 @@ $result = dol_mkdir($outputdir); $utils = new Utils($db); -if ($export_type == 'externalmodule' && ! empty($what)) { +if ($export_type == 'externalmodule' && !empty($what)) { $fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what); } else { $fulldirtocompress = DOL_DATA_ROOT; diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 5282a43dacc..d5362f4ac56 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -88,7 +88,7 @@ class Login global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; // Is the login API disabled ? The token must be generated from backoffice only. - if (! empty($conf->global->API_DISABLE_LOGIN_API)) { + if (!empty($conf->global->API_DISABLE_LOGIN_API)) { dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING); throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice."); } diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 437e51cf0b1..8d325954a76 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -123,7 +123,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 51a7fb515bf..fb2ff12aa88 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -125,7 +125,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d2c64eea0b6..623af8c79d8 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -126,7 +126,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -171,7 +171,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index f088ae34050..25b7a8730dd 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateBom', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -363,7 +363,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of closing if ($action == 'close') { $text = $langs->trans('ConfirmCloseBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -391,7 +391,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of reopen if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenBom', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; @@ -477,7 +477,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=$proj->getNomUrl(); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 48798db9b8f..eb78228f068 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -366,7 +366,7 @@ foreach($object->fields as $key => $val) $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index baf4b096324..668ed29a62e 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -195,19 +195,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ $text_stock_options = $langs->trans("RealStockDesc").'
'; $text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'
'; - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'
' : ''); - $text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'
' : ''); + $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'
' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'
' : ''); print ''; print "\n"; print ''; print ''; print ''; print ''; - if (! empty($TChildBom)) { + if (!empty($TChildBom)) { if ($action == 'treeview') { foreach ($TChildBom as $fk_bom => $TProduct) { $repeatChar = ' '; - if (! empty($TProduct['bom'])) { + if (!empty($TProduct['bom'])) { if ($TProduct['parentid'] != $object->id) print ''; else print ''; print ''; print ''; } - if (! empty($TProduct['product'])) { + if (!empty($TProduct['product'])) { foreach ($TProduct['product'] as $fk_product => $TInfos) { $prod = new Product($db); $prod->fetch($fk_product); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 576d8f5fb09..1bbd9babfba 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -821,8 +821,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->create)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->create)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -933,8 +933,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -957,8 +957,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -981,8 +981,8 @@ class BOM extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1338,9 +1338,9 @@ class BOM extends CommonObject */ public function getNetNeeds(&$TNetNeeds = array(), $qty = 0) { - if (! empty($this->lines)) { + if (!empty($this->lines)) { foreach ($this->lines as $line) { - if (! empty($line->childBom)) { + if (!empty($line->childBom)) { foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); } else { if (empty($TNetNeeds[$line->fk_product])) { @@ -1362,9 +1362,9 @@ class BOM extends CommonObject */ public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0) { - if (! empty($this->lines)) { + if (!empty($this->lines)) { foreach ($this->lines as $line) { - if (! empty($line->childBom)) { + if (!empty($line->childBom)) { foreach ($line->childBom as $childBom) { $TNetNeeds[$childBom->id]['bom'] = $childBom; $TNetNeeds[$childBom->id]['parentid'] = $this->id; @@ -1572,7 +1572,7 @@ class BOMLine extends CommonObjectLine public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9a7114a6113..571815fb615 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -457,11 +457,11 @@ class ActionComm extends CommonObject if (!empty($this->datep) && !empty($this->datef)) { $this->durationp = ($this->datef - $this->datep); // deprecated } - //if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); + //if (!empty($this->date) && !empty($this->dateend)) $this->durationa=($this->dateend - $this->date); if (!empty($this->datep) && !empty($this->datef) && $this->datep > $this->datef) { $this->datef = $this->datep; } - //if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; + //if (!empty($this->date) && !empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; if (!isset($this->fk_project) || $this->fk_project < 0) { $this->fk_project = 0; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7fb2f0f129e..4260cd0c583 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1911,7 +1911,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } //print 'background: #'.$colortouse.';'; //print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));'; - //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; + //if (!empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; //print ' -moz-border-radius:4px;"'; //print 'border: 1px solid #ccc" width="100%"'; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index dd877e903e4..b42bf003333 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -830,7 +830,7 @@ if (!empty($arrayfields['a.note']['checked'])) { print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder); $totalarray['nbfield']++; } -//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) +//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) if (!empty($arrayfields['a.datep']['checked'])) { print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder); $totalarray['nbfield']++; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index c9b48665c95..764455e5f62 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -515,7 +515,7 @@ if ($object->fetch($id) >= 0) { $num = $db->num_rows($resql); $param = "&id=".$object->id; - //if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index bd1a83e9959..9ac09ac529b 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -58,7 +58,7 @@ print load_fiche_titre($title); print '
'; -//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo +//if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ // Search into emailings print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f0e1e57249e..fb75b3f0c6b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -693,7 +693,7 @@ if (empty($reshook)) { if ( !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' - && ! empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer) + && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1405,7 +1405,7 @@ if (empty($reshook)) { $pu = $pu_ht; $price_base_type = 'HT'; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -2057,7 +2057,7 @@ if ($action == 'create') { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && ! empty($user->rights->facture->creer)) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2106,7 +2106,7 @@ if ($action == 'create') { 'datenow' => true ); - if (! empty($conf->global->INVOICE_POINTOFTAX_DATE)) { + if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { $formquestion[] = array( 'type' => 'date', 'tdclass' => 'fieldrequired showonlyifgeneratedeposit', @@ -2799,7 +2799,7 @@ if ($action == 'create') { } } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print '' . $langs->trans("AddAction") . '
'; }*/ @@ -2809,7 +2809,7 @@ if ($action == 'create') { } // ReOpen - if ( (( ! empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { + if ( (( !empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { print 'global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; print '>'.$langs->trans('ReOpen').''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index aa7753946a7..51c07f15269 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1132,7 +1132,7 @@ class Propal extends CommonObject $sql .= ", '".$this->db->escape($this->model_pdf)."'"; $sql .= ", ".($this->fin_validite != '' ? "'".$this->db->idate($this->fin_validite)."'" : "NULL"); $sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : 'NULL'); - $sql .= ", ".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : 'NULL'); + $sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : 'NULL'); $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", '".$this->db->escape($this->ref_client)."'"; @@ -1738,7 +1738,7 @@ class Propal extends CommonObject $sql .= " fk_user_valid=".(isset($this->user_valid) ? $this->user_valid : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; - $sql .= " deposit_percent=".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").","; + $sql .= " deposit_percent=".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; $sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index c03cdf4fdcc..0e108b8ee9f 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -311,7 +311,7 @@ if (isModEnabled("propal") && $user->rights->propale->lire) { */ /* -if (! empty($conf->propal->enabled)) +if (!empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; @@ -386,7 +386,7 @@ if (! empty($conf->propal->enabled)) */ /* -if (! empty($conf->propal->enabled)) +if (!empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 507a24fd758..73bf27c0cfd 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -445,7 +445,7 @@ if (empty($reshook)) { // Now we create same links to contact than the ones found on origin object /* Useless, already into the create - if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + if (!empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; $originidforcontact = $object->origin_id; @@ -1170,7 +1170,7 @@ if (empty($reshook)) { $price_base_type = 'HT'; $pu = $pu_ht; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -1260,8 +1260,8 @@ if (empty($reshook)) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); if ( - GETPOST('generate_deposit', 'alpha') == 'on' && ! empty($deposit_percent_from_payment_terms) - && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer) + GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) + && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer) ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -2108,7 +2108,7 @@ if ($action == 'create' && $usercancreate) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (! empty($deposit_percent_from_payment_terms) && ! empty($conf->facture->enabled) && ! empty($user->rights->facture->creer)) { + if (!empty($deposit_percent_from_payment_terms) && !empty($conf->facture->enabled) && !empty($user->rights->facture->creer)) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2157,7 +2157,7 @@ if ($action == 'create' && $usercancreate) { 'datenow' => true ); - if (! empty($conf->global->INVOICE_POINTOFTAX_DATE)) { + if (!empty($conf->global->INVOICE_POINTOFTAX_DATE)) { $formquestion[] = array( 'type' => 'date', 'tdclass' => 'fieldrequired showonlyifgeneratedeposit', @@ -2805,7 +2805,7 @@ if ($action == 'create' && $usercancreate) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&token='.newToken().'&id='.$object->id, ''); } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) { // Add hidden condition because this is not a // "workflow" action so should appears somewhere else on diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index bf97deb3fd8..ca7d462a432 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -967,7 +967,7 @@ class Commande extends CommonOrder $sql .= ", ".($this->ref_int ? "'".$this->db->escape($this->ref_int)."'" : "null"); $sql .= ", '".$this->db->escape($this->model_pdf)."'"; $sql .= ", ".($this->cond_reglement_id > 0 ? ((int) $this->cond_reglement_id) : "null"); - $sql .= ", ".(! empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null"); + $sql .= ", ".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null"); $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : "null"); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", ".($this->availability_id > 0 ? ((int) $this->availability_id) : "null"); @@ -1782,7 +1782,7 @@ class Commande extends CommonOrder $this->lines[] = $line; /** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE - if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) + if (!empty($conf->global->PRODUIT_SOUSPRODUITS)) { $prod = new Product($this->db); $prod->fetch($idproduct); @@ -3355,7 +3355,7 @@ class Commande extends CommonOrder $sql .= " fk_user_valid=".((isset($this->user_valid) && $this->user_valid > 0) ? $this->user_valid : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; - $sql .= " deposit_percent=".(! empty($this->deposit_percent) ? strval($this->deposit_percent) : "null").","; + $sql .= " deposit_percent=".(!empty($this->deposit_percent) ? strval($this->deposit_percent) : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; $sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').","; $sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").","; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 2315f12757a..4e86cb21141 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -269,7 +269,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index d7744f777fe..bc45f3b417d 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -258,7 +258,7 @@ class CashControl extends CommonObject /* $posmodule = $this->posmodule; - if (! empty($user->rights->$posmodule->use)) + if (!empty($user->rights->$posmodule->use)) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index bdb375c6b6b..031247951e9 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -652,7 +652,7 @@ if (empty($reshook)) { $newlang = ''; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -861,7 +861,7 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 04c6df7ff1e..589eb9dfcab 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1787,7 +1787,7 @@ if (empty($reshook)) { // Now we create same links to contact than the ones found on origin object /* Useless, already into the create - if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + if (!empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) { $originforcontact = $object->origin; $originidforcontact = $object->origin_id; @@ -2559,7 +2559,7 @@ if (empty($reshook)) { $price_base_type = 'HT'; $pu = $pu_ht; - if (empty($pu) && ! empty($pu_ttc)) { + if (empty($pu) && !empty($pu_ttc)) { $pu = $pu_ttc; $price_base_type = 'TTC'; } @@ -3367,13 +3367,13 @@ if ($action == 'create') { ); $typedeposit = GETPOST('typedeposit', 'aZ09'); $valuedeposit = GETPOST('valuedeposit', 'int'); - if (empty($typedeposit) && ! empty($objectsrc->deposit_percent)) { + if (empty($typedeposit) && !empty($objectsrc->deposit_percent)) { $origin_payment_conditions_deposit_percent = getDictionaryValue('c_payment_term', 'deposit_percent', $objectsrc->cond_reglement_id); - if (! empty($origin_payment_conditions_deposit_percent)) { + if (!empty($origin_payment_conditions_deposit_percent)) { $typedeposit = 'variable'; } } - if (empty($valuedeposit) && $typedeposit == 'variable' && ! empty($objectsrc->deposit_percent)) { + if (empty($valuedeposit) && $typedeposit == 'variable' && !empty($objectsrc->deposit_percent)) { $valuedeposit = $objectsrc->deposit_percent; } print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ab0fd8029d8..594ee548da7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1587,7 +1587,7 @@ class Facture extends CommonInvoice $amountdeposit = array(); $descriptions = array(); - if (! empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) { + if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)) { $amount = $origin->total_ttc * ($origin->deposit_percent / 100); $TTotalByTva = array(); @@ -1596,8 +1596,8 @@ class Facture extends CommonInvoice continue; } $TTotalByTva[$line->tva_tx] += $line->total_ttc; - $descriptions[$line->tva_tx] .= '
  • ' . (! empty($line->product_ref) ? $line->product_ref . ' - ' : ''); - $descriptions[$line->tva_tx] .= (! empty($line->product_label) ? $line->product_label . ' - ' : ''); + $descriptions[$line->tva_tx] .= '
  • ' . (!empty($line->product_ref) ? $line->product_ref . ' - ' : ''); + $descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : ''); $descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty; $descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '
  • '; } @@ -1623,8 +1623,8 @@ class Facture extends CommonInvoice $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? $tva_tx = $lines[$i]->tva_tx; $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100; - $descriptions[$tva_tx] .= '
  • ' . (! empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); - $descriptions[$tva_tx] .= (! empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); + $descriptions[$tva_tx] .= '
  • ' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' : ''); + $descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : ''); $descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty; $descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '
  • '; } @@ -1644,7 +1644,7 @@ class Facture extends CommonInvoice $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; // Hidden conf - if (! empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && ! empty($descriptions[$tva])) { + if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) { $descline .= '
      ' . $descriptions[$tva] . '
    '; } @@ -1739,7 +1739,7 @@ class Facture extends CommonInvoice return null; } - if (! empty($autoValidateDeposit)) { + if (!empty($autoValidateDeposit)) { $validateReturn = $deposit->validate($user, '', 0, $notrigger); if ($validateReturn < 0) { diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index 28d095715c2..e9aab173337 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -244,7 +244,7 @@ $description .= $langs->trans($LT); $calcmode = $langs->trans("LTReportBuildWithOptionDefinedInModule").' '; $calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRulesLT", DOL_URL_ROOT.'/admin/company.php').')'; -//if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
    '.$langs->trans("ThisIsAnEstimatedValue"); +//if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description.='
    '.$langs->trans("ThisIsAnEstimatedValue"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 969376209eb..696e70ab40d 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -190,7 +190,7 @@ $builddate = dol_now(); if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') $description.=$langs->trans("RulesVATInProducts"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') $description.='
    '.$langs->trans("RulesVATDueServices"); if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
    '.$langs->trans("RulesVATInServices"); -if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
    '.$langs->trans("DepositsAreNotIncluded"); } */ diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index a2b33f4fc7b..46a01e4ba70 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -858,10 +858,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
    '; print ' '.$checkboxlabel; - /*if (! empty($conf->prelevement->enabled)) + /*if (!empty($conf->prelevement->enabled)) { $langs->load("withdrawals"); - if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
    '.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); + if (!empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
    '.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); }*/ print '


    '; print '
    '; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index f163041a43a..1b2a8dcfc34 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -119,8 +119,8 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture $outputlangs->setDefaultLang(GETPOST('lang_id', 'aZ09')); } - $hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0; - $hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0; + $hidedetails = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0; + $hidedesc = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0; $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0; $sql = 'SELECT f.rowid as facid'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index f76cc6b27c1..1b2bbe63525 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -237,7 +237,7 @@ if ($resql) { print '
    '; /* -if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) +if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 401752af11b..ae3e1a201fa 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -95,7 +95,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char $fac->fetch($id); $outputlangs = $langs; - if (! empty($_REQUEST['lang_id'])) + if (!empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); @@ -292,7 +292,7 @@ if ($resql) { print '
    '; /* -if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) +if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 57157ec0140..bbe32d0cbc1 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -230,7 +230,7 @@ if ($modecompta == "CREANCES-DETTES") { $exportlink = ''; $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; - //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); + //if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); } @@ -266,10 +266,10 @@ foreach ($months as $k => $v) { print ''; if ($modecompta == 'CREANCES-DETTES') { - //if (! empty($date_start) && ! empty($date_end)) + //if (!empty($date_start) && !empty($date_end)) // $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "RECETTES-DEPENSES") { - //if (! empty($date_start) && ! empty($date_end)) + //if (!empty($date_start) && !empty($date_end)) // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active @@ -278,9 +278,9 @@ if ($modecompta == 'CREANCES-DETTES') { /* $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; $sql.= " WHERE t.numero_compte = aa.account_number AND aa.fk_accounting_category = 0"; - if (! empty($date_start) && ! empty($date_end)) + if (!empty($date_start) && !empty($date_end)) $sql.= " AND t.doc_date >= '".$db->idate($date_start)."' AND t.doc_date <= '".$db->idate($date_end)."'"; - if (! empty($month)) { + if (!empty($month)) { $sql .= " AND MONTH(t.doc_date) = " . ((int) $month); } $resql = $db->query($sql); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index c4bfc127262..d1cc70b4927 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -66,7 +66,7 @@ abstract class ActionsContactCardCommon if (is_object($this->object) && method_exists($this->object,'fetch')) { - if (! empty($id)) $this->object->fetch($id); + if (!empty($id)) $this->object->fetch($id); } else {*/ diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3028a3719f1..bd45ae69ada 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -532,7 +532,7 @@ if (empty($reshook)) { } // Update extrafields - if ($action == 'update_extras' && ! empty($user->rights->societe->contact->creer)) { + if ($action == 'update_extras' && !empty($user->rights->societe->contact->creer)) { $object->oldcopy = dol_clone($object); // Fill array 'array_options' with data from update form diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index e4cc743159e..729c99f1186 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -608,9 +608,9 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; + $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; } */ print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index ec56b4f7c2a..a247e9b1302 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -831,14 +831,14 @@ if (!empty($arrayfields['p.town']['checked'])) { print ''; } // State -/*if (! empty($arrayfields['state.nom']['checked'])) +/*if (!empty($arrayfields['state.nom']['checked'])) { print '
    '; } // Region - if (! empty($arrayfields['region.nom']['checked'])) + if (!empty($arrayfields['region.nom']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } // Region - if (! empty($arrayfields['region.nom']['checked'])) + if (!empty($arrayfields['region.nom']['checked'])) { print "\n"; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index e88c056af37..6680f7f7ee3 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -62,12 +62,12 @@ if ($id) { } $socid = $object->thirdparty->id; $title = $langs->trans("Projects"); - if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { + if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name." - ".$title; } llxHeader('', $title); - if (! empty($conf->notification->enabled)) { + if (!empty($conf->notification->enabled)) { $langs->load("mails"); } $head = contact_prepare_head($object); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index a8dc5e7ee3b..29288708664 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -227,11 +227,11 @@ if ($id > 0) { $out=''; $permok=$user->rights->agenda->myactions->create; - if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 088d8f9b6d5..bc43c54a8ec 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2650,7 +2650,7 @@ class Contrat extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($contractlineprocessed[$obj->lid]) || ! empty($contractignored[$obj->rowid]) || ! empty($contracterror[$obj->rowid])) { + if (!empty($contractlineprocessed[$obj->lid]) || !empty($contractignored[$obj->rowid]) || !empty($contracterror[$obj->rowid])) { continue; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 1bd9d3388f6..92a5a3f5999 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index ce386fe21b9..bf1c83dccb3 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -123,7 +123,7 @@ if ($object->id) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 540491698c1..044d6e4941e 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = ''; - //if (! empty($modCodeContract->code_auto)) { + //if (!empty($modCodeContract->code_auto)) { $morehtmlref .= $object->ref; /*} else { $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 2869c66cd9f..cfc888e229a 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -375,7 +375,7 @@ if (!$resql) { $num = $db->num_rows($resql); /* -if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { $obj = $db->fetch_object($resql); $id = $obj->id; diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 9bf56b2f876..4db2c64206a 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -40,7 +40,7 @@ if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id > } // Link by reference -if ($action == 'addlinkbyref' && ! empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { +if ($action == 'addlinkbyref' && !empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { $element_prop = getElementProperties($addlink); if (is_array($element_prop)) { dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php'); diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 05fad8148fa..a127fa08645 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -126,8 +126,8 @@ if (!empty($field) && !empty($element) && !empty($table_element) && !empty($fk_e $check_access = restrictedArea($user, $feature, $object_id, '', $feature2); //var_dump($user->rights); /* - if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write) - || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) + if (!empty($user->rights->$newelement->creer) || !empty($user->rights->$newelement->create) || !empty($user->rights->$newelement->write) + || (isset($subelement) && (!empty($user->rights->$newelement->$subelement->creer) || !empty($user->rights->$newelement->$subelement->write))) || ($element == 'payment' && $user->rights->facture->paiement) || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) */ diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 99ea5541c98..4251a4491f6 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -97,7 +97,7 @@ class box_contracts extends ModeleBoxes if ($user->socid) { $sql .= " AND s.rowid = ".((int) $user->socid); } - if (! empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { + if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) { $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC "; } else { $sql .= " ORDER BY c.tms DESC, c.ref DESC "; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9a212d0a10e..9ec279fe2d0 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -171,7 +171,7 @@ class box_services_contracts extends ModeleBoxes // Add description in form if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - //$text .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; + //$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; $description = ''; // Already added into main visible desc } diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 910e6d3ca77..5d423a9e202 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -259,7 +259,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $out .= img_picto($langs->trans("MoveBox", $this->box_id), 'grip_title', 'class="opacitymedium boxhandle hideonsmartphone cursormove marginleftonly"'); $out .= img_picto($langs->trans("CloseBox", $this->box_id), 'close_title', 'class="opacitymedium boxclose cursorpointer marginleftonly" rel="x:y" id="imgclose'.$this->box_id.'"'); $label = $head['text']; - //if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; + //if (!empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; if (!empty($head['graph'])) { $label .= ' '; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index f9157a6a3c2..ba657f58087 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -471,7 +471,7 @@ class CMailFile $msgid = $headers->get('Message-ID'); $msgid->setId($headerID); $headers->addIdHeader('References', $headerID); - // TODO if (! empty($moreinheader)) ... + // TODO if (!empty($moreinheader)) ... // Give the message a subject try { @@ -580,7 +580,7 @@ class CMailFile $this->errors[] = $e->getMessage(); } } - //if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); + //if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) { try { $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from)); @@ -1561,7 +1561,7 @@ class CMailFile $host = 'ssl://'.$host; } // tls smtp start with no encryption - //if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; + //if (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host; dol_syslog("Try socket connection to host=".$host." port=".$port); //See if we can connect to the SMTP server diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index 7a60e7b6e03..dc38d38185e 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -116,7 +116,7 @@ class AntiVir fclose($handle); - if (! empty($conf->global->MAIN_UMASK)) + if (!empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } else diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a16881cd61e..7f99363794a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1085,8 +1085,8 @@ abstract class CommonObject $forcedownload = 0; $paramlink = ''; - //if (! empty($modulepart)) $paramlink.=($paramlink?'&':'').'modulepart='.$modulepart; // For sharing with hash (so public files), modulepart is not required. - //if (! empty($ecmfile->entity)) $paramlink.='&entity='.$ecmfile->entity; // For sharing with hash (so public files), entity is not required. + //if (!empty($modulepart)) $paramlink.=($paramlink?'&':'').'modulepart='.$modulepart; // For sharing with hash (so public files), modulepart is not required. + //if (!empty($ecmfile->entity)) $paramlink.='&entity='.$ecmfile->entity; // For sharing with hash (so public files), entity is not required. //$paramlink.=($paramlink?'&':'').'file='.urlencode($filepath); // No need of name of file for public link, we will use the hash if (!empty($ecmfile->share)) { $paramlink .= ($paramlink ? '&' : '').'hashp='.$ecmfile->share; // Hash for public share @@ -4917,7 +4917,7 @@ abstract class CommonObject //Line extrafield $line->fetch_optionals(); - //if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) if (is_object($hookmanager)) { // Old code is commented on preceding line. if (empty($line->fk_parent_line)) { $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer, 'selected'=>$selected, 'table_element_line'=>$line->table_element); @@ -6159,7 +6159,7 @@ abstract class CommonObject // If we clone, we have to clean unique extrafields to prevent duplicates. // This behaviour can be prevented by external code by changing $this->context['createfromclone'] value in createFrom hook - if (! empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && ! empty($attributeUnique)) { + if (!empty($this->context['createfromclone']) && $this->context['createfromclone'] == 'createfromclone' && !empty($attributeUnique)) { $new_array_options[$key] = null; } @@ -8582,7 +8582,7 @@ abstract class CommonObject $filearray = dol_dir_list($dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); - /*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs + /*if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs { $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearray=array_merge($filearray, $filearrayold); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index cea529726e5..8ddfb9290e7 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1571,7 +1571,7 @@ class ExtraFields if ($type == 'date') $out.=' (YYYY-MM-DD)'; elseif ($type == 'datetime') $out.=' (YYYY-MM-DD HH:MM:SS)'; */ - /*if (! empty($help) && $keyprefix != 'search_options_') { + /*if (!empty($help) && $keyprefix != 'search_options_') { $out .= $form->textwithpicto('', $help, 1, 'help', '', 0, 3); }*/ return $out; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1ecd05cc3a5..838aea25f53 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -732,7 +732,7 @@ class Form } } // If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone) - //if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger)) + //if (!empty($conf->dol_no_mouse_hover) && !empty($tooltiptrigger)) //{ //if ($type == 'info' || $type == 'help') return ''.$text.'''; //} @@ -1433,7 +1433,7 @@ class Form $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); if (!empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); } else { @@ -2674,7 +2674,7 @@ class Form if (!empty($conf->global->MAIN_MULTILANGS)) { $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; } - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && ! empty($socid)) { + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; } if (!empty($conf->global->PRODUCT_AJAX_SEARCH_ON_DESCRIPTION)) { @@ -2733,7 +2733,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); @@ -2959,7 +2959,7 @@ class Form } $opt .= '>'; $opt .= $objp->ref; - if (! empty($objp->custref)) { + if (!empty($objp->custref)) { $opt.= ' (' . $objp->custref . ')'; } if ($outbarcode) { @@ -2971,7 +2971,7 @@ class Form } $objRef = $objp->ref; - if (! empty($objp->custref)) { + if (!empty($objp->custref)) { $objRef .= ' (' . $objp->custref . ')'; } if (!empty($filterkey) && $filterkey != '') { @@ -4086,7 +4086,7 @@ class Form $selectedDepositPercent = null; foreach ($this->cache_conditions_paiements as $id => $arrayconditions) { - if ($filtertype <= 0 && ! empty($arrayconditions['deposit_percent'])) { + if ($filtertype <= 0 && !empty($arrayconditions['deposit_percent'])) { continue; } @@ -4098,7 +4098,7 @@ class Form } $label = $arrayconditions['label']; - if (! empty($arrayconditions['deposit_percent'])) { + if (!empty($arrayconditions['deposit_percent'])) { $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'], $label); } @@ -5380,7 +5380,7 @@ class Form if (isset($this->cache_conditions_paiements[$selected])) { $label = $this->cache_conditions_paiements[$selected]['label']; - if (! empty($this->cache_conditions_paiements[$selected]['deposit_percent'])) { + if (!empty($this->cache_conditions_paiements[$selected]['deposit_percent'])) { $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label); } @@ -6231,7 +6231,7 @@ class Form } } $return .= '>'; - //if (! empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES)) + //if (!empty($conf->global->MAIN_VAT_SHOW_POSITIVE_RATES)) if ($mysoc->country_code == 'IN' || !empty($conf->global->MAIN_VAT_LABEL_IS_POSITIVE_RATES)) { $return .= $rate['labelpositiverates']; } else { @@ -7031,7 +7031,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7229,7 +7229,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7441,7 +7441,7 @@ class Form $textifempty = ''; // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { if ($showempty && !is_numeric($showempty)) $textifempty = $langs->trans($showempty); else $textifempty .= $langs->trans("All"); @@ -7773,7 +7773,7 @@ class Form // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 $textifempty = ' '; - //if (! empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; + //if (!empty($conf->use_javascript_ajax) || $forcecombo) $textifempty=''; if (!empty($conf->global->$confkeyforautocompletemode)) { if ($showempty && !is_numeric($showempty)) { $textifempty = $langs->trans($showempty); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 98b1fbd6593..612e555a6b0 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1889,7 +1889,7 @@ class FormFile print img_picto($langs->trans("FileSharedViaALink"), 'globe').' '; print ''; } - //if (! empty($useinecm) && $useinecm != 6) print ''; //print img_view().'   '; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 47bbdec0fb2..4d34211ed17 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -381,9 +381,9 @@ class FormProjets if (!empty($show_empty)) { $out .= ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); - if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); $extrafieldsobjectkey='projet'; $extrafieldsobjectprefix='efp.'; @@ -1412,32 +1412,32 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) + if (!empty($arrayfields['p.fk_opp_status']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_amount']['checked'])) + if (!empty($arrayfields['p.opp_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_percent']['checked'])) + if (!empty($arrayfields['p.opp_percent']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.budget_amount']['checked'])) + if (!empty($arrayfields['p.budget_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.usage_bill_time']['checked'])) + if (!empty($arrayfields['p.usage_bill_time']['checked'])) { print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); - if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); - if (! empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); + if (!empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER["PHP_SELF"], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['p.usage_bill_time']['checked'])) print_liste_field_titre($arrayfields['p.usage_bill_time']['label'], $_SERVER["PHP_SELF"], 'p.usage_bill_time', "", $param, '', $sortfield, $sortorder, 'right '); $extrafieldsobjectkey='projet'; $extrafieldsobjectprefix='efp.'; @@ -1816,32 +1816,32 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print ''; // PROJECT fields - if (! empty($arrayfields['p.fk_opp_status']['checked'])) + if (!empty($arrayfields['p.fk_opp_status']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_amount']['checked'])) + if (!empty($arrayfields['p.opp_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.opp_percent']['checked'])) + if (!empty($arrayfields['p.opp_percent']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.budget_amount']['checked'])) + if (!empty($arrayfields['p.budget_amount']['checked'])) { print '\n"; } - if (! empty($arrayfields['p.usage_bill_time']['checked'])) + if (!empty($arrayfields['p.usage_bill_time']['checked'])) { print ''; } /*TODO Add link to expeditiondet_batch - if (! empty($conf->productbatch->enabled)) + if (!empty($conf->productbatch->enabled)) { print ''; @@ -396,7 +396,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Batch number managment /*TODO Add link to expeditiondet_batch - if (! empty($conf->productbatch->enabled)) + if (!empty($conf->productbatch->enabled)) { //var_dump($objp->edrowid); $lines[$i]->detail_batch diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index c6b1bdefe6c..afad01ebcff 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -54,7 +54,7 @@ function stock_prepare_head($object) */ /* Disabled because will never be implemented. Table always empty. - if (! empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) + if (!empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) { // Should not be enabled by defaut because does not work yet correctly because // personnal stocks are not tagged into table llx_entrepot diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index aef55e09bd6..962ae897bca 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -483,7 +483,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print '
    '.$langs->trans('Product'); - if (! empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') { + if (!empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') { print '   '.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'  '; print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' '; } @@ -216,11 +216,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).''.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'
    '.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); @@ -233,7 +233,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
    '; print ''; print ''; print ''; @@ -981,8 +981,8 @@ if (!empty($arrayfields['p.zip']['checked'])) { if (!empty($arrayfields['p.town']['checked'])) { print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder); } -//if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); -//if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); +//if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); +//if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder); if (!empty($arrayfields['country.code_iso']['checked'])) { print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); } @@ -1150,13 +1150,13 @@ while ($i < min($num, $limit)) { } } // State - /*if (! empty($arrayfields['state.nom']['checked'])) + /*if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."".$obj->region_name."
    '; $code = dol_getIdFromCode($db, $lines[$i]->fk_opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print "'; print price($lines[$i]->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); print "'; print price($lines[$i]->opp_percent, 0, $langs, 1, 0).' %'; print "'; print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print "'; print yn($lines[$i]->usage_bill_time); @@ -1718,7 +1718,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $restrictBefore = null; - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); } @@ -1802,11 +1802,11 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print '
    '; $code = dol_getIdFromCode($db, $lines[$i]->fk_opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print "'; print price($lines[$i]->opp_amount, 0, $langs, 1, 0, -1, $conf->currency); print "'; print price($lines[$i]->opp_percent, 0, $langs, 1, 0).' %'; print "'; print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency); print "'; print yn($lines[$i]->usage_bill_time); @@ -2111,7 +2111,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $restrictBefore = null; - if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + if (!empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 380282fc48b..287a151f41c 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -159,7 +159,7 @@ if (!function_exists('dol_loginfunction')) { /* $conf->css = "/theme/".(GETPOST('theme','aZ09')?GETPOST('theme','aZ09'):$conf->theme)."/style.css.php"; $themepath=dol_buildpath($conf->css,1); - if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application + if (!empty($conf->modules_parts['theme'])) // Using this feature slow down application { foreach($conf->modules_parts['theme'] as $reldir) { diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 4988be3cefd..df6e3231a0b 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -280,7 +280,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''.$langs->trans("Warehouse").''; print '
    '.$langs->trans("TopMenuDisableImages").''.($conf->global->THEME_TOPMENU_DISABLE_IMAGE?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -565,7 +565,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -608,7 +608,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -652,7 +652,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_VERMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -825,7 +825,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTLINK:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -968,7 +968,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_BTNACTION:$langs->trans("Default")).'conf->THEME_ELDY_BTNACTION)?" checked":""); + print 'conf->THEME_ELDY_BTNACTION)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -1014,7 +1014,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print '
    '.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTBTNACTION:$langs->trans("Default")).'conf->THEME_ELDY_TEXTBTNACTION)?" checked":""); + print 'conf->THEME_ELDY_TEXTBTNACTION)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index e5042807b02..58a0c6a64dd 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -309,7 +309,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o $indexcontent .= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n"; $indexcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n"; $indexcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded\n"; - $indexcontent .= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n"; + $indexcontent .= 'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'."\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; @@ -341,7 +341,7 @@ function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $o $indexcontent .= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n"; $indexcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n"; $indexcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once '".$relpath."/master.inc.php'; } // Load master if not already loaded\n"; - $indexcontent .= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n"; + $indexcontent .= 'if (!empty($_GET[\'pageref\']) || !empty($_GET[\'pagealiasalt\']) || !empty($_GET[\'pageid\'])) {'."\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n"; $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n"; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 71f399497c7..037d1fee8c2 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -148,7 +148,7 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout if (!empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); - /*} elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + /*} elseif (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4707657d3e3..35b233ba6e5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -208,7 +208,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'Projet', 'link' => '/projet/index.php?mainmenu=project&leftmenu=', - 'title' => (! empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"), + 'title' => (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"), 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, @@ -544,7 +544,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = if (!empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); - /*} elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + /*} elseif (!empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); }*/ @@ -1773,7 +1773,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef } $modecompta = 'RECETTES-DEPENSES'; - //if (isModEnabled('accounting') && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + //if (isModEnabled('accounting') && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED if ($modecompta) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index cb73b6fc282..d34c66c0def 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); @@ -954,7 +954,7 @@ class pdf_einstein extends ModelePDFCommandes // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -984,7 +984,7 @@ class pdf_einstein extends ModelePDFCommandes } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1044,7 +1044,7 @@ class pdf_einstein extends ModelePDFCommandes } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1075,7 +1075,7 @@ class pdf_einstein extends ModelePDFCommandes } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 8930481d219..28003fff639 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -992,7 +992,7 @@ class pdf_eratosthene extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); @@ -1168,7 +1168,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1197,7 +1197,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1257,7 +1257,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1288,7 +1288,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 365a2326281..380fb5b79a0 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -600,7 +600,7 @@ class pdf_standard extends ModeleExpenseReport //$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C'); // Project - //if (! empty($conf->project->enabled)) + //if (!empty($conf->project->enabled)) //{ // $pdf->SetFont('','', $default_font_size - 1); // $pdf->SetXY($this->posxprojet, $curY); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 14c13ceb57c..3b82e92f1ab 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -453,9 +453,9 @@ class pdf_crabe extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; $qrcodestring = ''; - if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { + if (!empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); - } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + } elseif (!empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { $qrcodestring = $object->buildSwitzerlandQRString(); } if ($qrcodestring) { @@ -1341,7 +1341,7 @@ class pdf_crabe extends ModelePDFFactures // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1373,7 +1373,7 @@ class pdf_crabe extends ModelePDFFactures } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1435,7 +1435,7 @@ class pdf_crabe extends ModelePDFFactures } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1465,7 +1465,7 @@ class pdf_crabe extends ModelePDFFactures } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 5555589b910..a537e35223f 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -462,9 +462,9 @@ class pdf_sponge extends ModelePDFFactures // You can add more thing under header here, if you increase $extra_under_address_shift too. $extra_under_address_shift = 0; $qrcodestring = ''; - if (! empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { + if (!empty($conf->global->INVOICE_ADD_ZATCA_QR_CODE)) { $qrcodestring = $object->buildZATCAQRString(); - } elseif (! empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { + } elseif (!empty($conf->global->INVOICE_ADD_SWISS_QR_CODE)) { $qrcodestring = $object->buildSwitzerlandQRString(); } if ($qrcodestring) { @@ -1613,7 +1613,7 @@ class pdf_sponge extends ModelePDFFactures // FIXME amount of vat not supported with multicurrency //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1645,7 +1645,7 @@ class pdf_sponge extends ModelePDFFactures } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1730,7 +1730,7 @@ class pdf_sponge extends ModelePDFFactures } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1761,7 +1761,7 @@ class pdf_sponge extends ModelePDFFactures } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 0c645099f56..0a07fff6aaf 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -79,7 +79,7 @@ class modBlockedLog extends DolibarrModules // Currently, activation is not automatic because only companies (in France) making invoices to non business customers must // enable this module. - /*if (! empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)) + /*if (!empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY)) { $tmp=explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY); $this->automatic_activation = array(); diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 8b846089a03..e90b42a40aa 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -182,7 +182,7 @@ class modECM extends DolibarrModules 'langs'=>'ecm', 'position'=>103, 'perms'=>'$user->rights->ecm->read || $user->rights->ecm->upload', - 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)', + 'enabled'=>'($user->rights->ecm->read || $user->rights->ecm->upload) && !empty($conf->global->ECM_AUTO_TREE_ENABLED)', 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 7e7d010ed5d..5f898584ba4 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -378,7 +378,7 @@ class modSociete extends DolibarrModules 't.libelle'=>"ThirdPartyType" ); // Add multicompany field - if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { + if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { if (isModEnabled('multicompany')) { $nbofallowedentities = count(explode(',', getEntity('contact'))); if ($nbofallowedentities > 1) { diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index f83b6efa1ed..6f2a6fcf694 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -1119,7 +1119,7 @@ class pdf_standard extends ModelePDFMovement // Show sender $posy=42; $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; // Show sender frame diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index af37f6bbfcd..ba41c94ab4f 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -875,7 +875,7 @@ class pdf_vinci extends ModelePDFMo $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -905,7 +905,7 @@ class pdf_vinci extends ModelePDFMo } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1085,7 +1085,7 @@ class pdf_vinci extends ModelePDFMo //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index ea52b9c3c70..3f75a87fc73 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -351,7 +351,7 @@ class pdf_standard extends ModelePDFProduct if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page { $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (!empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposafter+1); } @@ -439,7 +439,7 @@ class pdf_standard extends ModelePDFProduct // Retrieve type from database for backward compatibility with old records if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined - && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax + && (!empty($localtax1_rate) || !empty($localtax2_rate))) // and there is local tax { $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$object->thirdparty,$mysoc); $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] : ''; @@ -457,7 +457,7 @@ class pdf_standard extends ModelePDFProduct $this->tva[$vatrate] += $tvaligne; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) + if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); @@ -499,7 +499,7 @@ class pdf_standard extends ModelePDFProduct $this->_pagefoot($pdf,$object,$outputlangs,1); // New page $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (!empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } @@ -775,7 +775,7 @@ class pdf_standard extends ModelePDFProduct // Show sender $posy=42; $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; // Show sender frame diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index bb6389a2e67..3d209fce798 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1129,7 +1129,7 @@ class pdf_azur extends ModelePDFPropales // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1159,7 +1159,7 @@ class pdf_azur extends ModelePDFPropales } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1221,7 +1221,7 @@ class pdf_azur extends ModelePDFPropales } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1251,7 +1251,7 @@ class pdf_azur extends ModelePDFPropales } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1299,7 +1299,7 @@ class pdf_azur extends ModelePDFPropales /* $resteapayer = $object->total_ttc - $deja_regle; - if (! empty($object->paye)) $resteapayer=0; + if (!empty($object->paye)) $resteapayer=0; */ if ($deja_regle > 0) { diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7be7170edb2..224e3979f38 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1254,7 +1254,7 @@ class pdf_cyan extends ModelePDFPropales // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1285,7 +1285,7 @@ class pdf_cyan extends ModelePDFPropales } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1342,7 +1342,7 @@ class pdf_cyan extends ModelePDFPropales } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1373,7 +1373,7 @@ class pdf_cyan extends ModelePDFPropales } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1423,7 +1423,7 @@ class pdf_cyan extends ModelePDFPropales $resteapayer = 0; /* $resteapayer = $object->total_ttc - $deja_regle; - if (! empty($object->paye)) $resteapayer=0; + if (!empty($object->paye)) $resteapayer=0; */ if ($deja_regle > 0) { diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 4d1d01db682..257bdf55e52 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -98,7 +98,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode if (!isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) { $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)."
    \n"; } - //if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."
    \n"; + //if (!empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)."
    \n"; if (!empty($conf->global->COMPANY_AQUARIUM_CLEAN_REGEX)) { $texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.$conf->global->COMPANY_AQUARIUM_CLEAN_REGEX."
    \n"; } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 5bff26a9d1d..9a6ee3c5f01 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -882,7 +882,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes } */ /* TODO - else if (! empty($object->availability_code)) + else if (!empty($object->availability_code)) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetTextColor(200,0,0); diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 76c0ed56851..5cbdad90b03 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -167,7 +167,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->posxqty = 130; $this->posxunit = 147; } - //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + //if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) { // To work with US executive format $this->posxpicture -= 20; @@ -740,7 +740,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $tvakey => $tvaval) { @@ -765,7 +765,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } //} - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $tvakey => $tvaval) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 233d18ce229..a8f671fb528 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1031,7 +1031,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -1061,7 +1061,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1241,7 +1241,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 5498800aefc..12b5b990648 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -912,7 +912,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ //Local tax 1 foreach ($this->localtax1 as $localtax_type => $localtax_rate) { @@ -942,7 +942,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } } - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ //Local tax 2 foreach ($this->localtax2 as $localtax_type => $localtax_rate) { @@ -1150,7 +1150,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); //Affiche le filigrane brouillon - Print Draft Watermark - /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) + /*if($object->statut==0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) { pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); }*/ diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 6919ffe69aa..676c5768ea3 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -131,7 +131,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $this->posxtva = 90; $this->posxtotalttc = 180; - //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + //if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; if ($this->page_largeur < 210) { // To work with US executive format $this->posxreffacturefourn -= 20; $this->posxreffacture -= 20; @@ -676,10 +676,10 @@ class pdf_standard extends ModelePDFSuppliersPayments } } - if (! empty($conf->global->PDF_SHOW_PROJECT)) + if (!empty($conf->global->PDF_SHOW_PROJECT)) { $object->fetch_projet(); - if (! empty($object->project->ref)) + if (!empty($object->project->ref)) { $outputlangs->load("projects"); $posy+=4; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 70ee5d75710..f5825957845 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -964,7 +964,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Nothing to do } else { //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -994,7 +994,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //} //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('1', '3', '5'))) { @@ -1048,7 +1048,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //{ foreach ($this->localtax1 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { @@ -1078,7 +1078,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } //} //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //{ foreach ($this->localtax2 as $localtax_type => $localtax_rate) { if (in_array((string) $localtax_type, array('2', '4', '6'))) { diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 5965132d68c..b07bb66b46c 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -316,7 +316,7 @@ if ($forgetpasslink || $helpcenterlink) { if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->file->main_authentication)) { $langs->load("users"); - //if (! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url= + //if (!empty($conf->global->MAIN_OPENIDURL_PERUSER)) $url= echo '
    '; echo '
    '; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 54ee9929cb2..44cd1d1f660 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -141,7 +141,7 @@ class InterfaceStripe extends DolibarrTriggers } if ($changerequested) { - /*if (! empty($object->email)) $customer->email = $object->email; + /*if (!empty($object->email)) $customer->email = $object->email; $customer->description = $namecleaned; if (empty($taxinfo)) $customer->tax_info = array('type'=>'vat', 'tax_id'=>null); else $customer->tax_info = $taxinfo; */ diff --git a/htdocs/don/card.php b/htdocs/don/card.php index bf9ba2e6388..f3bfca6ee95 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -351,9 +351,9 @@ if (empty($reshook)) { // Define output language $outputlangs = $langs; $newlang=''; - if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) + if (!empty($newlang)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 4c0811e70c9..080ac3b9540 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -832,8 +832,8 @@ class Don extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 624f8d6ddf0..0a1114fb40c 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -371,8 +371,8 @@ if (!empty($object->share)) { } $fulllink = $urlwithroot.'/document.php'.($paramlink ? '?'.$paramlink : ''); - //if (! empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path - //elseif (! empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content + //if (!empty($object->ref)) $fulllink.='&hashn='.$object->ref; // Hash of file path + //elseif (!empty($object->label)) $fulllink.='&hashc='.$object->label; // Hash of file content print img_picto('', 'globe').' '; if ($action != 'edit') { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 50b7047b90d..006376cfd55 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -432,7 +432,7 @@ class EmailCollector extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; $this->password = dolDecrypt($this->password); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 2c22bfb77ab..faddee08d29 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -444,8 +444,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -468,8 +468,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -492,8 +492,8 @@ class ConferenceOrBooth extends ActionComm return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 158b29e4cf6..78fe18366b7 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -541,8 +541,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->conferenceorboothattendee->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->conferenceorboothattendee->conferenceorboothattendee_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->conferenceorboothattendee_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -684,8 +684,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -708,8 +708,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -732,8 +732,8 @@ class ConferenceOrBoothAttendee extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->eventorganization->eventorganization_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 33b8f633b3a..499c6d7ac6d 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -396,7 +396,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -417,7 +417,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 4c5b2f394a9..b5e25872bf5 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -172,7 +172,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index 77c2ec512f4..d770d5e1900 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -71,7 +71,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) +if (!empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) { $langs->load("orders"); @@ -152,7 +152,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) +if (!empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."eventorganization_myobject as s"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 333c93fdfd7..f947e86a66a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -466,7 +466,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } // TODO add alternative status - //} elseif ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate))) + //} elseif ($action == 'reopen' && (!empty($user->rights->expedition->creer) || !empty($user->rights->expedition->shipping_advance->validate))) //{ // $result = $object->setStatut(0); // if ($result < 0) @@ -1218,7 +1218,7 @@ if ($action == 'create') { print ''; print ''; } else { - if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { + if (!empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { print ''; print ''; } @@ -1402,7 +1402,7 @@ if ($action == 'create') { print ''; print ''; } else { - if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { + if (!empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { print ''; } @@ -2515,7 +2515,7 @@ if ($action == 'create') { // Create bill if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->rights->facture->creer) { - // TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) + // TODO show button only if (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // If we do that, we must also make this option official. print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 9daa03a3ec8..3c1656ebf84 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -68,7 +68,7 @@ $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('socid_id', $childids = $user->getAllChildIds(1); -if (! empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { +if (!empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { if (empty($date_start)) { $date_start = dol_mktime(0, 0, 0, (int) dol_print_date(dol_now(), '%m'), 1, (int) dol_print_date(dol_now(), '%Y')); } @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = isModEnabled('project') && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = isModEnabled('project') && !empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { @@ -1624,7 +1624,7 @@ if ($action == 'create') { print ''; } else { - $taxlessUnitPriceDisabled = ! empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : ''; + $taxlessUnitPriceDisabled = !empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? ' disabled' : ''; print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); @@ -1697,7 +1697,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -1717,7 +1717,7 @@ if ($action == 'create') { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=''; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 61c127cab9b..18d051a0fa3 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1187,8 +1187,8 @@ class Fichinter extends CommonObject if ($objsoc->fetch($socid) > 0) { $this->socid = $objsoc->id; - //$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - //$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + //$this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + //$this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); $this->fk_project = ''; $this->fk_delivery_address = ''; } diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 6cfc4fbe7b9..6ebac09d8fb 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -114,7 +114,7 @@ if ($idprod > 0) { // Add price for costprice (at end) $price = $producttmp->cost_price; - if (empty($price) && ! empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { + if (empty($price) && !empty($conf->global->PRODUCT_USE_SUB_COST_PRICES_IF_COST_PRICE_EMPTY)) { // get costprice for subproducts if any $producttmp->get_sousproduits_arbo(); $prods_arbo=$producttmp->get_arbo_each_prod(); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b90b03a06cb..8a1dcf682b2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2831,7 +2831,7 @@ class CommandeFournisseur extends CommonOrder if ($qty < $this->line->packaging) { $qty = $this->line->packaging; } else { - if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { + if (!empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 31bc37b6e1a..915ce532412 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -982,9 +982,9 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; $sql .= ') VALUES ('; $sql .= ' ' . (int) $facid; // source supplier invoie id - $sql .= ', ' . (! empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); - $sql .= ', ' . (! empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); - $sql .= ', ' . (! empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); + $sql .= ', ' . (!empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); + $sql .= ', ' . (!empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); + $sql .= ', ' . (!empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); $sql .= ", '" . $this->db->escape($desc) . "'"; $sql .= ', ' . price2num($pu_ht); $sql .= ', ' . price2num($pu_ttc); @@ -2154,8 +2154,8 @@ class FactureFournisseurLigneRec extends CommonObjectLine $sql .= ' fk_facture_fourn = ' . (int) $this->fk_facture_fourn; $sql .= ', fk_parent_line = ' . (int) $this->fk_parent; $sql .= ', fk_product = ' . (int) $this->fk_product; - $sql .= ', ref = ' . (! empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL'); - $sql .= ", label = " . (! empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL'); + $sql .= ', ref = ' . (!empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL'); + $sql .= ", label = " . (!empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL'); $sql .= ", description = '" . $this->db->escape($this->description) . "'"; $sql .= ', pu_ht = ' . price2num($this->pu_ht); $sql .= ', pu_ttc = ' . price2num($this->pu_ttc); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 830430f3730..2103b97d2e1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -433,7 +433,7 @@ class FactureFournisseur extends CommonInvoice $result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds // Define some dates - if (! empty($_facrec->frequency)) { + if (!empty($_facrec->frequency)) { $originaldatewhen = $_facrec->date_when; $nextdatewhen = dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency); $previousdaynextdatewhen = dol_time_plus_duree($nextdatewhen, -1, 'd'); @@ -464,7 +464,7 @@ class FactureFournisseur extends CommonInvoice if (! $this->type) { $this->type = self::TYPE_STANDARD; } - if (! empty(GETPOST('ref_supplier'))) { + if (!empty(GETPOST('ref_supplier'))) { $this->ref_supplier = trim($this->ref_supplier); } else { $this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1)); @@ -510,7 +510,7 @@ class FactureFournisseur extends CommonInvoice if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) { $newlang = $this->default_lang; // for thirdparty } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -540,7 +540,7 @@ class FactureFournisseur extends CommonInvoice } // Define due date if not already defined - if (! empty($forceduedate)) { + if (!empty($forceduedate)) { $this->date_echeance = $forceduedate; } @@ -760,9 +760,9 @@ class FactureFournisseur extends CommonInvoice // If margin module defined on costprice, we try the costprice // If not defined or if module margin defined and pmp and stock module enabled, we try pmp price // else we get the best supplier price - if ($conf->global->MARGIN_TYPE == 'costprice' && ! empty($producttmp->cost_price)) { + if ($conf->global->MARGIN_TYPE == 'costprice' && !empty($producttmp->cost_price)) { $buyprice = $producttmp->cost_price; - } elseif (! empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && ! empty($producttmp->pmp)) { + } elseif (!empty($conf->stock->enabled) && ($conf->global->MARGIN_TYPE == 'costprice' || $conf->global->MARGIN_TYPE == 'pmp') && !empty($producttmp->pmp)) { $buyprice = $producttmp->pmp; } else { if ($producttmp->find_min_price_product_fournisseur($_facrec->lines[$i]->fk_product) > 0) { @@ -3861,7 +3861,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").','; $sql .= " ".((int) $this->product_type).","; $sql .= " ".price2num($this->remise_percent).","; - $sql .= ' '.(! empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").','; + $sql .= ' '.(!empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").','; $sql .= " ".price2num($this->subprice).","; $sql .= " ".(!empty($this->qty) ?price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).","; $sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").","; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 769d8c451da..660d555676f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2357,7 +2357,7 @@ if ($action == 'create') { print '
    '; // Margin Infos - /*if (! empty($conf->margin->enabled)) { + /*if (!empty($conf->margin->enabled)) { $formmargin->displayMarginInfos($object); }*/ @@ -2462,7 +2462,7 @@ if ($action == 'create') { } } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print ''; }*/ diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index e996f29b3c8..8f8d9ec9e47 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -if (! empty($conf->project->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; @@ -112,10 +112,10 @@ $permissiontoedit = $user->rights->fournisseur->facture->creer || $user->rights- $usercanread = $user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire; $usercancreate = $user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer; $usercandelete = $user->rights->fournisseur->facture->supprimer || $user->rights->supplier_invoice->supprimer; -$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($usercancreate)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))); +$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_invoice_advance->validate))); $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send); -$usercanproductignorepricemin = ((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); +$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)); $usercancreatemargin = $user->rights->margins->creer; $usercanreadallmargin = $user->rights->margins->liretous; $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; @@ -301,7 +301,7 @@ if (empty($reshook)) { } elseif ($action == 'setdate_when' && $usercancreate) { // Set next date of execution $date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear')); - if (! empty($date)) { + if (!empty($date)) { $object->setNextDate($date); } } elseif ($action == 'setnb_gen_max' && $usercancreate) { @@ -484,7 +484,7 @@ if (empty($reshook)) { $res = $productsupplier->fetch($idprod); // Load product from its id // Call to init some price properties of $productsupplier // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price - if (! empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) { + if (!empty($conf->global->SUPPLIER_TAKE_FIRST_PRICE_IF_NO_PRICE_FOR_CURRENT_SUPPLIER)) { $fksoctosearch = 0; $productsupplier->get_buyprice(0, -1, $idprod, 'none', $fksoctosearch); // We force qty to -1 to be sure to find if a supplier price exist if ($productsupplier->fourn_socid != $socid) { // The price we found is for another supplier, so we clear supplier price @@ -502,7 +502,7 @@ if (empty($reshook)) { } } - if (! $error && ($qty >= 0) && (! empty($product_desc) || (! empty($idprod) && $idprod > 0))) { + if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $ret = $object->fetch($id); if ($ret < 0) { dol_print_error($db, $object->error); @@ -524,7 +524,7 @@ if (empty($reshook)) { // Ecrase $tva_tx par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (! empty($idprod) && $idprod > 0) { + if (!empty($idprod) && $idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -553,7 +553,7 @@ if (empty($reshook)) { $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); // if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ? - if (! empty($price_ht)) { + if (!empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } elseif ($tmpvat != $tmpprodvat) { @@ -569,7 +569,7 @@ if (empty($reshook)) { $desc = ''; // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'aZ09')) { @@ -578,12 +578,12 @@ if (empty($reshook)) { if (empty($newlang)) { $newlang = $object->thirdparty->default_lang; } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - $desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; + $desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; } else { $desc = $prod->description; } @@ -591,10 +591,10 @@ if (empty($reshook)) { $desc = dol_concatdesc($desc, $product_desc); // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { + if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (!empty($prod->customcode) || !empty($prod->country_code))) { $tmptxt = '('; // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; $newlang = ''; if (empty($newlang) && GETPOST('lang_id', 'alpha')) { @@ -603,28 +603,28 @@ if (empty($reshook)) { if (empty($newlang)) { $newlang = $object->thirdparty->default_lang; } - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); $outputlangs->load('products'); } - if (! empty($prod->customcode)) { + if (!empty($prod->customcode)) { $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; } - if (! empty($prod->customcode) && ! empty($prod->country_code)) { + if (!empty($prod->customcode) && !empty($prod->country_code)) { $tmptxt .= ' - '; } - if (! empty($prod->country_code)) { + if (!empty($prod->country_code)) { $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); } } else { - if (! empty($prod->customcode)) { + if (!empty($prod->customcode)) { $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; } - if (! empty($prod->customcode) && ! empty($prod->country_code)) { + if (!empty($prod->customcode) && !empty($prod->country_code)) { $tmptxt .= ' - '; } - if (! empty($prod->country_code)) { + if (!empty($prod->country_code)) { $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); } } @@ -647,8 +647,8 @@ if (empty($reshook)) { $fk_unit = GETPOST('units', 'alpha'); } - $date_start_fill = ! empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : null; - $date_end_fill = ! empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; + $date_start_fill = !empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : null; + $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; // Margin $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); @@ -667,7 +667,7 @@ if (empty($reshook)) { $remise_percent = (float) price2num($remise_percent); $price_min = (float) price2num($price_min); - if ($usercanproductignorepricemin && (! empty($price_min) && ($pu_ht * (1 - $remise_percent / 100) < $price_min))) { + if ($usercanproductignorepricemin && (!empty($price_min) && ($pu_ht * (1 - $remise_percent / 100) < $price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { @@ -778,21 +778,21 @@ if (empty($reshook)) { // Check minimum price $productid = GETPOST('productid', 'int'); - if (! empty($productid)) { + if (!empty($productid)) { $product = new Product($db); $product->fetch($productid); $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { + if (!empty($conf->global->PRODUIT_MULTIPRICES) && !empty($object->thirdparty->price_level)) { $price_min = $product->multiprices_min[$object->thirdparty->price_level]; } $label = $product->label; // Check price is not lower than minimum (check is done only for standard or replacement invoices) - if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min))) { + if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min))) { setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)), null, 'errors'); $error++; } @@ -812,8 +812,8 @@ if (empty($reshook)) { $error++; } - $date_start_fill = ! empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : 'NULL'; - $date_end_fill = ! empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; + $date_start_fill = !empty(GETPOST('date_start_fill', 'int')) ? GETPOST('date_start_fill', 'int') : 'NULL'; + $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; // Update line if (! $error) { @@ -869,7 +869,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoice"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (! empty($conf->project->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -898,7 +898,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (! empty($conf->project->enabled)) $rowspan++; + if (!empty($conf->project->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print ''; @@ -986,12 +986,12 @@ if ($action == 'create') { print ""; // Project - if (! empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print ''; } @@ -1044,7 +1044,7 @@ if ($action == 'create') { print ""; // Auto generate document - if (! empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { + if (!empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { print "
    ' . $langs->trans('Project') . ''; $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); - print '   thirdparty->id . (! empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . ''; + print '   thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . ''; print '
    " . $langs->trans("StatusOfGeneratedDocuments") . ""; $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); @@ -1072,7 +1072,7 @@ if ($action == 'create') { print '
    '; print ''; // Show object lines - if (! empty($object->lines)) { + if (!empty($object->lines)) { $disableedit = 1; $disablemove = 1; $disableremove = 1; @@ -1119,7 +1119,7 @@ if ($action == 'create') { // Recurring invoice content - $linkback = '' . $langs->trans('BackToList') . ''; + $linkback = '' . $langs->trans('BackToList') . ''; $morehtmlref = ''; if ($action != 'edittitle') { @@ -1135,7 +1135,7 @@ if ($action == 'create') { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); $morehtmlref .= '
    ' . $langs->trans('Project') . ' '; if ($usercancreate) { @@ -1153,7 +1153,7 @@ if ($action == 'create') { $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $project = new Project($db); $project->fetch($object->fk_project); $morehtmlref .= ' : ' . $project->getNomUrl(1); @@ -1243,14 +1243,14 @@ if ($action == 'create') { print ''; // Multicurrency - if (! empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled)) { // Multicurrency code print ''; print ''; // Auto generate documents - if (! empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { + if (!empty($conf->global->INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION)) { print ''; print '
    '; print ''; - if ($usercancreate && $action != 'editmulticurrencycode' && ! empty($object->brouillon)) { + if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) { print ''; } print '
    '; print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); print '' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; @@ -1266,7 +1266,7 @@ if ($action == 'create') { print ''; - if ($usercancreate && $action != 'editmulticurrencyrate' && ! empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { + if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { print ''; } print '
    '; print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); print '' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '
    '; @@ -1290,7 +1290,7 @@ if ($action == 'create') { // Help of substitution key $dateexample = dol_now(); - if (! empty($object->frequency) && ! empty($object->date_when)) { + if (!empty($object->frequency) && !empty($object->date_when)) { $dateexample = $object->date_when; } @@ -1478,7 +1478,7 @@ if ($action == 'create') { } print '
    '; if ($action == 'generate_pdf' || $object->frequency > 0) { @@ -1544,7 +1544,7 @@ if ($action == 'create') { '; - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { + if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; } @@ -1552,7 +1552,7 @@ if ($action == 'create') { print ''; $object->fetch_lines(); // Show object lines - if (! empty($object->lines)) { + if (!empty($object->lines)) { $canchangeproduct = 1; // To set ref for getNomURL function foreach ($object->lines as $line) { @@ -1598,7 +1598,7 @@ if ($action == 'create') { if (empty($object->suspended)) { if ($usercancreate) { - if (! empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { + if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { print ''; } else { if (empty($object->frequency) || $object->date_when <= $nowlasthour) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f5ed12fd984..f0640681e7f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -277,7 +277,7 @@ if (empty($reshook)) { $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang; - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -2692,7 +2692,7 @@ if ($action == 'create') { $action = ''; } else { $text = $langs->trans('ConfirmValidateBill', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -3588,7 +3588,7 @@ if ($action == 'create') { global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; $forceall = 1; $dateSelector = 0; $inputalsopricewithtax = 1; $senderissupplier = 2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. - //if (! empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2; + //if (!empty($conf->global->SUPPLIER_INVOICE_WITH_NOPRICEDEFINED)) $senderissupplier=2; if (!empty($conf->global->SUPPLIER_INVOICE_WITH_PREDEFINED_PRICES_ONLY)) { $senderissupplier = 1; } @@ -3741,7 +3741,7 @@ if ($action == 'create') { } // Create event - /*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. + /*if ($conf->agenda->enabled && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print ''; }*/ diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e7f1785cb95..0072349c06b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -963,7 +963,7 @@ if ($resql) { FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), ); /* - if (! empty($conf->global->INVOICE_USE_SITUATION)) + if (!empty($conf->global->INVOICE_USE_SITUATION)) { $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index ea9cd9ec996..f798ff10973 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -647,7 +647,7 @@ if (!function_exists('ftp_connect')) { // Actions /* - if ($user->rights->ftp->write && ! empty($section)) + if ($user->rights->ftp->write && !empty($section)) { $formfile->form_attach_new_file(DOL_URL_ROOT.'/ftp/index.php','',0,$section,1); } diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index a4b9bcfcfdb..9d3e63bd09a 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -239,7 +239,7 @@ if ($object->id) { print '
    '."\n"; print ''; - if (! empty($object->fk_user_create)) { + if (!empty($object->fk_user_create)) { $userCreate=new User($db); $userCreate->fetch($object->fk_user_create); print ''; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 239e66ee48f..e8476d0449d 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -500,8 +500,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->evaluationdet->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->evaluationdet->evaluationdet_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->evaluationdet->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->evaluationdet->evaluationdet_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -618,8 +618,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -642,8 +642,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -666,8 +666,8 @@ class Evaluationline extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index bc5af1f661d..117878c10c9 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -496,8 +496,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->job->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->job->job_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->job->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->job->job_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -652,8 +652,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -676,8 +676,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -700,8 +700,8 @@ class Job extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 37a8300a1e2..19246dc2313 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -507,8 +507,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->position->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->position->position_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->position->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->position->position_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -626,8 +626,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -650,8 +650,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -674,8 +674,8 @@ class Position extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 99dc0902f95..2c86c5dca56 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -564,8 +564,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skill->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skill->skill_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skill->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skill->skill_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -682,8 +682,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -706,8 +706,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -730,8 +730,8 @@ class Skill extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index d1ae24b7efe..4f6d43baa59 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -488,8 +488,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skilldet->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skilldet->skilldet_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skilldet->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skilldet->skilldet_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -606,8 +606,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -630,8 +630,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -654,8 +654,8 @@ class Skilldet extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index c5f5ccb8ff7..6db80642bab 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -527,8 +527,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skillrank->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->skillrank->skillrank_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skillrank->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->skillrank->skillrank_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -645,8 +645,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -669,8 +669,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -693,8 +693,8 @@ class SkillRank extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->hrm->hrm_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->hrm->hrm_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index afbd480e928..9d125f450e7 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -123,7 +123,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -147,7 +147,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -168,7 +168,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 8d2d234dd43..ed9e9ecc196 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -134,7 +134,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 0cc25901302..4b301720f07 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index b8008f009ea..b6ce99c9801 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -133,7 +133,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 76f6e73d690..9e0e5323053 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index ccbfabb985b..fc90a24dec6 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -134,7 +134,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index 56029f790a7..92eab8e63b2 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index e1947741bde..23f98d75f3f 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -133,7 +133,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index 5f284c4e72c..0e7f50c042d 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -160,7 +160,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php b/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php index 893a4858c8e..0f75fe15089 100644 --- a/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php +++ b/htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/ApiPrintConnector.php @@ -49,7 +49,7 @@ class ApiPrintConnector implements PrintConnector */ public function __destruct() { - if (! empty($this->stream)) { + if (!empty($this->stream)) { trigger_error("Print connector was not finalized. Did you forget to close the printer?", E_USER_NOTICE); } } diff --git a/htdocs/includes/nusoap/lib/class.soap_transport_http.php b/htdocs/includes/nusoap/lib/class.soap_transport_http.php index 4ff49345083..1f3aa35a9a0 100644 --- a/htdocs/includes/nusoap/lib/class.soap_transport_http.php +++ b/htdocs/includes/nusoap/lib/class.soap_transport_http.php @@ -1270,20 +1270,20 @@ class soap_transport_http extends nusoap_base { continue; } $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) <= time()) { $this->debug('cookie has expired'); continue; } } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + if ((isset($cookie['domain'])) && (!empty($cookie['domain']))) { $domain = preg_quote($cookie['domain']); if (! preg_match("'.*$domain$'i", $this->host)) { $this->debug('cookie has different domain'); continue; } } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + if ((isset($cookie['path'])) && (!empty($cookie['path']))) { $path = preg_quote($cookie['path']); if (! preg_match("'^$path.*'i", $this->path)) { $this->debug('cookie is for a different path'); diff --git a/htdocs/includes/nusoap/lib/class.soapclient.php b/htdocs/includes/nusoap/lib/class.soapclient.php index de0ca3c9882..598ad62246a 100644 --- a/htdocs/includes/nusoap/lib/class.soapclient.php +++ b/htdocs/includes/nusoap/lib/class.soapclient.php @@ -900,7 +900,7 @@ class nusoap_client extends nusoap_base { $this->debug('Remove cookie that is not an array'); continue; } - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) > time()) { $this->cookies[] = $cookie; } else { diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 7e0ebd94da4..eda7ad20092 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -3421,20 +3421,20 @@ class soap_transport_http extends nusoap_base { continue; } $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) <= time()) { $this->debug('cookie has expired'); continue; } } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + if ((isset($cookie['domain'])) && (!empty($cookie['domain']))) { $domain = preg_quote($cookie['domain']); if (! preg_match("'.*$domain$'i", $this->host)) { $this->debug('cookie has different domain'); continue; } } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + if ((isset($cookie['path'])) && (!empty($cookie['path']))) { $path = preg_quote($cookie['path']); if (! preg_match("'^$path.*'i", $this->path)) { $this->debug('cookie is for a different path'); @@ -8057,7 +8057,7 @@ class nusoap_client extends nusoap_base { $this->debug('Remove cookie that is not an array'); continue; } - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if ((isset($cookie['expires'])) && (!empty($cookie['expires']))) { if (strtotime($cookie['expires']) > time()) { $this->cookies[] = $cookie; } else { diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index b57983321a3..8d767de4620 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -101,7 +101,7 @@ class Segment implements IteratorAggregate, Countable preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); //var_dump($tmpvars);exit; foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it - if (! empty($match[1]) && ! isset($tmpvars[$match[1]])) { + if (!empty($match[1]) && ! isset($tmpvars[$match[1]])) { $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop } } diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 6c63da727b7..e993f85f7fd 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -530,7 +530,7 @@ IMG; //var_dump($this->vars);exit; foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it - if (! empty($match[1]) && ! isset($this->vars[$match[1]])) { + if (!empty($match[1]) && ! isset($this->vars[$match[1]])) { $this->vars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop } } @@ -877,7 +877,7 @@ IMG; pclose($handlein); fclose($handle); } - if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } if ($retval == 0) { diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php index fd7dca8a586..a5052f8f248 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Arr.php @@ -111,7 +111,7 @@ class Arr $results = []; foreach ($array as $key => $value) { - if (is_array($value) && ! empty($value)) { + if (is_array($value) && !empty($value)) { $results = array_merge($results, static::dot($value, $prepend.$key.'.')); } else { $results[$prepend.$key] = $value; diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php index 61a48841c11..5dfec085be4 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Collection.php @@ -482,7 +482,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl $result = new static($results); - if (! empty($nextGroups)) { + if (!empty($nextGroups)) { return $result->map->groupBy($nextGroups, $preserveKeys); } diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php index 6c530c121d3..d76ef31a081 100755 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/ServiceProvider.php @@ -363,7 +363,7 @@ abstract class ServiceProvider */ protected static function pathsForProviderAndGroup($provider, $group) { - if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { + if (!empty(static::$publishes[$provider]) && !empty(static::$publishGroups[$group])) { return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); } diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php index 414be0c2735..63c4f9e1df1 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Stringable.php @@ -223,7 +223,7 @@ class Stringable implements JsonSerializable $segments = preg_split($pattern, $this->value, $limit, $flags); - return ! empty($segments) ? collect($segments) : collect(); + return !empty($segments) ? collect($segments) : collect(); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php index 122252d8f00..1e4167247ef 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -517,7 +517,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatched($command) { - return isset($this->commands[$command]) && ! empty($this->commands[$command]); + return isset($this->commands[$command]) && !empty($this->commands[$command]); } /** @@ -528,7 +528,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatchedSync($command) { - return isset($this->commandsSync[$command]) && ! empty($this->commandsSync[$command]); + return isset($this->commandsSync[$command]) && !empty($this->commandsSync[$command]); } /** @@ -539,7 +539,7 @@ class BusFake implements QueueingDispatcher */ public function hasDispatchedAfterResponse($command) { - return isset($this->commandsAfterResponse[$command]) && ! empty($this->commandsAfterResponse[$command]); + return isset($this->commandsAfterResponse[$command]) && !empty($this->commandsAfterResponse[$command]); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php index 436173e9d3a..cdbf5b18a2c 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/EventFake.php @@ -189,7 +189,7 @@ class EventFake implements Dispatcher */ public function hasDispatched($event) { - return isset($this->events[$event]) && ! empty($this->events[$event]); + return isset($this->events[$event]) && !empty($this->events[$event]); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php index c7b12f42d47..40c694119e1 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -227,7 +227,7 @@ class NotificationFake implements NotificationDispatcher, NotificationFactory */ public function hasSent($notifiable, $notification) { - return ! empty($this->notificationsFor($notifiable, $notification)); + return !empty($this->notificationsFor($notifiable, $notification)); } /** diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php index d37cd67237a..f49f4745b88 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -242,7 +242,7 @@ class QueueFake extends QueueManager implements Queue */ public function hasPushed($job) { - return isset($this->jobs[$job]) && ! empty($this->jobs[$job]); + return isset($this->jobs[$job]) && !empty($this->jobs[$job]); } /** diff --git a/htdocs/index.php b/htdocs/index.php index 553fee4855f..2a0a163f44e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -114,7 +114,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $lockfile = DOL_DATA_ROOT.'/install.lock'; if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { $langs->load("errors"); - //if (! empty($message)) $message.='
    '; + //if (!empty($message)) $message.='
    '; $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } @@ -122,7 +122,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { if (is_writable($conffile)) { $langs->load("errors"); //$langs->load("other"); - //if (! empty($message)) $message.='
    '; + //if (!empty($message)) $message.='
    '; $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 02b3ce48ca4..01e89bf51ff 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -574,7 +574,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print ''; } } else { - //if (! empty($conf->modules)) + //if (!empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done print ''; } } else { - //if (! empty($conf->modules)) + //if (!empty($conf->modules)) if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done print '\n"; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 8b1ede66506..9e7cfdd5d03 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -611,8 +611,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->partnership_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -735,8 +735,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->partnership_advance->accept)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->partnership_advance->accept)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -853,8 +853,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -905,8 +905,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -929,8 +929,8 @@ class Partnership extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->partnership_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->partnership_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 32162ae0b97..0074d2e80ee 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -270,8 +270,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -294,8 +294,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -318,8 +318,8 @@ class PartnershipType extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index ab6d7ea083a..02580c1f73a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -125,7 +125,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -149,7 +149,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -169,7 +169,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index fb826efcd91..279b72593da 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -406,7 +406,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -424,7 +424,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 094380ab83b..75d315ae396 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -133,7 +133,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -154,7 +154,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index f9ea6559979..0b6d0e6bd07 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -151,7 +151,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 12c63b2f5bd..bc99655efa3 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -385,7 +385,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$db->escape($key).", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 3bd2b913163..a38fdc65ade 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -103,7 +103,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php index 0b8a6cd33c9..565a218d063 100644 --- a/htdocs/partnership/partnershipindex.php +++ b/htdocs/partnership/partnershipindex.php @@ -72,7 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { +if (!empty($conf->partnership->enabled) && $user->rights->partnership->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; @@ -141,7 +141,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { +if (!empty($conf->partnership->enabled) && $user->rights->partnership->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."partnership_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index fd107c06351..17387e3948d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1604,7 +1604,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Note (private, no output on invoices, propales...) - //if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode + //if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode //{ print '
    '; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 0580c6c8cc0..8a9186e49c0 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -119,7 +119,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4707657d3e3..49aca30d3e0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1998,7 +1998,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } if (isModEnabled('productbatch')) { $langs->load("stocks"); - $newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } if (isModEnabled('variants')) { diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 47483bb8f3b..492cdd48864 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -24,6 +24,7 @@ StockAtDateInFuture=Date in the future StocksByLotSerial=Stocks by lot/serial LotSerial=Lots/Serials LotSerialList=List of lot/serials +SubjectToLotSerialOnly=Products subject to lot/serial only Movements=Movements ErrorWarehouseRefRequired=Warehouse reference name is required ListOfWarehouses=List of warehouses diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 10e70545af6..bec2b772d58 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -41,7 +41,7 @@ $snom = GETPOST("snom", 'alpha'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); -$toolowstock = GETPOST('toolowstock'); +$search_toolowstock = GETPOST('search_toolowstock'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); @@ -116,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $tobuy = ""; $search_sale = ""; $search_categ = ""; - $toolowstock = ''; + $search_toolowstock = ''; $fourn_id = ''; $sbarcode = ''; $search_stock_physique = ''; @@ -210,7 +210,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql_having = ''; -if ($toolowstock) { +if ($search_toolowstock) { $sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; } if ($search_stock_physique != '') { @@ -296,8 +296,8 @@ if ($resql) { if ($search_categ > 0) { $param .= "&search_categ=".urlencode($search_categ); } - if ($toolowstock) { - $param .= "&toolowstock=".urlencode($toolowstock); + if ($search_toolowstock) { + $param .= "&search_toolowstock=".urlencode($search_toolowstock); } if ($sbarcode) { $param .= "&sbarcode=".urlencode($sbarcode); @@ -336,7 +336,7 @@ if ($resql) { } $moreforfilter .= '
    '; - $moreforfilter .= $langs->trans("StockTooLow").' '; + $moreforfilter .= ''; $moreforfilter .= '
    '; if (!empty($moreforfilter)) { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index a39dc246772..87a49e1bce1 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -52,7 +52,8 @@ $type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_batch = GETPOST('search_batch', 'alpha'); -$toolowstock = GETPOST('toolowstock'); +$search_toolowstock = GETPOST('search_toolowstock'); +$search_subjecttolotserial = GETPOST('search_subjecttolotserial'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); @@ -173,7 +174,8 @@ if (empty($reshook)) { $tobuy = ""; $search_sale = ""; $search_categ = ""; - $toolowstock = ''; + $search_toolowstock = ''; + $search_subjecttolotserial = ''; $search_batch = ''; $search_warehouse = ''; $fourn_id = ''; @@ -252,6 +254,9 @@ if (dol_strlen($type)) { $sql .= " AND p.fk_product_type <> '1'"; } } +if ($search_subjecttolotserial) { + $sql .= " AND p.tobatch > 0"; +} if ($sref) { $sql .= natural_search("p.ref", $sref); } @@ -318,7 +323,7 @@ $sql .= " e.ref, e.lieu, e.fk_parent,"; $sql .= " pb.batch, pb.eatby, pb.sellby,"; $sql .= " pl.rowid, pl.eatby, pl.sellby"; $sql_having = ''; -if ($toolowstock) { +if ($search_toolowstock) { $sql_having .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet } if ($search_stock_physique != '') { @@ -437,8 +442,11 @@ if ($sbarcode) { if ($search_warehouse) { $param .= "&search_warehouse=".urlencode($search_warehouse); } -if ($toolowstock) { - $param .= "&toolowstock=".urlencode($toolowstock); +if ($search_toolowstock) { + $param .= "&search_toolowstock=".urlencode($search_toolowstock); +} +if ($search_subjecttolotserial) { + $param .= "&search_subjecttolotserial=".urlencode($search_subjecttolotserial); } if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); @@ -487,7 +495,7 @@ if (!empty($conf->categorie->enabled)) { $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); $moreforfilter .= ''; } -//$moreforfilter.=$langs->trans("StockTooLow").' '; +$moreforfilter.=''; if (!empty($moreforfilter)) { print '
    '; From 03a39d33b904dcc64c3ee6d0653983e2f0c1545c Mon Sep 17 00:00:00 2001 From: Radarjr2002 <112626442+Radarjr2002@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:10:25 +0200 Subject: [PATCH 29/60] Warning in php 8 --- htdocs/core/lib/modulebuilder.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 9e17d925dbe..11cbcad7b85 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -123,7 +123,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = $i++; $texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."',"; $texttoinsert .= " 'label'=>'".$val['label']."',"; - if ($val['picto']) { + if (!empty($val['picto'])) { $texttoinsert .= " 'picto'=>'".$val['picto']."',"; } $texttoinsert .= " 'enabled'=>'".($val['enabled'] !== '' ? $val['enabled'] : 1)."',"; From e5e59e1de04038d05d7b6cf1fb9915cbad007d4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 13:11:11 +0200 Subject: [PATCH 30/60] Look and feel --- htdocs/adherents/admin/website.php | 45 ++++++++++++++---------------- htdocs/admin/ticket_public.php | 29 +++++++++++++++---- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 3c7775dc6b8..41ea43c4cec 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -167,10 +167,30 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print $enabledisablehtml; print ''; +print '

    '; -print '
    '; if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { + print '
    '; + //print $langs->trans('FollowingLinksArePublic').'
    '; + print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; + if (isModEnabled('multicompany')) { + $entity_qr = '?entity='.$conf->entity; + } else { + $entity_qr = ''; + } + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''; + print ajax_autoselect('publicurlmember'); + print '
    '; print '
    '; @@ -248,29 +268,6 @@ print dol_get_fiche_end(); print ''; - -if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { - print '
    '; - //print $langs->trans('FollowingLinksArePublic').'
    '; - print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
    '; - if (isModEnabled('multicompany')) { - $entity_qr = '?entity='.$conf->entity; - } else { - $entity_qr = ''; - } - - // Define $urlwithroot - $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); - $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file - //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - - print ''; - print ajax_autoselect('publicurlmember'); -} - // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index a0df28a8f84..3e4c088620d 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -235,12 +235,10 @@ $head = ticketAdminPrepareHead(); print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); -print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).''; - -print dol_get_fiche_end(); - $param = ''; +print '
    '; + $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { // Button off, click to enable @@ -256,9 +254,30 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print $enabledisablehtml; print ''; -print '

    '; +print dol_get_fiche_end(); + + if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { + print '
    '; + + + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + print ''.$langs->trans("TicketPublicAccess").' :
    '; + print ''; + print ajax_autoselect('publicurlmember'); + + + print '

    '; + + print '
    '; print ''; print ''; From a83b42ba8e480f93b5d8e276394e166782e5359a Mon Sep 17 00:00:00 2001 From: Radarjr2002 <112626442+Radarjr2002@users.noreply.github.com> Date: Thu, 1 Sep 2022 13:21:15 +0200 Subject: [PATCH 31/60] fix php8 warnings --- htdocs/contact/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7eb7f53d82..6ea90797d43 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1316,7 +1316,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $login = dol_buildlogin($object->lastname, $object->firstname); $generated_password = ''; - if (!$ldap_sid) { // TODO ldap_sid ? + if (empty($ldap_sid)) { // TODO ldap_sid ? require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password = getRandomPassword(false); } From 065c96e1bedfed765b42811ebb22ac8c1491c130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 13:57:15 +0200 Subject: [PATCH 32/60] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 24343c773d5..ced1f23ed39 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2223,7 +2223,7 @@ NoExternalModuleWithUpdate=No updates found for external modules SwaggerDescriptionFile=Swagger API description file (for use with redoc for example) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=You enabled deprecated WS API. You should use REST API instead. RandomlySelectedIfSeveral=Randomly selected if several pictures are available -SalesRepresentativeInfo=For Proposals, Orders, Invoces. +SalesRepresentativeInfo=For Proposals, Orders, Invoices. DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled From a10a428bc318ea1ec0a791db1c0f3190098c9ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 14:01:27 +0200 Subject: [PATCH 33/60] add doc --- htdocs/core/class/extrafields.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..d26a1dc8fc1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Charles-Fr BENKE * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2017 Nicolas ZABOURI - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +91,9 @@ class ExtraFields */ public $errno; - + /** + * @var array array of type to label + */ public static $type2label = array( 'varchar'=>'String1Line', 'text'=>'TextLongNLines', From 06fafc9d7b7358684d13e0af768d5269220352ef Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 15:04:30 +0200 Subject: [PATCH 34/60] New : Add action to push banque account in Stripe account --- htdocs/societe/paymentmodes.php | 42 ++++++++- htdocs/stripe/class/stripe.class.php | 123 +++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 5b9bd1046ef..7d082440661 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -516,6 +516,40 @@ if (empty($reshook)) { } } } + if ($action == 'syncsepatostripe') { + $companybankaccount->fetch(GETPOST('bankid')); + // print "stripe account = " . json_encode($stripe->getStripeAccount($service)); + // print json_encode($companybankaccount); + // print "fetch id = " . json_encode($socid); + + $companypaymentmode = new CompanyPaymentMode($db); + $companypaymentmode->fetch(null, null, $socid); + // print json_encode($companypaymentmode); + + if ($companypaymentmode->type != 'ban') { + $error++; + setEventMessages('ThisPaymentModeIsNotSepa', null, 'errors'); + } else { + // Get the Stripe customer + $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); + // print json_encode($cu); + if (!$cu) { + $error++; + setEventMessages($stripe->error, $stripe->errors, 'errors'); + } + + if (!$error) { + // Creation of Stripe SEPA + update of societe_account + $card = $stripe->sepaStripe($cu, $companypaymentmode, $stripeacc, $servicestatus, 1); + if (!$card) { + $error++; + setEventMessages($stripe->error, $stripe->errors, 'errors'); + } else { + setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to customer account !")); + } + } + } + } if ($action == 'setkey_account') { $error = 0; @@ -632,7 +666,7 @@ if (empty($reshook)) { } elseif ($action == 'setassourcedefault') { // Set as default when payment mode defined remotely only try { $cu = $stripe->customerStripe($object, $stripeacc, $servicestatus); - if (preg_match('/pm_/', $source)) { + if (preg_match('/pm_|src_/', $source)) { $cu->invoice_settings->default_payment_method = (string) $source; // New } else { $cu->default_source = (string) $source; // Old @@ -660,6 +694,10 @@ if (empty($reshook)) { // $card->detach(); Does not work with card_, only with src_ if (method_exists($card, 'detach')) { $card->detach(); + $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib as sr "; + $sql .= " SET stripe_card_ref = null"; + $sql .= " WHERE sr.stripe_card_ref = '".$db->escape($source)."'"; + $resql = $db->query($sql); } else { $card->delete(); } @@ -1465,7 +1503,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Edit/Delete print '
    '; foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0); print ''; @@ -260,7 +261,7 @@ if ($action == 'edit') { print ''; foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0); print ''; From 86b02bc17bc31faf4628f1328acca6d5dc0a0e98 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 18:03:34 +0200 Subject: [PATCH 40/60] Update new.php --- htdocs/public/members/new.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index c409703862c..6b8616ab777 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -62,6 +62,8 @@ if (is_numeric($entity)) { define("DOLENTITY", $entity); } + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; @@ -437,10 +439,11 @@ if (empty($reshook) && $action == 'add') { // Action called after a submitted was send and member created successfully // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. + if (empty($reshook) && $action == 'added') { llxHeaderVierge($langs->trans("NewMemberForm")); - // Si on a pas ete redirige + // If we have not been redirected print '

    '; print '
    '; print $langs->trans("NewMemberbyWeb"); @@ -556,42 +559,51 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''; } - // Company + // Company // TODO : optional hide print '
    '."\n"; + // Title print ''."\n"; + // Lastname print ''."\n"; + // Firstname print ''."\n"; + // EMail print ''."\n"; + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; print ''."\n"; print ''."\n"; } - // Gender + + // Gender // TODO: add diverse gender print ''; print ''; + // Address print ''."\n"; + // Zip / Town print ''; + // Country print ''; } + // Birthday print ''."\n"; + // Photo print ''."\n"; + // Public print ''."\n"; + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + // Comments print ''; print ''; @@ -733,7 +750,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print dol_get_fiche_end(); - // Save + // Save / Submit print '
    '; print ''; if (!empty($backtopage)) { @@ -746,6 +763,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
    "; print '
    '; } else { // Show the table of membership types + // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1)); From 3dc6283eb7216ade80bc5cdd74278545817db1c9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Sep 2022 16:09:05 +0000 Subject: [PATCH 41/60] Fixing style errors. --- htdocs/public/members/new.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 6b8616ab777..ccc229e33bf 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -563,47 +563,47 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print ''."\n"; - + // Title print ''."\n"; - + // Lastname print ''."\n"; - + // Firstname print ''."\n"; - + // EMail print ''."\n"; - + // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; print ''."\n"; print ''."\n"; } - + // Gender // TODO: add diverse gender print ''; print ''; - + // Address print ''."\n"; - + // Zip / Town print ''; - + // Country print ''; } - + // Birthday print ''."\n"; - + // Photo print ''."\n"; - + // Public print ''."\n"; - + // Other attributes $tpl_context = 'public'; // define template context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - + // Comments print ''; print ''; @@ -763,7 +763,6 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print "
    "; print ''; } else { // Show the table of membership types - // Get units $measuringUnits = new CUnits($db); $result = $measuringUnits->fetchAll('', '', 0, 0, array('t.active' => 1)); From fce1c1a36aefd0445b2777ab0aea3ef53fb3c7d4 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:13:25 +0200 Subject: [PATCH 42/60] Update about.php --- htdocs/zapier/admin/about.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/zapier/admin/about.php b/htdocs/zapier/admin/about.php index b7e2936fc41..71120a384a2 100644 --- a/htdocs/zapier/admin/about.php +++ b/htdocs/zapier/admin/about.php @@ -21,9 +21,9 @@ */ /** - * \file zapier/admin/about.php - * \ingroup zapier - * \brief About page of module Zapier. + * \file htdocs/zapier/admin/about.php + * \ingroup zapier + * \brief About page of module Zapier. */ // Load Dolibarr environment @@ -35,19 +35,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once '../lib/zapier.lib.php'; // Translations -$langs->loadLangs(array("errors", "admin", "zapier")); +$langs->loadLangs(array('admin', 'errors', 'zapier')); // Access control if (!$user->admin) { accessforbidden(); } +if (empty($conf->zapier->enabled)) accessforbidden(); +if (empty($user->admin)) accessforbidden(); + + // Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -if (empty($conf->zapier->enabled)) accessforbidden(); -if (empty($user->admin)) accessforbidden(); /* From c53658e24ade0b73f09090da7a64f55cbfe0ed48 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:16:36 +0200 Subject: [PATCH 43/60] Update webhookindex.php --- htdocs/webhook/webhookindex.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index e62c5e3ddae..50a7ec6d9c1 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -58,15 +58,16 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook")); +$langs->loadLangs(array('webhook')); -$action = GETPOST('action', 'aZ09'); // Security check // if (! $user->rights->webhook->myobject->read) { // accessforbidden(); // } + +$action = GETPOST('action', 'aZ09'); $socid = GETPOST('socid', 'int'); if (isset($user->socid) && $user->socid > 0) { $action = ''; From f4dda6c11c1002fd60a5e27b8f25cf93bd86e1ad Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:22:12 +0200 Subject: [PATCH 44/60] Update target_agenda.php --- htdocs/webhook/target_agenda.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index ccc61d806af..fd3464d3b67 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -16,11 +16,13 @@ */ /** - * \file target_agenda.php - * \ingroup webhook - * \brief Tab of events on Target + * \file htdocs/webhook/target_agenda.php + * \ingroup webhook + * \brief Tab of events on Target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -30,7 +32,7 @@ dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -47,6 +49,7 @@ if (GETPOST('actioncode', 'array')) { } else { $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } + $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -71,6 +74,7 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetagenda', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); From 78eab1a8e89778fea8413d6bf3b2e525603ea77f Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:27:27 +0200 Subject: [PATCH 45/60] Update target_card.php --- htdocs/webhook/target_card.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 0777b984d9a..7e4ef4bb265 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -16,11 +16,13 @@ */ /** - * \file target_card.php - * \ingroup webhook - * \brief Page to create/edit/view target + * \file target_card.php + * \ingroup webhook + * \brief Page to create/edit/view target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -29,7 +31,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); // Get parameters $id = GETPOST('id', 'int'); @@ -69,6 +71,7 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; From 1b78423ab3c0ad8feef69ff36cfd191fc98cfcb0 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:30:26 +0200 Subject: [PATCH 46/60] Update target_contact.php --- htdocs/webhook/target_contact.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 76b1a92821f..9aa51b2c44e 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -16,11 +16,13 @@ */ /** - * \file target_contact.php - * \ingroup webhook - * \brief Tab for contacts linked to Target + * \file htdocs/webhook/target_contact.php + * \ingroup webhook + * \brief Tab for contacts linked to Target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -28,7 +30,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "companies", "other", "mails")); +$langs->loadLangs(array('webhook', 'companies', 'other', 'mails')); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); @@ -41,12 +43,14 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetcontact', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; From d22120e5f4c581cdcf6b3b1e826f90a86e1f5f09 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:35:46 +0200 Subject: [PATCH 47/60] Update target_list.php --- htdocs/webhook/target_list.php | 36 ++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index e8a736f5e47..d80661906c0 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -17,11 +17,13 @@ */ /** - * \file target_list.php - * \ingroup webhook - * \brief List page for target + * \file htdocs/webhook/target_list.php + * \ingroup webhook + * \brief List page for target */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -34,20 +36,21 @@ require_once __DIR__.'/class/target.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "other")); +$langs->loadLangs(array('webhook', 'other')); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ'); +// Get Parameters +$id = GETPOST('id', 'int'); +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); -$id = GETPOST('id', 'int'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -119,6 +122,7 @@ foreach ($object->fields as $key => $val) { ); } } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -126,6 +130,7 @@ $object->fields = dol_sort_array($object->fields, 'position'); //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; @@ -207,6 +212,7 @@ $now = dol_now(); //$help_url = "EN:Module_Target|FR:Module_Target_FR|ES:Módulo_Target"; $help_url = ''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Targets")); + $morejs = array(); $morecss = array(); From 77f352610a4c382e849b0b489120d076a06fc50e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:38:41 +0200 Subject: [PATCH 48/60] Update target_note.php --- htdocs/webhook/target_note.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index 8ba98fd622d..c9fe74c8758 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -17,22 +17,24 @@ */ /** - * \file target_note.php - * \ingroup webhook - * \brief Tab for notes on Target + * \file htdocs/webhook/target_note.php + * \ingroup webhook + * \brief Tab for notes on Target */ + +// Load Dolibarr environment require '../main.inc.php'; dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook", "companies")); +$langs->loadLangs(array('webhook', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -41,6 +43,7 @@ $object = new Target($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('targetnote', 'globalcard')); // Note that conf->hooks_modules contains array + // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -50,7 +53,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->webhook->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id; } - +// Permissions // There is several ways to check permission. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; @@ -93,7 +96,7 @@ if (empty($reshook)) { $form = new Form($db); -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +//$help_url='EN:Webhooks|FR:Webhooks_FR|ES:Webhooks_ES'; $help_url = ''; $title = $langs->trans('Target').' - '.$langs->trans("Notes"); llxHeader('', $title, $help_url); From 401493a35931ac421ab5d6a8425322d3c683e1e5 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:41:30 +0200 Subject: [PATCH 49/60] Update blockedlog.php --- htdocs/blockedlog/admin/blockedlog.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 8880e6c1e86..0f9034e374a 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -22,22 +22,25 @@ * \brief Page setup for blockedlog module */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "blockedlog")); +$langs->loadLangs(array('admin', 'blockedlog', 'other')); +// Access Control if (!$user->admin || empty($conf->blockedlog->enabled)) { accessforbidden(); } -$action = GETPOST('action', 'aZ09'); +// Get Parameters +$action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); - -$withtab = GETPOST('withtab', 'int'); +$withtab = GETPOST('withtab', 'int'); /* From ce986e4128859d5923e5de8a51795bfc3801c718 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:46:59 +0200 Subject: [PATCH 50/60] Update blockedlog_list.php --- htdocs/blockedlog/admin/blockedlog_list.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 4490b3897df..934ef9fba7b 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -18,11 +18,13 @@ */ /** - * \file htdocs/blockedlog/admin/blockedlog_list.php - * \ingroup blockedlog - * \brief Page setup for blockedlog module + * \file htdocs/blockedlog/admin/blockedlog_list.php + * \ingroup blockedlog + * \brief Page setup for blockedlog module */ + +// Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; @@ -31,16 +33,18 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("admin", "other", "blockedlog", "bills")); +$langs->loadLangs(array('admin', 'bills', 'blockedlog', 'other')); +// Access Control if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) { accessforbidden(); } -$action = GETPOST('action', 'aZ09'); +// Get Parameters +$action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'blockedloglist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); if ($search_showonlyerrors < 0) { @@ -95,7 +99,7 @@ $block_static->loadTrackedEvents(); $result = restrictedArea($user, 'blockedlog', 0, ''); - +// Execution Time $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined $max_time = @ini_get("max_execution_time"); if ($max_time && $max_time < $max_execution_time_for_importexport) { From e3b5b762032acef9a9c391f01d9e472d4059db3b Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:54:11 +0200 Subject: [PATCH 51/60] Update blockedlog.class.php --- htdocs/blockedlog/class/blockedlog.class.php | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 3ab2b63ad3f..fa428e4f17e 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -140,6 +140,7 @@ class BlockedLog $this->trackedevents = array(); + // Customer Invoice/Facture / Payment if (isModEnabled('facture')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; @@ -151,18 +152,19 @@ class BlockedLog } /* Supplier + // Supplier Invoice / Payment if (isModEnabled("fournisseur")) { - $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; + $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate'; $this->trackedevents['BILL_SUPPLIER_DELETE']='BlockedLogSupplierBillDelete'; $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done - $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done - $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done - - $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; - $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; + $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done + $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done + $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; + $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; } */ + // Donation if (!empty($conf->don->enabled)) { $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; $this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; @@ -172,23 +174,29 @@ class BlockedLog } /* + // Salary if (!empty($conf->salary->enabled)) { - $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; - $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; - $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; + $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; } */ + // Members if (!empty($conf->adherent->enabled)) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; } + + // Bank if (isModEnabled("banque")) { $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; } + + // Cashdesk // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); if ($moduleposenabled) { From 111b5633370acb1ec58c56bbc3e7e282e5505cc3 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:00:26 +0200 Subject: [PATCH 52/60] Update blockedlog.lib.php --- htdocs/blockedlog/lib/blockedlog.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index 44f7074d582..23a7ec1f62d 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/blockedlog/lib/blockedlog.lib.php - * \ingroup system - * \brief Library for common blockedlog functions + * \file htdocs/blockedlog/lib/blockedlog.lib.php + * \ingroup system + * \brief Library for common blockedlog functions */ /** From f17e0b6de5afdae943a1a974840280b3228b33c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 1 Sep 2022 20:09:54 +0200 Subject: [PATCH 53/60] use isModEnabled --- htdocs/webhook/README.md | 86 ----------------------- htdocs/webhook/lib/webhook_target.lib.php | 2 +- htdocs/webhook/target_agenda.php | 13 ++-- htdocs/webhook/target_card.php | 1 + htdocs/webhook/target_contact.php | 16 +++-- htdocs/webhook/target_list.php | 15 ++-- htdocs/webhook/target_note.php | 16 +++-- htdocs/webhook/webhookindex.php | 36 +--------- 8 files changed, 39 insertions(+), 146 deletions(-) delete mode 100644 htdocs/webhook/README.md diff --git a/htdocs/webhook/README.md b/htdocs/webhook/README.md deleted file mode 100644 index 74fe79e76fd..00000000000 --- a/htdocs/webhook/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# WEBHOOK FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) - -## Features - -Description of the module... - - - -Other external modules are available on [Dolistore.com](https://www.dolistore.com). - -## Translations - -Translations can be completed manually by editing files into directories *langs*. - - - - - -## Licenses - -### Main code - -GPLv3 or (at your option) any later version. See file COPYING for more information. - -### Documentation - -All texts and readmes are licensed under GFDL. diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index fb01a8f95aa..b15252794ea 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.php @@ -30,7 +30,7 @@ function targetPrepareHead($object) { global $db, $langs, $conf; - $langs->load("webhook@webhook"); + $langs->load("webhook"); $h = 0; $head = array(); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 5c039f4cc38..12b61187fbe 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -21,12 +21,13 @@ * \brief Tab of events on Target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page @@ -54,8 +55,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { + // If $page is not defined, or '' or -1 $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -96,8 +98,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 87c079b1b26..69338156da3 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -21,6 +21,7 @@ * \brief Page to create/edit/view target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 9b7f261cd59..d6523794444 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -21,19 +21,20 @@ * \brief Tab for contacts linked to Target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "companies", "other", "mails")); -$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility -$ref = GETPOST('ref', 'alpha'); +$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); $lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -63,8 +64,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index e8a736f5e47..5deee22691f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -22,13 +22,14 @@ * \brief List page for target */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load webhook libraries -require_once __DIR__.'/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -36,16 +37,16 @@ require_once __DIR__.'/class/target.class.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "other")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$mode = GETPOST('mode', 'aZ'); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index ef3805d699d..0ae570b94e1 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,18 +22,19 @@ * \brief Tab for notes on Target */ +// Load Dolibarr environment require '../main.inc.php'; -dol_include_once('/webhook/class/target.class.php'); -dol_include_once('/webhook/lib/webhook_target.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; +require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook_target.lib.php'; // Load translation files required by the page $langs->loadLangs(array("webhook@webhook", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects @@ -69,8 +70,9 @@ if ($enablepermissioncheck) { //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->webhook->enabled)) accessforbidden(); -if (!$permissiontoread) accessforbidden(); +if (!isModEnabled('webhook') || !$permissiontoread) { + accessforbidden(); +} /* diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index 3d050499a29..59973021ca2 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -25,40 +25,11 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page -$langs->loadLangs(array("webhook@webhook")); +$langs->loadLangs(array("webhook")); $action = GETPOST('action', 'aZ09'); @@ -100,8 +71,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (!empty($conf->webhook->enabled) && $user->rights->webhook->read) -{ +if (!empty($conf->webhook->enabled) && $user->rights->webhook->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; From 33e112eda7697766f7fecb81509dfa141f7dae92 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:06:30 +0200 Subject: [PATCH 54/60] Update list.php --- htdocs/commande/list.php | 78 ++++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 4ba2f410cc9..1363d9bd953 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -33,6 +33,8 @@ * \brief Page to list orders */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -51,6 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products')); +// Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -58,6 +61,7 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist'; +// Search Parameters $search_datecloture_start = GETPOST('search_datecloture_start', 'int'); if (empty($search_datecloture_start)) { $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); @@ -86,7 +90,7 @@ $socid = GETPOST('socid', 'int'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); -$search_total_ht = GETPOST('search_total_ht', 'alpha'); +$search_total_ht = GETPOST('search_total_ht', 'alpha'); $search_total_vat = GETPOST('search_total_vat', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'int'); @@ -209,6 +213,7 @@ $arrayfields = array( 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; @@ -724,6 +729,7 @@ if ($action == 'shipped' && $permissiontoadd) { } } } + // Closed records if (!$error && $massaction === 'setbilled' && $permissiontoclose) { $db->begin(); @@ -760,10 +766,12 @@ if (!$error && $massaction === 'setbilled' && $permissiontoclose) { } } + /* * View */ + $now = dol_now(); $form = new Form($db); @@ -799,12 +807,14 @@ $sql .= ' c.fk_input_reason, c.import_key'; if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } + // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } + // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook @@ -1065,7 +1075,7 @@ if ($resql) { exit; } - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url); $param = ''; @@ -1327,7 +1337,7 @@ if ($resql) { $moreforfilter = ''; - // If the user can view prospects other than his' + // If the user can view prospects? sales other than his own if ($user->rights->user->user->lire) { $langs->load("commercial"); $moreforfilter .= '
    '; @@ -1342,7 +1352,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= '
    '; } - // If the user can view prospects other than his' + // If the user can view other products/services than his own if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1351,6 +1361,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
    '; } + // If Categories are enabled & user has rights to see if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1358,6 +1369,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= '
    '; } + // If Stock is enabled if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -1509,60 +1521,63 @@ if ($resql) { $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1); print ''; } + // Amount HT / net if (!empty($arrayfields['c.total_ht']['checked'])) { - // Amount print '
    '; } + // Amount of VAT if (!empty($arrayfields['c.total_vat']['checked'])) { - // Amount print ''; } + // Total Amount (TTC / gross) if (!empty($arrayfields['c.total_ttc']['checked'])) { - // Amount + print ''; } + // Currency if (!empty($arrayfields['c.multicurrency_code']['checked'])) { - // Currency print ''; } + // Currency rate if (!empty($arrayfields['c.multicurrency_tx']['checked'])) { - // Currency rate print ''; } + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { - // Amount + print ''; } + // VAT in foreign currency if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { - // Amount VAT print ''; } + // Amount/Total (TTC / gross) in foreign currency if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { - // Amount print ''; } + // Author if (!empty($arrayfields['u.login']['checked'])) { - // Author print ''; } + // Sales Representative if (!empty($arrayfields['sale_representative']['checked'])) { print ''; } @@ -1582,12 +1597,15 @@ if ($resql) { print ''; } + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + // Fields from hook $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Date creation if (!empty($arrayfields['c.datec']['checked'])) { print '\n"; @@ -2010,6 +2034,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print '\n"; if (!$i) { @@ -2106,6 +2138,7 @@ if ($resql) { $totalarray['val']['c.total_ht'] = $obj->total_ht; } } + // Amount VAT if (!empty($arrayfields['c.total_vat']['checked'])) { print '\n"; @@ -2117,7 +2150,8 @@ if ($resql) { } $totalarray['val']['c.total_tva'] += $obj->total_tva; } - // Amount TTC + + // Amount TTC / gross if (!empty($arrayfields['c.total_ttc']['checked'])) { print '\n"; if (!$i) { @@ -2146,21 +2180,22 @@ if ($resql) { $totalarray['nbfield']++; } } - // Amount HT + + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; } } - // Amount VAT + // Amount VAT in foreign currency if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { print '\n"; if (!$i) { $totalarray['nbfield']++; } } - // Amount TTC + // Amount TTC / gross in foreign currency if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { print '\n"; if (!$i) { @@ -2196,8 +2231,8 @@ if ($resql) { } } + // Sales representatives if (!empty($arrayfields['sale_representative']['checked'])) { - // Sales representatives print ''; @@ -2261,6 +2297,7 @@ if ($resql) { } $totalarray['val']['total_margin'] += $marginInfo['total_margin']; } + // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { print ''; @@ -2268,6 +2305,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { print ''; @@ -2456,6 +2494,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Import key if (!empty($arrayfields['c.import_key']['checked'])) { print ''; @@ -2463,6 +2502,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { print ''; From 9a7ad0a7dca6737606ec2beda0d7f2a613017d4c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 1 Sep 2022 19:17:42 +0000 Subject: [PATCH 55/60] Fixing style errors. --- htdocs/commande/list.php | 58 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1363d9bd953..22afe05725f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1075,7 +1075,7 @@ if ($resql) { exit; } - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url); $param = ''; @@ -1361,7 +1361,7 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= ''; } - // If Categories are enabled & user has rights to see + // If Categories are enabled & user has rights to see if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; @@ -1533,9 +1533,8 @@ if ($resql) { print ''; print ''; } - // Total Amount (TTC / gross) + // Total Amount (TTC / gross) if (!empty($arrayfields['c.total_ttc']['checked'])) { - print '
    '; @@ -1554,7 +1553,6 @@ if ($resql) { } // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { - print ''; @@ -1597,15 +1595,15 @@ if ($resql) { print ''; } - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - + // Fields from hook $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + // Date creation if (!empty($arrayfields['c.datec']['checked'])) { print '\n"; @@ -2034,7 +2032,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print '\n"; @@ -2138,7 +2136,7 @@ if ($resql) { $totalarray['val']['c.total_ht'] = $obj->total_ht; } } - + // Amount VAT if (!empty($arrayfields['c.total_vat']['checked'])) { print '\n"; @@ -2150,7 +2148,7 @@ if ($resql) { } $totalarray['val']['c.total_tva'] += $obj->total_tva; } - + // Amount TTC / gross if (!empty($arrayfields['c.total_ttc']['checked'])) { print '\n"; @@ -2180,7 +2178,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Amount HT/net in foreign currency if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { print '\n"; @@ -2285,7 +2283,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Total margin if (!empty($arrayfields['total_margin']['checked'])) { print ''; @@ -2297,7 +2295,7 @@ if ($resql) { } $totalarray['val']['total_margin'] += $marginInfo['total_margin']; } - + // Total margin rate if (!empty($arrayfields['total_margin_rate']['checked'])) { print ''; @@ -2305,7 +2303,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Total mark rate if (!empty($arrayfields['total_mark_rate']['checked'])) { print ''; @@ -2494,7 +2492,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Import key if (!empty($arrayfields['c.import_key']['checked'])) { print ''; @@ -2502,7 +2500,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { print ''; From 3d9b57ac3f59be37ba5f9addb33a3d48fcd170b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 08:53:13 +0200 Subject: [PATCH 56/60] Clean code --- .../categories/class/api_categories.class.php | 3 - .../facture/class/facture-rec.class.php | 10 +- htdocs/core/class/extrafields.class.php | 111 ++++++------------ htdocs/cron/class/cronjob.class.php | 28 +++-- htdocs/fichinter/class/fichinter.class.php | 90 ++++++++------ htdocs/fichinter/class/fichinterrec.class.php | 26 ++-- .../install/mysql/migration/16.0.0-17.0.0.sql | 3 + .../mysql/tables/llx_fichinterdet_rec.sql | 2 - htdocs/website/index.php | 3 +- 9 files changed, 123 insertions(+), 153 deletions(-) diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 0a618974024..d5345106093 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -682,9 +682,6 @@ class Categories extends DolibarrApi unset($object->total_ttc); unset($object->total_tva); unset($object->lines); - unset($object->fk_incoterms); - unset($object->label_incoterms); - unset($object->location_incoterms); unset($object->civility_id); unset($object->name); unset($object->lastname); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f15f65954cf..3001baca506 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -25,7 +25,7 @@ /** * \file htdocs/compta/facture/class/facture-rec.class.php * \ingroup facture - * \brief Fichier de la classe des factures recurentes + * \brief File of class to manage recurring invoices */ require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; @@ -462,7 +462,7 @@ class FactureRec extends CommonInvoice /** - * Update a line to invoice_rec. + * Update a line invoice_rec. * * @param User $user User * @param int $notrigger No trigger @@ -470,8 +470,6 @@ class FactureRec extends CommonInvoice */ public function update(User $user, $notrigger = 0) { - global $conf; - $error = 0; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; @@ -480,8 +478,8 @@ class FactureRec extends CommonInvoice $sql .= " suspended = ".((int) $this->suspended).","; $sql .= " fk_soc = ".((int) $this->socid).","; $sql .= " total_tva = ".((float) $this->total_tva).","; - $sql .= " localtax1 = ".((float) $this->localtax1).","; - $sql .= " localtax2 = ".((float) $this->localtax2).","; + $sql .= " localtax1 = ".((float) $this->total_localtax1).","; + $sql .= " localtax2 = ".((float) $this->total_localtax2).","; $sql .= " total_ht = ".((float) $this->total_ht).","; $sql .= " total_ttc = ".((float) $this->total_ttc).","; $sql .= " remise_percent = ".((float) $this->remise_percent); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index bbc5e8604ce..5b6e00e91da 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -42,30 +42,6 @@ class ExtraFields */ public $db; - /** - * @var array Array with type of the extra field - * @deprecated - */ - public $attribute_type; - - /** - * @var array Array with label of extra field - * @deprecated - */ - public $attribute_label; - - /** - * @var array Array with list of possible values for some types of extra fields - * @deprecated - */ - public $attribute_choice; - - /** - * @var array array to store extrafields definition - * @deprecated - */ - public $attribute_list; - /** * @var array New array to store extrafields definition */ @@ -128,10 +104,6 @@ class ExtraFields $this->error = ''; $this->errors = array(); $this->attributes = array(); - - // For old usage - $this->attribute_type = array(); - $this->attribute_label = array(); } /** @@ -838,7 +810,7 @@ class ExtraFields // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load array this->attributes (and some old this->attribute_xxx like attribute_label, attribute_type, ... + * Load array this->attributes * * @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param boolean $forceload Force load of extra fields whatever is status of cache. @@ -892,11 +864,6 @@ class ExtraFields $array_name_label[$tab->name] = $tab->label; } - // Old usage - $this->attribute_type[$tab->name] = $tab->type; - $this->attribute_label[$tab->name] = $tab->label; - - // New usage $this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type; $this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label; $this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size; @@ -946,7 +913,7 @@ class ExtraFields * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) * @param int $objectid Current object id - * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data + * @param string $extrafieldsobjectkey The key to use to store retreived data (for example $object->table_element) * @param string $mode 1=Used for search filters * @return string */ @@ -965,29 +932,26 @@ class ExtraFields $keyprefix = $keyprefix.'options_'; } - if (!empty($extrafieldsobjectkey)) { - $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; - $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; - $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; - $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; - $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; - $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; - $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); - $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); - $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; - $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; - $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } else { - // Old usage - $label = $this->attribute_label[$key]; - $type = $this->attribute_type[$key]; - $list = $this->attribute_list[$key]; - $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if (empty($extrafieldsobjectkey)) { + dol_syslog(get_class($this).'::showInputField extrafieldsobjectkey required', LOG_ERR); + return 'BadValueForParamExtraFieldsObjectKey'; } + $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; + $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; + $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; + $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; + $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; + $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; + $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; + $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); + $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; + $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); + $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; + $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; + $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if ($computed) { if (!preg_match('/^search_/', $keyprefix)) { return ''.$langs->trans("AutomaticallyCalculated").''; @@ -1591,26 +1555,25 @@ class ExtraFields { global $conf, $langs; - if (!empty($extrafieldsobjectkey)) { - $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; - $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... - $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; - $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; - $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; - $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; - $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); - $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); - $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; - $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) - } else { - // Old usage not allowed anymore - dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_WARNING); - return ''; + if (empty($extrafieldsobjectkey)) { + dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_ERR); + return 'BadValueForParamExtraFieldsObjectKey'; } + $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; + $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... + $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; + $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; + $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; + $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; + $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; + $perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1'); + $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; + $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); + $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; + $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) + if ($hidden) { return ''; // This is a protection. If field is hidden, we should just not call this method. } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 9bc8400188f..033e6512bd8 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -108,62 +108,62 @@ class Cronjob extends CommonObject public $datelastresult = ''; /** - * @var string Last result from end job execution + * @var string Last result from end job execution */ public $lastresult; /** - * @var string Last output from end job execution + * @var string Last output from end job execution */ public $lastoutput; /** - * @var string Unit frequency of job execution + * @var string Unit frequency of job execution */ public $unitfrequency; /** - * @var int Frequency of job execution + * @var int Frequency of job execution */ public $frequency; /** - * @var int Status + * @var int Status */ public $status; /** - * @var int Is job processing + * @var int Is job running ? */ public $processing; /** - * @var int The job current PID + * @var int The job current PID */ public $pid; /** - * @var int ID + * @var int User ID of creation */ public $fk_user_author; /** - * @var int ID + * @var int User ID of last modification */ public $fk_user_mod; /** - * @var int Number of run job execution + * @var int Number of run job execution */ public $nbrun; /** - * @var int Maximum run job execution + * @var int Maximum run job execution */ public $maxrun; /** - * @var string Libname + * @var string Libname */ public $libname; @@ -1513,10 +1513,12 @@ class Cronjobline public $datenextrun = ''; public $dateend = ''; public $datestart = ''; + public $datelastresult = ''; public $lastresult = ''; public $lastoutput; public $unitfrequency; public $frequency; + public $processing; /** * @var int Status @@ -1534,8 +1536,10 @@ class Cronjobline public $fk_user_mod; public $note; + public $note_private; public $nbrun; public $libname; + public $test; /** * Constructor diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 61c127cab9b..dbc14231b41 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -36,36 +36,36 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; */ class Fichinter extends CommonObject { - public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), - 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), - 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>36), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), - 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), + 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), + 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), + 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), + 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>36), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>45), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>50), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'datei' =>array('type'=>'date', 'label'=>'Datei', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>65), + 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>70), + 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>75), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500), + 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>85), + 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), + 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), + 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), + 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), + 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), ); + /** * @var string ID to identify managed object */ @@ -1267,7 +1267,8 @@ class Fichinter extends CommonObject $line->fk_fichinter = $fichinterid; $line->desc = $desc; - $line->datei = $date_intervention; + $line->date = $date_intervention; + $line->datei = $date_intervention; // For backward compatibility $line->duration = $duration; if (is_array($array_options) && count($array_options) > 0) { @@ -1316,7 +1317,8 @@ class Fichinter extends CommonObject while ($xnbp < $nbp) { $line = new FichinterLigne($this->db); $line->desc = $langs->trans("Description")." ".$xnbp; - $line->datei = ($now - 3600 * (1 + $xnbp)); + $line->date = ($now - 3600 * (1 + $xnbp)); + $line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility $line->duration = 600; $line->fk_fichinter = 0; $this->lines[$xnbp] = $line; @@ -1359,7 +1361,7 @@ class Fichinter extends CommonObject //For invoicing we calculing hours $line->qty = round($objp->duree / 3600, 2); $line->date = $this->db->jdate($objp->date); - $line->datei = $this->db->jdate($objp->date); + $line->datei = $this->db->jdate($objp->date); // For backward compatibility $line->rang = $objp->rang; $line->product_type = 1; $line->fetch_optionals(); @@ -1486,6 +1488,8 @@ class FichinterLigne extends CommonObjectLine public $duration; // Duration of intervention public $rang = 0; + public $tva_tx; + public $subprice; /** * @var string ID to identify managed object @@ -1522,8 +1526,7 @@ class FichinterLigne extends CommonObjectLine */ public function fetch($rowid) { - $sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang,'; - $sql .= ' ft.date as datei'; + $sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang, ft.date'; $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql .= ' WHERE ft.rowid = '.((int) $rowid); @@ -1534,7 +1537,8 @@ class FichinterLigne extends CommonObjectLine $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_fichinter = $objp->fk_fichinter; - $this->datei = $this->db->jdate($objp->datei); + $this->date = $this->db->jdate($objp->date); + $this->datei = $this->db->jdate($objp->date); // For backward compatibility $this->desc = $objp->description; $this->duration = $objp->duree; $this->rang = $objp->rang; @@ -1562,6 +1566,10 @@ class FichinterLigne extends CommonObjectLine dol_syslog("FichinterLigne::insert rang=".$this->rang); + if (empty($this->date) && !empty($this->datei)) { // For backward compatibility + $this->date = $this->datei; + } + $this->db->begin(); $rangToUse = $this->rang; @@ -1585,7 +1593,7 @@ class FichinterLigne extends CommonObjectLine $sql .= ' (fk_fichinter, description, date, duree, rang)'; $sql .= " VALUES (".((int) $this->fk_fichinter).","; $sql .= " '".$this->db->escape($this->desc)."',"; - $sql .= " '".$this->db->idate($this->datei)."',"; + $sql .= " '".$this->db->idate($this->date)."',"; $sql .= " ".((int) $this->duration).","; $sql .= ' '.((int) $rangToUse); $sql .= ')'; @@ -1647,14 +1655,18 @@ class FichinterLigne extends CommonObjectLine $error = 0; + if (empty($this->date) && !empty($this->datei)) { // For backward compatibility + $this->date = $this->datei; + } + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET"; - $sql .= " description='".$this->db->escape($this->desc)."'"; - $sql .= ",date='".$this->db->idate($this->datei)."'"; - $sql .= ",duree=".$this->duration; - $sql .= ",rang='".$this->db->escape($this->rang)."'"; + $sql .= " description = '".$this->db->escape($this->desc)."',"; + $sql .= " date = '".$this->db->idate($this->date)."',"; + $sql .= " duree = ".((int) $this->duration).","; + $sql .= " rang = ".((int) $this->rang); $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog("FichinterLigne::update", LOG_DEBUG); diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index b128bba60f8..bcf89704e55 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -64,7 +64,6 @@ class FichinterRec extends Fichinter public $number; public $date; public $amount; - public $remise; public $tva; public $total; @@ -222,7 +221,7 @@ class FichinterRec extends Fichinter $result_insert = $this->addline( $fichintsrc->lines[$i]->desc, $fichintsrc->lines[$i]->duration, - $fichintsrc->lines[$i]->datei, + $fichintsrc->lines[$i]->date, $fichintsrc->lines[$i]->rang, $fichintsrc->lines[$i]->subprice, $fichintsrc->lines[$i]->qty, @@ -350,8 +349,8 @@ class FichinterRec extends Fichinter // phpcs:enable $this->lines = array(); - $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description, '; - $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, '; + $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description,'; + $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, l.date,'; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.rang, l.special_code,'; $sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; @@ -381,19 +380,16 @@ class FichinterRec extends Fichinter $line->qty = $objp->qty; $line->duree = $objp->duree; $line->duration = $objp->duree; - $line->datei = $objp->date; + $line->date = $objp->date; $line->subprice = $objp->subprice; $line->tva_tx = $objp->tva_tx; $line->remise_percent = $objp->remise_percent; $line->fk_remise_except = $objp->fk_remise_except; $line->fk_product = $objp->fk_product; - $line->date_start = $objp->date_start; - $line->date_end = $objp->date_end; $line->info_bits = $objp->info_bits; $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; $line->total_ttc = $objp->total_ttc; - $line->code_ventilation = $objp->fk_code_ventilation; $line->rang = $objp->rang; $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; @@ -460,7 +456,7 @@ class FichinterRec extends Fichinter * * @param string $desc Description de la ligne * @param integer $duration Durée - * @param string $datei Date + * @param string $date Date * @param int $rang Position of line * @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $qty Quantity @@ -477,7 +473,7 @@ class FichinterRec extends Fichinter * @param string $fk_unit Unit * @return int <0 if KO, Id of line if OK */ - public function addline($desc, $duration, $datei, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) + public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) { global $mysoc; @@ -520,6 +516,8 @@ class FichinterRec extends Fichinter $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; + $pu_ht = $tabprice[3]; + $product_type = $type; if ($fk_product) { $product = new Product($this->db); @@ -539,8 +537,7 @@ class FichinterRec extends Fichinter $sql .= ", fk_product"; $sql .= ", product_type"; $sql .= ", remise_percent"; - //$sql.= ", subprice"; - $sql .= ", remise"; + $sql .= ", subprice"; $sql .= ", total_ht"; $sql .= ", total_tva"; $sql .= ", total_ttc"; @@ -551,7 +548,7 @@ class FichinterRec extends Fichinter $sql .= (int) $this->id; $sql .= ", ".(!empty($label) ? "'".$this->db->escape($label)."'" : "null"); $sql .= ", ".(!empty($desc) ? "'".$this->db->escape($desc)."'" : "null"); - $sql .= ", ".(!empty($datei) ? "'".$this->db->idate($datei)."'" : "null"); + $sql .= ", ".(!empty($date) ? "'".$this->db->idate($date)."'" : "null"); $sql .= ", ".$duration; //$sql.= ", ".price2num($pu_ht); //$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null")); @@ -559,8 +556,7 @@ class FichinterRec extends Fichinter $sql .= ", ".(!empty($fk_product) ? $fk_product : "null"); $sql .= ", ".$product_type; $sql .= ", ".(!empty($remise_percent) ? $remise_percent : "null"); - //$sql.= ", '".price2num($pu_ht)."'"; - $sql .= ", null"; + $sql.= ", '".price2num($pu_ht)."'"; $sql .= ", '".price2num($total_ht)."'"; $sql .= ", '".price2num($total_tva)."'"; $sql .= ", '".price2num($total_ttc)."'"; diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 5db36ee955b..c84a80aa72f 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -61,6 +61,9 @@ ALTER TABLE llx_user DROP COLUMN idpers3; ALTER TABLE llx_partnership ADD COLUMN ip varchar(250); ALTER TABLE llx_adherent ADD COLUMN ip varchar(250); +ALTER TABLE llx_fichinterdet_rec DROP COLUMN remise; +ALTER TABLE llx_fichinterdet_rec DROP COLUMN fk_export_commpta; + UPDATE llx_const set name = 'ADHERENT_MAILMAN_ADMIN_PASSWORD' WHERE name = 'ADHERENT_MAILMAN_ADMINPW'; ALTER TABLE llx_oauth_token ADD COLUMN state text after tokenstring; diff --git a/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql index ef799ea379a..bdef744df49 100644 --- a/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql +++ b/htdocs/install/mysql/tables/llx_fichinterdet_rec.sql @@ -41,7 +41,6 @@ create table llx_fichinterdet_rec localtax2_type VARCHAR(1) NULL DEFAULT NULL, qty double NULL DEFAULT NULL, remise_percent double NULL DEFAULT 0, - remise double NULL DEFAULT 0, fk_remise_except integer NULL DEFAULT NULL, price DOUBLE(24, 8) NULL DEFAULT NULL, total_tva DOUBLE(24, 8) NULL DEFAULT NULL, @@ -55,7 +54,6 @@ create table llx_fichinterdet_rec buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0, fk_product_fournisseur_price integer NULL DEFAULT NULL, fk_code_ventilation integer NOT NULL DEFAULT 0, - fk_export_commpta integer NOT NULL DEFAULT 0, special_code integer UNSIGNED NULL DEFAULT 0, fk_unit integer NULL DEFAULT NULL, import_key varchar(14) NULL DEFAULT NULL diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0b599ba640b..f8c6a94c09c 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -751,7 +751,6 @@ if ($action == 'addcontainer' && $usercanedit) { $objectpage->content = preg_replace('/^.*]*)*>/ims', '', $objectpage->content); $objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content); - $absoluteurlinaction = $urltograbdirwithoutslash; // TODO Replace 'action="$urltograbdirwithoutslash' into action="/" // TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..." // TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/" @@ -908,7 +907,7 @@ if ($action == 'addcontainer' && $usercanedit) { getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto); - // We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflicit with CSS of Dolibarr. + // We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflict with CSS of Dolibarr. include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php'; $lesscobj = new Lessc(); try { From 2d794473a5aefac46d8f2fd03344a75b9e7b5a35 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 09:45:40 +0200 Subject: [PATCH 57/60] Clean code --- htdocs/core/modules/modWebhook.class.php | 2 +- htdocs/webhook/class/target.class.php | 5 +---- htdocs/webhook/lib/webhook.lib.php | 4 +--- htdocs/webhook/lib/webhook_target.lib.php | 4 +--- htdocs/webhook/target_agenda.php | 2 +- htdocs/webhook/target_card.php | 2 +- htdocs/webhook/target_contact.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/webhook/target_note.php | 2 +- htdocs/webhook/webhookindex.php | 4 ---- 10 files changed, 9 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index fbcb5f81003..fd7f658bd48 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -141,7 +141,7 @@ class modWebhook extends DolibarrModules $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) // The language file dedicated to your module - $this->langfiles = array("webhook"); + $this->langfiles = array(); // Prerequisites $this->phpmin = array(5, 6); // Minimum version of PHP required by module diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 7eabbe397ab..991201a8d91 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -833,7 +833,7 @@ class Target extends CommonObject // phpcs:enable if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; - //$langs->load("webhook@webhook"); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); @@ -928,7 +928,6 @@ class Target extends CommonObject public function getNextNumRef() { global $langs, $conf; - $langs->load("webhook@webhook"); if (empty($conf->global->WEBHOOK_TARGET_ADDON)) { $conf->global->WEBHOOK_TARGET_ADDON = 'mod_target_standard'; @@ -993,8 +992,6 @@ class Target extends CommonObject $result = 0; $includedocgeneration = 0; - $langs->load("webhook@webhook"); - if (!dol_strlen($modele)) { $modele = 'standard_target'; diff --git a/htdocs/webhook/lib/webhook.lib.php b/htdocs/webhook/lib/webhook.lib.php index 6c511180b6e..6c48eccfdf8 100644 --- a/htdocs/webhook/lib/webhook.lib.php +++ b/htdocs/webhook/lib/webhook.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Laurent Destailleur * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +30,6 @@ function webhookAdminPrepareHead() { global $langs, $conf; - $langs->load("webhook@webhook"); - $h = 0; $head = array(); $head[$h][0] = dol_buildpath("/admin/webhook.php", 1); diff --git a/htdocs/webhook/lib/webhook_target.lib.php b/htdocs/webhook/lib/webhook_target.lib.php index fb01a8f95aa..894e3134c0c 100644 --- a/htdocs/webhook/lib/webhook_target.lib.php +++ b/htdocs/webhook/lib/webhook_target.lib.php @@ -1,5 +1,5 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,8 +30,6 @@ function targetPrepareHead($object) { global $db, $langs, $conf; - $langs->load("webhook@webhook"); - $h = 0; $head = array(); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index fd3464d3b67..bf4e883411b 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -32,7 +32,7 @@ dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 7e4ef4bb265..0b9ff450d44 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -31,7 +31,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_contact.php b/htdocs/webhook/target_contact.php index 9aa51b2c44e..460cc7d8ea7 100644 --- a/htdocs/webhook/target_contact.php +++ b/htdocs/webhook/target_contact.php @@ -30,7 +30,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'companies', 'other', 'mails')); +$langs->loadLangs(array('companies', 'other', 'mails')); $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index d80661906c0..2a4f2edfcf1 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -36,7 +36,7 @@ require_once __DIR__.'/class/target.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'other')); +$langs->loadLangs(array('other')); // Get Parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/target_note.php b/htdocs/webhook/target_note.php index c9fe74c8758..4b9be8aaea1 100644 --- a/htdocs/webhook/target_note.php +++ b/htdocs/webhook/target_note.php @@ -29,7 +29,7 @@ dol_include_once('/webhook/class/target.class.php'); dol_include_once('/webhook/lib/webhook_target.lib.php'); // Load translation files required by the page -$langs->loadLangs(array('webhook', 'companies')); +$langs->loadLangs(array('companies')); // Get parameters $id = GETPOST('id', 'int'); diff --git a/htdocs/webhook/webhookindex.php b/htdocs/webhook/webhookindex.php index 50a7ec6d9c1..77c717b628d 100644 --- a/htdocs/webhook/webhookindex.php +++ b/htdocs/webhook/webhookindex.php @@ -57,10 +57,6 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -// Load translation files required by the page -$langs->loadLangs(array('webhook')); - - // Security check // if (! $user->rights->webhook->myobject->read) { From 89da4e5bc3127151724fc82eac5dd66046cfd58d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:01:16 +0200 Subject: [PATCH 58/60] Update index.php --- htdocs/product/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index b76be278a44..2deef52946a 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -417,7 +417,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": // "commitment engagment" method and "cash accounting" method -if ( isModEnabled("invoice") && $user->hasRight('facture', 'lire') && getDolGlobalString('MAIN_SHOW_PRODUCT_ACTIVITY_TRIM')) { +if (isModEnabled("invoice") && $user->hasRight('facture', 'lire') && getDolGlobalString('MAIN_SHOW_PRODUCT_ACTIVITY_TRIM')) { if (isModEnabled("product")) { activitytrim(0); } From a380315056cb0e9372224811a7baa203c2e1fec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:05:25 +0200 Subject: [PATCH 59/60] Clean code --- htdocs/societe/paymentmodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 7d082440661..535c2978877 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -517,7 +517,7 @@ if (empty($reshook)) { } } if ($action == 'syncsepatostripe') { - $companybankaccount->fetch(GETPOST('bankid')); + $companybankaccount->fetch(GETPOST('bankid', 'int')); // print "stripe account = " . json_encode($stripe->getStripeAccount($service)); // print json_encode($companybankaccount); // print "fetch id = " . json_encode($socid); @@ -545,7 +545,7 @@ if (empty($reshook)) { $error++; setEventMessages($stripe->error, $stripe->errors, 'errors'); } else { - setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to customer account !")); + setEventMessages("", array("SEPA on Stripe", "SEPA IBAN is now linked to the Stripe customer account !")); } } } From c9a2dea3d8b15ff84ef26c780d7ea186a359ddb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2022 10:34:25 +0200 Subject: [PATCH 60/60] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
    '; print ''.$langs->trans('UpgradeExternalModule').': '.$langs->trans("NodoUpgradeAfterDB"); @@ -646,7 +646,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ print '
    '; print ''.$langs->trans('UpgradeExternalModule').': '.$langs->trans("NodoUpgradeAfterFiles"); diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 2c47ab3c7a2..244ebdd862f 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -129,7 +129,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array { foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (! empty($extrafields->attributes[$object->table_element]['list'][$key])) + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs((int) $extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key])); } } @@ -206,7 +206,7 @@ $title = $langs->trans('IntracommReportList'.$type); $sql = 'SELECT DISTINCT i.rowid, i.type_declaration, i.type_export, i.periods, i.mode, i.entity'; /* // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } */ @@ -255,7 +255,7 @@ $sql .= " GROUP BY i.rowid, i.type_declaration, i.type_export, i.periods, i.mode /* // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } */ diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index f063db604e0..c20fa91c621 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -530,8 +530,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgerecord->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -648,8 +648,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -672,8 +672,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -696,8 +696,8 @@ class KnowledgeRecord extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgemanagement_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/knowledgemanagement/knowledgemanagementindex.php b/htdocs/knowledgemanagement/knowledgemanagementindex.php index ccb3503eb2f..8f168e62598 100644 --- a/htdocs/knowledgemanagement/knowledgemanagementindex.php +++ b/htdocs/knowledgemanagement/knowledgemanagementindex.php @@ -72,7 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) +if (!empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { $langs->load("orders"); @@ -153,7 +153,7 @@ $max = $NBMAX; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { +if (!empty($conf->knowledgemanagement->enabled) && $user->rights->knowledgemanagement->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index cbf8ccf0895..a3cd190f196 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -126,7 +126,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = ''; llxHeader('', $title, $help_url); @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -170,7 +170,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 8da0dd34b92..d62f9d7f98a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -294,7 +294,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'close') { $text = $langs->trans('ConfirmCloseKM', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -319,7 +319,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'reopen') { $text = $langs->trans('ConfirmReopenKM', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -366,7 +366,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -384,7 +384,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index 2b2facafc18..820a596c6c2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -132,7 +132,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -153,7 +153,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index ce185c9b8cf..7f4da244271 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -151,7 +151,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index ff28b79a4ad..92b2b3f2adc 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -330,7 +330,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } // Add where from hooks diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 0f56a6115a3..e61d2c1034c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -125,7 +125,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 94f57bdd776..1d6b6650d27 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -573,8 +573,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->myobject_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->myobject_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -691,8 +691,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -715,8 +715,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -739,8 +739,8 @@ class MyObject extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index 985cbe6aa18..6d38c782184 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -80,7 +80,7 @@ if (!$res) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS -/*if (empty($user->id) && ! empty($_SESSION['dol_login'])) { +/*if (empty($user->id) && !empty($_SESSION['dol_login'])) { $user->fetch('',$_SESSION['dol_login']); $user->getrights(); }*/ diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index b37da30f229..3e6213eaa26 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -186,7 +186,7 @@ $form = new Form($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En'; llxHeader('', $title, $help_url); @@ -210,7 +210,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -230,7 +230,7 @@ if ($object->id > 0) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 0e1815fade1..18328de1f9d 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -346,7 +346,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { $text = $langs->trans('ConfirmActionMyObject', $object->ref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); @@ -393,7 +393,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index 01efbec8cdc..9a365dd88f2 100644 --- a/htdocs/modulebuilder/template/myobject_contact.php +++ b/htdocs/modulebuilder/template/myobject_contact.php @@ -173,7 +173,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -194,7 +194,7 @@ if ($object->id) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index fb5a773be81..f38e703fa69 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -189,7 +189,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= ': '.$proj->getNomUrl(); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 4a3a6bc8dd8..263ca494518 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -697,7 +697,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; @@ -770,13 +770,13 @@ class Mo extends CommonObject $fk_movement = GETPOST('fk_movement', 'int'); $arrayoflines = $this->fetchLinesLinked('consumed', $idline); - if (! empty($arrayoflines)) { + if (!empty($arrayoflines)) { $this->db->begin(); $stockmove = new MouvementStock($this->db); $stockmove->setOrigin($this->element, $this->id); - if (! empty($fk_movement)) { + if (!empty($fk_movement)) { $moline = new MoLine($this->db); $TArrayMoLine = $moline->fetchAll('', '', 1, 0, array('customsql' => 'fk_stock_movement ='.$fk_movement)); $moline = array_shift($TArrayMoLine); @@ -903,8 +903,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->create)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mrp->mrp_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mrp->create)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mrp->mrp_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -1015,8 +1015,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1039,8 +1039,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; @@ -1063,8 +1063,8 @@ class Mo extends CommonObject return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) { $this->error='Permission denied'; return -1; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 60ac81e20cd..491240cff55 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -130,7 +130,7 @@ $formproject = new FormProjets($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 032f9a7961c..5d06f8c0f52 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -424,7 +424,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 12d2320742d..9bcc446b7c8 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -292,7 +292,7 @@ foreach($object->fields as $key => $val) { $sql .= "t.".$key.", "; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.", " : ""); } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 88788da8b43..3dbfe40106d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -473,7 +473,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $text = $langs->trans('ConfirmValidateMo', $numref); - /*if (! empty($conf->notification->enabled)) + /*if (!empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; $notify = new Notify($db); diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 7e0468119bd..bd4ecbc4cd4 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -28,7 +28,7 @@ if (!empty($form) && !is_object($form)) { $form = new Form($db); } -$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); +$qtytoconsumeforline = $this->tpl['qty'] / ( !empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 91dc0bce0ad..06fe91c120d 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -506,7 +506,7 @@ if ($resql) { } // code - if (! empty($arrayfields['m.code']['checked'])) { + if (!empty($arrayfields['m.code']['checked'])) { print '
    '; print $obj->code; print ' - '.$obj->name.''; @@ -516,7 +516,7 @@ if ($resql) { } // rate - if (! empty($arrayfields['cr.rate']['checked'])) { + if (!empty($arrayfields['cr.rate']['checked'])) { print ''; print $obj->rate; print "
    '.$langs->trans("NoteNotVisibleOnBill").''; diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 3018312cd0e..7f7b8ca01a8 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -293,7 +293,7 @@ if ($id > 0 || !empty($ref)) { $prods_arbo = $object->get_arbo_each_prod(); $tmpid = $id; - if (! empty($conf->use_javascript_ajax)) { + if (!empty($conf->use_javascript_ajax)) { $nboflines = $prods_arbo; $table_element_line='product_association'; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 47404ba4f04..796470c469c 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -313,7 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index f00f90e120b..281d58ea99e 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -488,7 +488,7 @@ class Inventory extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } @@ -815,7 +815,7 @@ class InventoryLine extends CommonObjectLine public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - //if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); + //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); return $result; } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index c1ef43c5c02..be7512df6fc 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -494,7 +494,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->project->enabled)) + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -516,7 +516,7 @@ if ($object->id > 0) { } } } else { - if (! empty($object->fk_project)) { + if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref.=$proj->getNomUrl(); @@ -1058,9 +1058,9 @@ if ($object->id > 0) { $hasinput = true; } - if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print '
    '; @@ -1082,7 +1082,7 @@ if ($object->id > 0) { print ''; - if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (!empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $qty_view; print ''; @@ -1111,7 +1111,7 @@ if ($object->id > 0) { } else { if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { //PMP Expected - if (! empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; + if (!empty($obj->pmp_expected)) $pmp_expected = $obj->pmp_expected; else $pmp_expected = $product_static->pmp; $pmp_valuation = $pmp_expected * $valuetoshow; print ''; @@ -1127,7 +1127,7 @@ if ($object->id > 0) { //PMP Real print ''; - if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (!empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $obj->qty_view; print price($pmp_real); @@ -1190,7 +1190,7 @@ if ($object->id > 0) { print ''; - if (! empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { + if (!empty($conf->global->INVENTORY_MANAGE_REAL_PMP)) { ?> '; } + } else { + dol_print_error($db); } } else { print ''; From 6c45b13178555adf8f5b32c5e3ae4b8e81569572 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 12:32:27 +0200 Subject: [PATCH 28/60] NEW Add filter "Product subject to lot/Serial" in stock per lot/serial --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/stocks.lang | 1 + htdocs/product/reassort.php | 12 ++++++------ htdocs/product/reassortlot.php | 20 ++++++++++++++------ 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 83071830ae7..df24aa38327 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -190,7 +190,7 @@ class FormTicket // TITLE $email = GETPOSTISSET('email') ? GETPOST('email', 'alphanohtml') : ''; if ($this->withemail) { - print '
    '; + print '
    '; print ''; print '
    '; if ($permissiontoaddupdatepaymentinformation) { - print ''; + print ''; print img_picto($langs->trans("CreateBAN"), 'stripe'); print ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 5ec149ba07f..6814dc3757f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -588,7 +588,130 @@ class Stripe extends CommonObject return null; } } + /** + * Get the Stripe SEPA of a company payment mode + * + * @param \Stripe\StripeCustomer $cu Object stripe customer. + * @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity) + * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int $status Status (0=test, 1=live) + * @param int $createifnotlinkedtostripe 1=Create the stripe sepa and the link if the sepa is not yet linked to a stripe sepa. Deprecated with new Stripe API and SCA. + * @return \Stripe\PaymentMethod|null Stripe SEPA or null if not found + */ + public function sepaStripe($cu, CompanyPaymentMode $object, $stripeacc = '', $status = 0, $createifnotlinkedtostripe = 0) + { + global $conf, $user, $langs; + $sepa = null; + $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa + $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; + $sql .= " WHERE sa.rowid = ".$object->id; // We get record from ID, no need for filter on entity + $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) + + $soc = new Societe($this->db); + $soc->fetch($object->fk_soc); + + dol_syslog(get_class($this)."::fetch search stripe sepa(card) id for paymentmode id=".$object->id.", stripeacc=".$stripeacc.", status=".$status.", createifnotlinkedtostripe=".$createifnotlinkedtostripe, LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + if ($num) { + $obj = $this->db->fetch_object($resql); + $cardref = $obj->stripe_card_ref; + dol_syslog(get_class($this)."::cardStripe cardref=".$cardref); + if ($cardref) { + try { + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + if (!preg_match('/^pm_/', $cardref) && !empty($cu->sources)) { + $sepa = $cu->sources->retrieve($cardref); + } else { + $sepa = \Stripe\PaymentMethod::retrieve($cardref); + } + } else { + if (!preg_match('/^pm_/', $cardref) && !empty($cu->sources)) { + //$sepa = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc)); // this API fails when array stripe_account is provided + $sepa = $cu->sources->retrieve($cardref); + } else { + //$sepa = \Stripe\PaymentMethod::retrieve($cardref, array("stripe_account" => $stripeacc)); // Don't know if this works + $sepa = \Stripe\PaymentMethod::retrieve($cardref); + } + } + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + } + } elseif ($createifnotlinkedtostripe) { + $iban = $obj->iban_prefix; //prefix ? + $ipaddress = getUserRemoteIP(); + + $dataforcard = array( + 'type'=>'sepa_debit', + "sepa_debit" => array('iban' => $iban), + 'currency' => 'eur', + 'usage' => 'reusable', + 'owner' => array( + 'name' => $soc->name, + ), + "metadata" => array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress) + ); + + //$a = \Stripe\Stripe::getApiKey(); + //var_dump($a);var_dump($stripeacc);exit; + try { + dol_syslog("Try to create sepa_debit 0"); + + $service = 'StripeTest'; + $servicestatus = 0; + if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { + $service = 'StripeLive'; + $servicestatus = 1; + } + // Force to use the correct API key + global $stripearrayofkeysbyenv; + $stripeacc = $stripearrayofkeysbyenv[$servicestatus]['secret_key']; + + dol_syslog("Try to create sepa_debit with data = ".json_encode($dataforcard)); + $s = new \Stripe\StripeClient($stripeacc); + $sepa = $s->sources->create($dataforcard); + if (!$sepa) { + $this->error = 'Creation of sepa_debit on Stripe has failed'; + } else { + //association du client avec cette source de paimeent + $cs = $cu->createSource( + $cu->id, + [ + 'source' => $sepa->id, + ] + ); + if (!$cs) { + $this->error = 'Link SEPA <-> Customer failed'; + } else { + dol_syslog("Try to create sepa_debit 3"); + // print json_encode($sepa); + + $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib"; + $sql .= " SET stripe_card_ref = '".$this->db->escape($sepa->id)."', card_type = 'sepa_debit',"; + $sql .= " stripe_account= '" . $cu->id . '@' . $stripeacc . "'"; + $sql .= " WHERE rowid = ".$object->id; + $sql .= " AND type = 'ban'"; + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = $this->db->lasterror(); + } + } + } + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + } + } + } + } else { + dol_print_error($this->db); + } + + return $sepa; + } /** * Get the Stripe payment intent. Create it with confirmnow=false From 4ac4f78a997afc2de3ac5c6e5daa68c3c5a0fcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 15:25:19 +0200 Subject: [PATCH 35/60] add extrafield setup --- htdocs/admin/bankline_extrafields.php | 118 ++++++++++++++++++++++++++ htdocs/core/lib/bank.lib.php | 5 ++ htdocs/langs/en_US/banks.lang | 1 + 3 files changed, 124 insertions(+) create mode 100644 htdocs/admin/bankline_extrafields.php diff --git a/htdocs/admin/bankline_extrafields.php b/htdocs/admin/bankline_extrafields.php new file mode 100644 index 00000000000..d86733e4e24 --- /dev/null +++ b/htdocs/admin/bankline_extrafields.php @@ -0,0 +1,118 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2022 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file admin/bankline_extrafields.php + * \ingroup bank + * \brief Page to setup extra fields of bankline + */ + +// Load Dolibarr environment +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +// Load translation files required by the page +$langs->loadLangs(array("admin", "companies", "bills", "other", "banks")); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label = ExtraFields::$type2label; +$type2label = []; +foreach ($tmptype2label as $key => $val) { + $type2label[$key] = $langs->transnoentitiesnoconv($val); +} + +$action = GETPOST('action', 'aZ09'); +$attrname = GETPOST('attrname', 'alpha'); +$elementtype = 'bank'; //Must be the $table_element of the class that manage extrafield + +if (!$user->admin) { + accessforbidden(); +} + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; + +/* + * View + */ + + +$help_url = ''; +$page_name = "BankSetupModule"; + +llxHeader('', $langs->trans("BankSetupModule"), $help_url); + + +$linkback = ''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); + + +$head = bank_admin_prepare_head(null); + +print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account'); + +require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; + +print dol_get_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') { + print '
    '; + print ''.$langs->trans("NewAttribute").''; + print "
    "; +} + + +/* + * Creation of an optional field + */ +if ($action == 'create') { + print '
    '; + print load_fiche_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* + * Edition of an optional field + */ +if ($action == 'edit' && !empty($attrname)) { + print "
    "; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 5dde1bc4360..1792de89a60 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -157,6 +157,11 @@ function bank_admin_prepare_head($object) $head[$h][2] = 'attributes'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; + $head[$h][1] = $langs->trans("BanklineExtraFields"); + $head[$h][2] = 'bankline_extrafields'; + $h++; + complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove'); diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 10ba859e71f..71a80406ae4 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -185,3 +185,4 @@ AlreadyOneBankAccount=Already one bank account defined SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=SEPA transfer: 'Payment Type' at 'Credit Transfer' level SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=When generatin a SEPA XML file for Credit transfers, the section "PaymentTypeInformation" can now be placed inside the "CreditTransferTransactionInformation" section (instead of "Payment" section). We strongly recommend to keep this unchecked to place PaymentTypeInformation at Payment level, as all banks will not necessarily accept it at CreditTransferTransactionInformation level. Contact your bank before placing PaymentTypeInformation at CreditTransferTransactionInformation level. ToCreateRelatedRecordIntoBank=To create missing related bank record +BanklineExtraFields=Bank Line Extrafields From 6ce06658400c421e9d8ffbdc640b32b4204c8fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 15:32:48 +0200 Subject: [PATCH 36/60] fix agenda setup --- htdocs/admin/agenda.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 3221738bcd3..e9708d8c005 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -3,6 +3,7 @@ * Copyright (C) 2011 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -184,7 +185,7 @@ if (!empty($triggers)) { } //print 'module='.$module.' code='.$trigger['code'].'
    '; - if (isModEnabled('module')) { + if (isModEnabled($module)) { // Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { continue; From a865388b9c471be122a813c838c000a53b0c2543 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Sep 2022 15:38:31 +0200 Subject: [PATCH 37/60] FIX fatal error abs on non int --- htdocs/public/recruitment/view.php | 6 ++++++ htdocs/user/class/user.class.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index b92dcbf9824..2eaa51ac2fe 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -217,7 +217,13 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb if ($urllogo) { print '
    '; print '
    '; + if (!empty($mysoc->url)) { + print ''; + } print ''; + if (!empty($mysoc->url)) { + print ''; + } print '
    '; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f8558e11a24..5a7a3bc030d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2827,7 +2827,7 @@ class User extends CommonObject $result .= (($option == 'nolink') ? '' : $linkstart); if ($withpictoimg) { $paddafterimage = ''; - if (abs($withpictoimg) == 1) { + if (abs((int) $withpictoimg) == 1) { $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; } // Only picto From c8ddcf86b61d5618d0cfd6d09fdcb3dd0bb23097 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 1 Sep 2022 16:06:03 +0200 Subject: [PATCH 38/60] fix Ci error --- htdocs/stripe/class/stripe.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6814dc3757f..6410050c642 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -588,6 +588,7 @@ class Stripe extends CommonObject return null; } } + /** * Get the Stripe SEPA of a company payment mode * @@ -605,7 +606,7 @@ class Stripe extends CommonObject $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; - $sql .= " WHERE sa.rowid = ".$object->id; // We get record from ID, no need for filter on entity + $sql .= " WHERE sa.rowid = '".$this->db->escape($object->id)."'"; // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) $soc = new Societe($this->db); @@ -691,8 +692,8 @@ class Stripe extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib"; $sql .= " SET stripe_card_ref = '".$this->db->escape($sepa->id)."', card_type = 'sepa_debit',"; - $sql .= " stripe_account= '" . $cu->id . '@' . $stripeacc . "'"; - $sql .= " WHERE rowid = ".$object->id; + $sql .= " stripe_account= '" . $this->db->escape($cu->id . "@" . $stripeacc) . "'"; + $sql .= " WHERE rowid = '".$this->db->escape($object->id)."'"; $sql .= " AND type = 'ban'"; $resql = $this->db->query($sql); if (!$resql) { From ffe0420523a39eea19e9b3ad22823271367025fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 1 Sep 2022 16:15:36 +0200 Subject: [PATCH 39/60] fix delay setup --- htdocs/admin/delais.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index af8fed1c197..ec7874b7db8 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -172,7 +173,7 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) { if ($action == 'update') { foreach ($modules as $module => $delays) { - if (isModEnabled('module')) { + if (isModEnabled($module)) { foreach ($delays as $delay) { if (GETPOST($delay['code']) != '') { dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); @@ -226,7 +227,7 @@ if ($action == 'edit') { print '
    '.$langs->trans("LateWarningAfter").'
    '.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").'
    '.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print '
    '.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    '.$langs->trans("Login").' *
    '.$langs->trans("Password").' *
    '.$langs->trans("PasswordRetype").' *
    '.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
    '.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -621,17 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print '
    '.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print '
    '.$langs->trans("URLPhoto").'
    '.$langs->trans("Public").'
    '.$langs->trans("Comments").'
    '.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); print '
    '.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
    '.$langs->trans("Lastname").' *
    '.$langs->trans("Firstname").' *
    '.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''; //print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    '.$langs->trans("Login").' *
    '.$langs->trans("Password").' *
    '.$langs->trans("PasswordRetype").' *
    '.$langs->trans("Gender").''; $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); print '
    '.$langs->trans("Address").''."\n"; print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
    '.$langs->trans('Country').''; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -633,22 +633,22 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW } print '
    '.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print '
    '.$langs->trans("URLPhoto").'
    '.$langs->trans("Public").'
    '.$langs->trans("Comments").''; print ''; print ''; print ''; print ''; print ''; print ''; print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; @@ -1775,8 +1793,10 @@ if ($resql) { ), 'pos' => array(), ); + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields $parameters = array( 'arrayfields' => $arrayfields, @@ -1976,6 +1996,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; @@ -1985,6 +2006,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1994,6 +2016,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; @@ -2003,6 +2026,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // State if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."'; @@ -2020,6 +2045,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; @@ -2046,6 +2072,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Plannned date of delivery if (!empty($arrayfields['c.date_delivery']['checked'])) { print ''; @@ -2055,6 +2082,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Shipping Method if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { print ''; @@ -2064,6 +2092,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Payment terms if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; @@ -2073,6 +2102,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; @@ -2082,6 +2112,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Channel if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print ''; @@ -2091,7 +2122,8 @@ if ($resql) { $totalarray['nbfield']++; } } - // Amount HT + + // Amount HT/net if (!empty($arrayfields['c.total_ht']['checked'])) { print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'; if ($obj->socid > 0) { $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); @@ -2250,6 +2285,7 @@ if ($resql) { $totalarray['nbfield']++; } } + // Total margin if (!empty($arrayfields['total_margin']['checked'])) { print ''.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.$obj->import_key.''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).''; print ''; print ''; print ''; print ''; print ''; @@ -1793,10 +1791,10 @@ if ($resql) { ), 'pos' => array(), ); - + // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - + // Hook fields $parameters = array( 'arrayfields' => $arrayfields, @@ -1996,7 +1994,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Alias name if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; @@ -2006,7 +2004,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -2016,7 +2014,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Zip if (!empty($arrayfields['s.zip']['checked'])) { print ''; @@ -2026,7 +2024,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // State if (!empty($arrayfields['state.nom']['checked'])) { print "".$obj->state_name."'; @@ -2045,7 +2043,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; @@ -2072,7 +2070,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Plannned date of delivery if (!empty($arrayfields['c.date_delivery']['checked'])) { print ''; @@ -2082,7 +2080,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Shipping Method if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { print ''; @@ -2092,7 +2090,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Payment terms if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { print ''; @@ -2102,7 +2100,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Payment mode if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { print ''; @@ -2112,7 +2110,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Channel if (!empty($arrayfields['c.fk_input_reason']['checked'])) { print ''; @@ -2122,7 +2120,7 @@ if ($resql) { $totalarray['nbfield']++; } } - + // Amount HT/net if (!empty($arrayfields['c.total_ht']['checked'])) { print ''.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->multicurrency_total_ht)."'.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').''.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').''.$obj->import_key.''.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'