diff --git a/ChangeLog b/ChangeLog index 647030db6eb..2c00bda48f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,24 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 14.0.0 compared to 13.0.0 ***** + +For users: +---------- + + +For developers: +--------------- + + + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup. + + + ***** ChangeLog for 13.0.0 compared to 12.0.0 ***** For users: @@ -181,8 +199,7 @@ NEW: add option "If the feature to manage kits of module Stock is used, show det For developers: --------------- -NEW: add substitution key __MEMBER_TYPE__ -NEW: add substitution key __TYPE__ +NEW: add __MEMBER_TYPE__ and __TYPE__ substitution key NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER) NEW: add some fields to link website page to an other object @@ -194,12 +211,9 @@ NEW: can add event to log into blockedlog module with a constant NEW: add property cssview when declaring fields of an object NEW: can use dynamic code into the 'enabled' property of DAO fields NEW: field ref_ext in llx_commandedet -NEW: field ref_ext for Attributes and Combinations +NEW: fields ref_ext for Attributes and Combinations NEW: OAuth SCOPE for Admin SDK -NEW: retrieve discount from invoice from API NEW: standardizes API thirdparties by email like other object -NEW: Thirdparty REST API: endpoint to set price level -NEW: use new category API for project list view NEW: Triggers Attributes and Attributes values NEW: add incoterms data into the substitution array NEW: add send context for ticket @@ -216,11 +230,12 @@ NEW: API can update a payment NEW: API get member by thirdparty NEW: API get thirdparty by barcode NEW: API get users by email / login -NEW: allow to edit field "demand reason" through API NEW: fetch contact by email with REST API -NEW: get state by REST API -NEW: get state dictionary by REST API -NEW: improve Product API for product variants +NEW: get state dictionnary by REST API +NEW: improve Product API for variant products +NEW: retrieve discount from invoice from API +NEW: Thirdparty REST API: endpoint to set price level +NEW: use new category API for project list view HOOKs NEW: add hook on propal card @@ -238,7 +253,7 @@ Following changes may create regressions for some external modules, but were nec * All properties ->titre have been renamed into ->title * Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id * Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency. -* The deprecated subsitution key __SIGNATURE__ has been removed. Use __USER_SIGNATURE__ if you used the old syntax in your email templates. +* The deprecated subsitution key __SIGNATURE__ has been removed. Replace it with __USER_SIGNATURE__ if you used the old syntax in your email templates. * The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday. * If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm), you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait. @@ -250,8 +265,9 @@ Following changes may create regressions for some external modules, but were nec * Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used. * Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main" * Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet) -* Databse transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code. - +* Database transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code. +* Dolibarr v13 is still compatible with any PHP version between 5.6.0 and 7.4.*; Unit tests are OK with PHP 8.0 but some warnings or troubles may appears with PHP 8.0. +* All your Ajax services must contains such a line at begin of file: if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal ***** ChangeLog for 12.0.4 compared to 12.0.3 ***** FIX: make formConfirm an addreplace-type hook diff --git a/build/debian/control b/build/debian/control index 0ef5367072f..eed54669555 100755 --- a/build/debian/control +++ b/build/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Laurent Destailleur (eldy) # Uploaders: Laurent Destailleur (eldy) # Only if differs from Maintainer Standards-Version: 3.9.6 -Homepage: http://www.dolibarr.org +Homepage: https://www.dolibarr.org Build-Depends: debhelper (>= 9), po-debconf # This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 7684d02ff3d..26a08a55826 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -23,7 +23,7 @@ setup_empty_conf() { mkdir -p /etc/dolibarr touch /etc/dolibarr/conf.php chown root:www-data /etc/dolibarr/conf.php - chmod 664 /etc/dolibarr/conf.php + chmod 660 /etc/dolibarr/conf.php } is_new_upstream_version() { diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 41c20740d78..50eb6c84def 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -105,8 +105,8 @@ if (empty($includecustom)) { } } -print "Release : ".$release."\n"; print "Working on files into : ".DOL_DOCUMENT_ROOT."\n"; +print "Release : ".$release."\n"; print "Include custom in signature : ".$includecustom."\n"; print "Include constants in signature : "; foreach ($includeconstants as $countrycode => $tmp) { diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 6d621a7e101..3c3489185f4 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -444,9 +444,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $var = false; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -481,7 +478,6 @@ if ($id) } print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; @@ -612,7 +608,7 @@ if ($id) print ' '; } else { $tmpaction = 'view'; - $parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index c905ad25cd0..23ebde7e230 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -76,7 +76,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; } else { - $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; + $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 53dfb1cd5f9..e3a39c5d8b1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -438,8 +438,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -496,7 +494,6 @@ if ($id) else print $valuetoshow; print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index ae36f0f7fa6..a7bf28d9091 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -100,7 +100,7 @@ if ($action == 'update') { if ($action == 'setlistsorttodo') { $setlistsorttodo = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } @@ -114,9 +114,10 @@ if ($action == 'setlistsorttodo') { if ($action == 'setlistsortdone') { $setlistsortdone = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -127,9 +128,10 @@ if ($action == 'setlistsortdone') { if ($action == 'setmanagezero') { $setmanagezero = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -140,9 +142,10 @@ if ($action == 'setmanagezero') { if ($action == 'setdisabledirectinput') { $setdisabledirectinput = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -153,9 +156,10 @@ if ($action == 'setdisabledirectinput') { if ($action == 'setenabledraftexport') { $setenabledraftexport = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -166,9 +170,10 @@ if ($action == 'setenabledraftexport') { if ($action == 'setenablesubsidiarylist') { $setenablesubsidiarylist = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -179,9 +184,10 @@ if ($action == 'setenablesubsidiarylist') { if ($action == 'setdisablebindingonsales') { $setdisablebindingonsales = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -192,9 +198,10 @@ if ($action == 'setdisablebindingonsales') { if ($action == 'setdisablebindingonpurchases') { $setdisablebindingonpurchases = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -205,9 +212,10 @@ if ($action == 'setdisablebindingonpurchases') { if ($action == 'setdisablebindingonexpensereports') { $setdisablebindingonexpensereports = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -215,9 +223,11 @@ if ($action == 'setdisablebindingonexpensereports') { } } + /* * View */ + $form = new Form($db); $title = $langs->trans('ConfigAccountingExpert'); diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index bb192f0a693..1d3e8bccdd7 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -407,8 +407,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -437,7 +435,6 @@ if ($id) else print $valuetoshow; print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index fcd7efdab47..de60bd09897 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -16,7 +16,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -307,7 +306,7 @@ if ($action != 'export_csv') $accountingaccountstatic->fetch(null, $line->numero_compte, true); if (!empty($accountingaccountstatic->account_number)) { - $accounting_account = $accountingaccountstatic->getNomUrl(0, 1); + $accounting_account = $accountingaccountstatic->getNomUrl(0, 1, 0, '', 0, -1, 0, 'accountcard'); } else { $accounting_account = length_accountg($line->numero_compte); } @@ -322,10 +321,19 @@ if ($action != 'export_csv') $root_account_description = $tmparrayforrootaccount['label']; $root_account_number = $tmparrayforrootaccount['account_number']; + //var_dump($tmparrayforrootaccount); + //var_dump($accounting_account); + //var_dump($accountingaccountstatic); if (empty($accountingaccountstatic->label) && $accountingaccountstatic->id > 0) { $link = '' . img_edit() . ''; - } elseif (empty($tmparrayforrootaccount['label'])) { + } elseif ($accounting_account == 'NotDefined') { $link = '' . img_edit_add() . ''; + } elseif (empty($tmparrayforrootaccount['label'])) { + // $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent. + // This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent. + // BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account. + // BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin. + //$link = '' . img_edit_add() . ''; } if (!empty($show_subgroup)) @@ -363,8 +371,22 @@ if ($action != 'export_csv') print ''; print ''.$accounting_account.''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) print ''.price($opening_balance).''; - print ''.price($line->debit).''; - print ''.price($line->credit).''; + + $urlzoom = ''; + if ($line->numero_compte) { + $urlzoom = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($line->numero_compte).'&search_accountancy_code_end='.urlencode($line->numero_compte); + if (GETPOSTISSET('date_startmonth')) { + $urlzoom .= '&search_date_startmonth='.GETPOST('date_startmonth', 'int').'&search_date_startday='.GETPOST('date_startday', 'int').'&search_date_startyear='.GETPOST('date_startyear', 'int'); + } + if (GETPOSTISSET('date_endmonth')) { + $urlzoom .= '&search_date_endmonth='.GETPOST('date_endmonth', 'int').'&search_date_endday='.GETPOST('date_endday', 'int').'&search_date_endyear='.GETPOST('date_endyear', 'int'); + } + } + // Debit + print ''.price($line->debit).''; + // Credit + print ''.price($line->credit).''; + if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).''; } else { diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 21077dececd..e5a061d34bd 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -63,9 +63,11 @@ $accountingjournal->fetch(null, $journal_code); $journal_label = $accountingjournal->label; $subledger_account = GETPOST('subledger_account', 'alphanohtml'); -if ($subledger_account == - 1) { +if ($subledger_account == -1) { $subledger_account = null; } +$subledger_label = GETPOST('subledger_label', 'alphanohtml'); + $label_operation = GETPOST('label_operation', 'alphanohtml'); $debit = price2num(GETPOST('debit', 'alpha')); $credit = price2num(GETPOST('credit', 'alpha')); @@ -108,6 +110,7 @@ if ($action == "confirm_update") { } else { $object->numero_compte = $accountingaccount_number; $object->subledger_account = $subledger_account; + $object->subledger_label = $subledger_label; $object->label_compte = $accountingaccount_label; $object->label_operation = $label_operation; $object->debit = $debit; @@ -160,6 +163,7 @@ if ($action == "confirm_update") { $object->numero_compte = $accountingaccount_number; $object->subledger_account = $subledger_account; + $object->subledger_label = $subledger_label; $object->label_compte = $accountingaccount_label; $object->label_operation = $label_operation; $object->debit = $debit; @@ -578,7 +582,7 @@ if ($action == 'create') print '
'; - $result = $object->fetchAllPerMvt($piece_num, $mode); + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -630,9 +634,10 @@ if ($action == 'create') if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1); } else { - print 'subledger_account).'">'; + print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } - // TODO Add also the label + // Add also input for subledger label + print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">'; print ''; print 'label_operation).'">'; print 'debit)).'">'; @@ -644,20 +649,24 @@ if ($action == 'create') } else { $accountingaccount->fetch(null, $line->numero_compte, true); print ''.$accountingaccount->getNomUrl(0, 1, 1, '', 0).''; - print ''.length_accounta($line->subledger_account).''; + print ''.length_accounta($line->subledger_account); + if ($line->subledger_label) { + print ' - '.$line->subledger_label.''; + } + print ''; print ''.$line->label_operation.''; print ''.price($line->debit).''; print ''.price($line->credit).''; print ''; - print 'id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">'; + print 'id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">'; print img_edit('', 0, 'class="marginrightonly"'); print '  '; $actiontodelete = 'delete'; if ($mode == '_tmp' || $action != 'delmouv') $actiontodelete = 'confirm_delete'; - print ''; + print ''; print img_delete(); print ''; @@ -688,9 +697,9 @@ if ($action == 'create') if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { print $formaccounting->select_auxaccount('', 'subledger_account', 1); } else { - print ''; + print ''; } - // TODO Add also the label + print '
'; print ''; print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 92e407732e0..065c0b06d08 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -87,7 +87,7 @@ $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); -$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha'); +$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); @@ -784,7 +784,7 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { print ''; print ''; - print '
'.$langs->trans("NotReconciled").''; + print '
'.$langs->trans("NotReconciled").''; print ''; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 21b8c51380d..9e62f9e0b79 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -74,7 +74,7 @@ $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); -$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha'); +$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { $action = 'delbookkeepingyear'; @@ -516,7 +516,7 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { print ''; print ''; - print '
'.$langs->trans("NotReconciled").''; + print '
'.$langs->trans("NotReconciled").''; print ''; } // Date export diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index b7ef25fd821..01b1a0a1335 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -74,7 +74,7 @@ $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_debit = GETPOST('search_debit', 'alpha'); $search_credit = GETPOST('search_credit', 'alpha'); $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); -$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha'); +$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { $action = 'delbookkeepingyear'; @@ -544,7 +544,7 @@ if (!empty($arrayfields['t.credit']['checked'])) { if (!empty($arrayfields['t.lettering_code']['checked'])) { print ''; print ''; - print '
'.$langs->trans("NotReconciled").''; + print '
'.$langs->trans("NotReconciled").''; print ''; } // Date export diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index b936f99925a..382b7ee6f62 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -57,8 +57,8 @@ class AccountancyExport public static $EXPORT_TYPE_OPENCONCERTO = 100; public static $EXPORT_TYPE_LDCOMPTA = 110; public static $EXPORT_TYPE_LDCOMPTA10 = 120; - public static $EXPORT_TYPE_GESTINUMV3 = 130; - public static $EXPORT_TYPE_GESTINUMV5 = 135; + public static $EXPORT_TYPE_GESTIMUMV3 = 130; + public static $EXPORT_TYPE_GESTIMUMV5 = 135; public static $EXPORT_TYPE_FEC = 1000; public static $EXPORT_TYPE_FEC2 = 1010; @@ -119,8 +119,8 @@ class AccountancyExport self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'), self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'), self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'), - self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'), - self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'), + self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'), + self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'), self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'), self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'), ); @@ -154,8 +154,8 @@ class AccountancyExport self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne', self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta', self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10', - self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3', - self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5', + self::$EXPORT_TYPE_GESTIMUMV3 => 'gestimumv3', + self::$EXPORT_TYPE_GESTIMUMV5 => 'gestimumv5', self::$EXPORT_TYPE_FEC => 'fec', self::$EXPORT_TYPE_FEC2 => 'fec2', ); @@ -227,11 +227,13 @@ class AccountancyExport self::$EXPORT_TYPE_LDCOMPTA10 => array( 'label' => $langs->trans('Modelcsv_LDCompta10'), ), - self::$EXPORT_TYPE_GESTINUMV3 => array( + self::$EXPORT_TYPE_GESTIMUMV3 => array( 'label' => $langs->trans('Modelcsv_Gestinumv3'), + 'ACCOUNTING_EXPORT_FORMAT' => 'txt', ), - self::$EXPORT_TYPE_GESTINUMV5 => array( + self::$EXPORT_TYPE_GESTIMUMV5 => array( 'label' => $langs->trans('Modelcsv_Gestinumv5'), + 'ACCOUNTING_EXPORT_FORMAT' => 'txt', ), self::$EXPORT_TYPE_FEC => array( 'label' => $langs->trans('Modelcsv_FEC'), @@ -320,10 +322,10 @@ class AccountancyExport case self::$EXPORT_TYPE_LDCOMPTA10 : $this->exportLDCompta10($TData); break; - case self::$EXPORT_TYPE_GESTINUMV3 : + case self::$EXPORT_TYPE_GESTIMUMV3 : $this->exportGestimumV3($TData); break; - case self::$EXPORT_TYPE_GESTINUMV5 : + case self::$EXPORT_TYPE_GESTIMUMV5 : $this->exportGestimumV5($TData); break; case self::$EXPORT_TYPE_FEC : @@ -1638,81 +1640,85 @@ class AccountancyExport $invoices_infos = array(); $supplier_invoices_infos = array(); foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d/%m/%Y'); - - $invoice_ref = $line->doc_ref; - $company_name = ""; - - if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) { - if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) || - ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { - if ($line->doc_type == 'customer_invoice') { - // Get new customer invoice ref and company name - $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; - $sql .= ' WHERE f.rowid = ' . $line->fk_doc; - $resql = $this->db->query($sql); - if ($resql) { - if ($obj = $this->db->fetch_object($resql)) { - // Save invoice infos - $invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom); - $invoice_ref = $obj->ref; - $company_name = $obj->nom; - } - } - } else { - // Get new supplier invoice ref and company name - $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; - $sql .= ' WHERE ff.rowid = ' . $line->fk_doc; - $resql = $this->db->query($sql); - if ($resql) { - if ($obj = $this->db->fetch_object($resql)) { - // Save invoice infos - $supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom); - $invoice_ref = $obj->ref; - $company_name = $obj->nom; - } - } - } - } elseif ($line->doc_type == 'customer_invoice') { - // Retrieve invoice infos - $invoice_ref = $invoices_infos[$line->fk_doc]['ref']; - $company_name = $invoices_infos[$line->fk_doc]['company_name']; - } else { - // Retrieve invoice infos - $invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref']; - $company_name = $supplier_invoices_infos[$line->fk_doc]['company_name']; - } - } - - print $line->id . $this->separator; - print $date . $this->separator; - print substr($line->code_journal, 0, 4) . $this->separator; - - if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { - print length_accountg($line->subledger_account) . $this->separator; + if ($line->debit == 0 && $line->credit == 0) { + unset($array[$line]); } else { - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + + $invoice_ref = $line->doc_ref; + $company_name = ""; + + if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) { + if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) || + ($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) { + if ($line->doc_type == 'customer_invoice') { + // Get new customer invoice ref and company name + $sql = 'SELECT f.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid'; + $sql .= ' WHERE f.rowid = ' . $line->fk_doc; + $resql = $this->db->query($sql); + if ($resql) { + if ($obj = $this->db->fetch_object($resql)) { + // Save invoice infos + $invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom); + $invoice_ref = $obj->ref; + $company_name = $obj->nom; + } + } + } else { + // Get new supplier invoice ref and company name + $sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid'; + $sql .= ' WHERE ff.rowid = ' . $line->fk_doc; + $resql = $this->db->query($sql); + if ($resql) { + if ($obj = $this->db->fetch_object($resql)) { + // Save invoice infos + $supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom); + $invoice_ref = $obj->ref; + $company_name = $obj->nom; + } + } + } + } elseif ($line->doc_type == 'customer_invoice') { + // Retrieve invoice infos + $invoice_ref = $invoices_infos[$line->fk_doc]['ref']; + $company_name = $invoices_infos[$line->fk_doc]['company_name']; + } else { + // Retrieve invoice infos + $invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref']; + $company_name = $supplier_invoices_infos[$line->fk_doc]['company_name']; + } + } + + print $line->id . $this->separator; + print $date . $this->separator; + print substr($line->code_journal, 0, 4) . $this->separator; + + if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { + print length_accountg($line->subledger_account) . $this->separator; + } else { + print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + } + //Libellé Auto + print $this->separator; + //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; + //Libellé manuel + print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator; + //Numéro de pièce + print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator; + //Devise + print 'EUR' . $this->separator; + //Montant + print price2num(abs($line->montant)) . $this->separator; + //Sens + print $line->sens . $this->separator; + //Code lettrage + print $this->separator; + //Date Echéance + print $date; + print $this->end_line; } - //Libellé Auto - print $this->separator; - //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; - //Libellé manuel - print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator; - //Numéro de pièce - print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator; - //Devise - print 'EUR' . $this->separator; - //Montant - print price2num(abs($line->montant)) . $this->separator; - //Sens - print $line->sens . $this->separator; - //Code lettrage - print $this->separator; - //Date Echéance - print $date; - print $this->end_line; } } @@ -1729,27 +1735,31 @@ class AccountancyExport $this->separator = ','; foreach ($objectLines as $line) { - $date = dol_print_date($line->doc_date, '%d%m%Y'); - - print $line->id . $this->separator; - print $date . $this->separator; - print substr($line->code_journal, 0, 4) . $this->separator; - if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { - print length_accountg($line->subledger_account) . $this->separator; + if ($line->debit == 0 && $line->credit == 0) { + unset($array[$line]); } else { - print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + $date = dol_print_date($line->doc_date, '%d%m%Y'); + + print $line->id . $this->separator; + print $date . $this->separator; + print substr($line->code_journal, 0, 4) . $this->separator; + if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) { + print length_accountg($line->subledger_account) . $this->separator; + } else { + print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator; + } + print $this->separator; + //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; + print '"' . dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1) . '"' . $this->separator; + print '"' . dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . '"' . $this->separator; + print price2num($line->montant) . $this->separator; + print $line->sens . $this->separator; + print $date . $this->separator; + print $this->separator; + print $this->separator; + print 'EUR'; + print $this->end_line; } - print $this->separator; - //print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator; - print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator; - print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator; - print price2num($line->montant).$this->separator; - print $line->sens.$this->separator; - print $date . $this->separator; - print $this->separator; - print $this->separator; - print 'EUR'; - print $this->end_line; } } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 8a3e6ebceb4..c8a12cef083 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -370,7 +370,7 @@ class BookKeeping extends CommonObject $sql .= ", ".(!empty($this->subledger_account) ? ("'".$this->db->escape($this->subledger_account)."'") : "NULL"); $sql .= ", ".(!empty($this->subledger_label) ? ("'".$this->db->escape($this->subledger_label)."'") : "NULL"); $sql .= ", '".$this->db->escape($this->numero_compte)."'"; - $sql .= ", ".(!empty($this->label_operation) ? ("'".$this->db->escape($this->label_operation)."'") : "NULL"); + $sql .= ", ".(!empty($this->label_compte) ? ("'".$this->db->escape($this->label_compte)."'") : "NULL"); $sql .= ", '".$this->db->escape($this->label_operation)."'"; $sql .= ", ".$this->debit; $sql .= ", ".$this->credit; @@ -1914,25 +1914,24 @@ class BookKeeping extends CommonObject /** * Return id and description of a root accounting account. - * This function takes the parent of parent to get the root account ! + * FIXME: This function takes the parent of parent to get the root account ! * * @param string $account Accounting account - * @return string Root account + * @return array Array with root account information (max 2 upper level) */ public function getRootAccount($account = null) { global $conf; $pcgver = $conf->global->CHARTOFACCOUNTS; - $sql = "SELECT root.rowid, root.account_number, root.label as label"; + $sql = "SELECT root.rowid, root.account_number, root.label as label,"; + $sql .= " parent.rowid as parent_rowid, parent.account_number as parent_account_number, parent.label as parent_label"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = ".((int) $pcgver); - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid AND parent.active = 1"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid AND root.active = 1"; $sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'"; - $sql .= " AND parent.active = 1"; - $sql .= " AND root.active = 1"; $sql .= " AND aa.entity IN (".getEntity('accountancy').")"; dol_syslog(get_class($this)."::select_account sql=".$sql, LOG_DEBUG); @@ -1943,7 +1942,8 @@ class BookKeeping extends CommonObject $obj = $this->db->fetch_object($resql); } - return array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label); + $result = array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label); + return $result; } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__." ".$this->error, LOG_ERR); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index af636c5609d..a5c603c2504 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch")); +$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products")); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -339,7 +339,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 2975c7de3c0..defe8bfd3b9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch")); +$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index c47255647cb..71839ecf08a 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -150,7 +150,7 @@ $userstatic = new User($db); $bankaccountstatic = new Account($db); $chargestatic = new ChargeSociales($db); $paymentdonstatic = new PaymentDonation($db); -$paymentvatstatic = new TVA($db); +$paymentvatstatic = new Tva($db); $paymentsalstatic = new PaymentSalary($db); $paymentexpensereportstatic = new PaymentExpenseReport($db); $paymentvariousstatic = new PaymentVarious($db); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 4bb163b6653..70d6d89216f 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy", "productbatch", "products")); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -334,16 +334,16 @@ if ($result) { print ''; print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); + //print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); $checkpicto = $form->showCheckAddButtons(); print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center '); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 2f9141eb322..37f596c05c1 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch")); +$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products")); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 8acf1f1b191..fef3bd53177 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -136,7 +136,7 @@ if ($action == 'update' || $action == 'add') { $constnote = GETPOST('constnote'); $res = dolibarr_set_const($db, $constname, $constvalue, $choices[$consttype], 0, $constnote, $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 4374d281895..21ce5037ef5 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -92,7 +92,7 @@ if ($action == 'update' || $action == 'add') { $res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index d0cdb098bae..e3acf3c4d99 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -63,7 +63,7 @@ if ($action == 'update') { $res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity); } - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index b1cc1d7619b..efdd6213dd5 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -97,7 +97,7 @@ if ($action == "save" && empty($cancel)) if ($search_event === '' || preg_match('/'.preg_quote($search_event, '/').'/i', $keyparam)) { $res = dolibarr_set_const($db, $keyparam, (GETPOST($keyparam, 'alpha') ?GETPOST($keyparam, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; } } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 7fbd139072d..f99c530c7e2 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -82,15 +82,15 @@ if ($actionsave) //print '-name='.$name.'-color='.$color; $res = dolibarr_set_const($db, 'AGENDA_EXT_NAME'.$i, $name, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, 'AGENDA_EXT_SRC'.$i, $src, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, 'AGENDA_EXT_OFFSETTZ'.$i, $offsettz, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, 'AGENDA_EXT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, 'AGENDA_EXT_ENABLED'.$i, $enabled, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $i++; } @@ -98,7 +98,7 @@ if ($actionsave) if (!$error) { $res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOST('AGENDA_EXT_NB', 'int')), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB = 5; $MAXAGENDA = empty($conf->global->AGENDA_EXT_NB) ? 5 : $conf->global->AGENDA_EXT_NB; } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index c1f77f4995e..a072869be8c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -51,6 +51,7 @@ $type = 'action'; include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; +$reg = array(); if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index d21ffdb1630..4cd7bff4ed8 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -112,7 +112,7 @@ if ($actionsave) if ($color == '-1') $color = ''; $res = dolibarr_set_const($db, 'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $i++; } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 34c3af89c53..36b5ab91f67 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -52,7 +52,7 @@ if ($action == 'updateMask') if ($maskconstbom) $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -141,7 +141,7 @@ elseif ($action == 'setdoc') $draft = GETPOST("BOM_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -155,7 +155,7 @@ elseif ($action == 'setdoc') $res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 8c2acb5dc8b..f00e6454761 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -55,7 +55,7 @@ if ($action == 'updateMask') $maskchequereceipts = GETPOST('maskchequereceipts', 'alpha'); if ($maskconstchequereceipts) $res = dolibarr_set_const($db, $maskconstchequereceipts, $maskchequereceipts, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -76,7 +76,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cde0253f99a..5e5655f918f 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -61,7 +61,7 @@ if ($action == 'updateMask') if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -146,7 +146,7 @@ elseif ($action == 'setdoc') { $draft = GETPOST("COMMANDE_DRAFT_WATERMARK"); $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -160,7 +160,7 @@ elseif ($action == 'setdoc') { $res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -172,7 +172,7 @@ elseif ($action == 'setdoc') { // Activate Set Shippable Icon In List $setshippableiconinlist = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -186,7 +186,7 @@ elseif ($action == 'setdoc') { $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -201,7 +201,7 @@ elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -216,7 +216,7 @@ elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index b5e4c0ddf45..05330e92b89 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -57,7 +57,7 @@ if ($action == 'updateMask') $maskvalue = GETPOST('maskcontract', 'alpha'); if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 2502a257ae7..90ea5f290b6 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -33,7 +33,9 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'aZ09'); +if (empty($action)) $action = 'edit'; +// Define list of managed delays $modules = array( 'agenda' => array( array( @@ -190,6 +192,10 @@ if ($action == 'update') for ($i = 0; $i < 4; $i++) { if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); } + + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + + $action = 'edit'; } diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index b1606268205..9b9060aa054 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -58,7 +58,7 @@ if ($action == 'updateMask') $maskdelivery = GETPOST('maskdelivery', 'alpha'); if ($maskconstdelivery) $res = dolibarr_set_const($db, $maskconstdelivery, $maskdelivery, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -73,7 +73,7 @@ if ($action == 'set_DELIVERY_FREE_TEXT') $free = GETPOST('DELIVERY_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "DELIVERY_FREE_TEXT", $free, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index daf15552300..80398531515 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -236,7 +236,7 @@ $tabsqlsort[3] = "country ASC, code ASC"; $tabsqlsort[4] = "code ASC"; $tabsqlsort[5] = "label ASC"; $tabsqlsort[6] = "a.type ASC, a.module ASC, a.position ASC, a.code ASC"; -$tabsqlsort[7] = "country ASC, code ASC, a.libelle ASC"; +$tabsqlsort[7] = "c.label ASC, a.code ASC, a.libelle ASC"; $tabsqlsort[8] = "country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '')." libelle ASC"; $tabsqlsort[9] = "label ASC"; $tabsqlsort[10] = "country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; @@ -1069,6 +1069,7 @@ if ($id) elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code); elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code); elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code); + elseif ($search_code != '' && $id == 7) $sql .= natural_search("a.code", $search_code); elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code); if ($sortfield) @@ -1107,7 +1108,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; $withentity = null; $fieldlist = explode(',', $tabfield[$id]); @@ -1214,7 +1214,6 @@ if ($id) else $tdsoffields .= $valuetoshow; $tdsoffields .= ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } if ($id == 4) $tdsoffields .= ''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 61688e18515..ad04e09ffd1 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -61,7 +61,7 @@ if ($action == 'updateMask') { $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); } - if (!$res > 0) { + if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 00dcb7c3180..c5b8262c4be 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -66,7 +66,7 @@ if ($action == 'updateMask') if ($maskconstcredit) $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity); if ($maskconstdeposit) $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -156,7 +156,7 @@ elseif ($action == 'setdoc') $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -170,7 +170,7 @@ elseif ($action == 'setdoc') $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -184,7 +184,7 @@ elseif ($action == 'setdoc') $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -198,7 +198,7 @@ elseif ($action == 'setdoc') $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION", $forcedate, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -217,7 +217,7 @@ elseif ($action == 'setdoc') foreach ($invoicetypemodels as $type => $value) { $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type), $value, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; } if (!$error) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index e3178d946a0..afe6bc2239c 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -58,7 +58,7 @@ if ($action == 'updateMask') $maskvalue = GETPOST('maskvalue', 'alpha'); if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -147,7 +147,7 @@ elseif ($action == 'setdoc') $freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -160,7 +160,7 @@ elseif ($action == 'setdoc') $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -173,7 +173,7 @@ elseif ($action == 'setdoc') $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { @@ -185,7 +185,7 @@ elseif ($action == 'setdoc') $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } @@ -198,7 +198,7 @@ elseif ($action == 'setdoc') $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } @@ -211,7 +211,7 @@ elseif ($action == 'setdoc') $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) { + if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index eca8319d661..d8de2dd847d 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -59,7 +59,7 @@ if ($action == 'updateMask') $maskvalue = GETPOST('maskholiday', 'alpha'); if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 32aa7accfcf..4ea5db1cecd 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -36,6 +36,7 @@ $action = GETPOST('action', 'aZ09'); $form = new Form($db); + /* * Actions */ @@ -52,21 +53,20 @@ if ($action == 'setvalue') $contactbulkdefault = GETPOST('MAILING_CONTACT_DEFAULT_BULK_STATUS', 'int'); $res = dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO", $mailerror, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, "MAILING_DELAY", $mailingdelay, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; $res = dolibarr_set_const($db, "MAILING_CONTACT_DEFAULT_BULK_STATUS", $contactbulkdefault, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; // Create temporary encryption key if nedded $res = dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; - if (!$error) - { + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -77,7 +77,7 @@ if ($action == 'setvalue') if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { $setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 8070beab59b..3c9c634a8cd 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -59,7 +59,7 @@ if ($action == 'update' || $action == 'add') $constnote = $_POST["constnote"][$key]; $res = dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); - if (!$res > 0) $error++; + if (!($res > 0)) $error++; } if (!$error) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 5e32a637c8f..b0b18de20dc 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -532,6 +532,7 @@ if ($action == 'edit') print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; @@ -552,10 +553,12 @@ if ($action == 'edit') } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; @@ -663,6 +666,7 @@ if ($action == 'edit') } print '
'.$langs->trans("MAIN_MAIL_SENDMODE").'
'; + print '
'; if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { print info_admin($langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); @@ -670,13 +674,15 @@ if ($action == 'edit') print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; // From print ''; print ''; // Default from type @@ -746,6 +752,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("OtherOptions").'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; - if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); + if (empty($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("Mandatory")); + elseif (!isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'
'; + print '
'; } print dol_get_fiche_end(); @@ -761,7 +768,7 @@ if ($action == 'edit') { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print ''.$langs->trans("DoTestServerAvailability").''; } } else { print ''.$langs->trans("DoTestServerAvailability").''; @@ -837,6 +844,7 @@ if ($action == 'edit') // Run the test to connect if ($action == 'testconnect') { + print '
'; print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -851,6 +859,7 @@ if ($action == 'edit') } setEventMessages($errormsg, null, 'errors'); + print $errormsg; } print '
'; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1cf784de3c5..e6a85894fc4 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -472,22 +472,22 @@ if ($nbofactivatedmodules <= 1) { print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page +$deschelp = ''; if ($mode == 'common' || $mode == 'commonkanban') { $desc = $langs->trans("ModulesDesc", '{picto}'); $desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc); - print ''.$desc."

\n"; + $deschelp = ''.$desc."

\n"; } if ($mode == 'marketplace') { - print ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesMarketPlaceDesc")."

\n"; } if ($mode == 'deploy') { - print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; + $deschelp = ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."

\n"; } if ($mode == 'develop') { - print ''.$langs->trans("ModulesDevelopDesc")."

\n"; + $deschelp = ''.$langs->trans("ModulesDevelopDesc")."

\n"; } - $head = modules_prepare_head(); @@ -512,6 +512,8 @@ if ($mode == 'common' || $mode == 'commonkanban') { print dol_get_fiche_head($head, 'modules', '', -1); + print $deschelp; + $moreforfilter = '
'; $moreforfilter .= '