Merge branch 'Dolibarr:develop' into imap-by-oauth2-attachment

This commit is contained in:
fboitel 2022-08-26 10:39:46 +02:00 committed by GitHub
commit 4a6f578a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
275 changed files with 1587 additions and 1349 deletions

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries")); $langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
$mesg = ''; $mesg = '';
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');

View File

@ -44,7 +44,7 @@ if (isModEnabled('accounting')) {
} }
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "compta", "accountancy", "hrm")); $langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource'));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
$error = 0; $error = 0;
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("bills", "accountancy", "compta")); $langs->loadLangs(array('accountancy', 'bills', 'compta'));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->loadLangs(array("accountancy", "compta")); $langs->loadLangs(array("accountancy", "compta"));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optioncss', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ09');
// Load variable for pagination // Load variable for pagination
@ -158,7 +159,8 @@ if (empty($user->rights->accounting->mouvements->lire)) {
* Action * Action
*/ */
$parameters = array('socid'=>$socid); $parameters = array();
$arrayfields = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) { if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -212,7 +212,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
print $s; print $s;
print "<br>\n"; print "<br>\n";
if (isModEnabled('expensereport')|| isModEnabled('deplacement')) { if (isModEnabled('expensereport') || isModEnabled('deplacement')) {
$step++; $step++;
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n"; $s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s); $s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s);

View File

@ -111,7 +111,7 @@ if ($action == 'set_default') {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
$res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
} }
} }
@ -238,13 +238,13 @@ print "</td></tr>\n";
// Insert subscription into bank account // Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None")); $arraychoices = array('0'=>$langs->trans("None"));
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect");
} }
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
$arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly");
} }
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
$arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice");
} }
print '<td>'; print '<td>';
@ -258,7 +258,7 @@ print "</tr>\n";
// Use vat for invoice creation // Use vat for invoice creation
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td>'; print '<td>';
print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0); print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print '</td>'; print '</td>';
@ -269,7 +269,7 @@ if (isModEnabled('facture')) {
} }
print "</tr>\n"; print "</tr>\n";
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
print '<td>'; print '<td>';
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);

View File

@ -1773,7 +1773,7 @@ class Adherent extends CommonObject
if (!$error) { if (!$error) {
// Add line to draft invoice // Add line to draft invoice
$idprodsubscription = 0; $idprodsubscription = 0;
if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (isModEnabled("product") || isModEnabled("service"))) {
$idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS; $idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS;
} }
@ -1865,10 +1865,10 @@ class Adherent extends CommonObject
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
$lang_id = GETPOST('lang_id'); $lang_id = GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($lang_id)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && !empty($lang_id)) {
$newlang = $lang_id; $newlang = $lang_id;
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $customer->default_lang; $newlang = $customer->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
} }
@ -229,7 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') {
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>'; print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
// Bank line // Bank line
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) { if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">'; print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
if ($object->fk_bank) { if ($object->fk_bank) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
@ -270,7 +270,7 @@ if ($rowid && $action != 'edit') {
//$formquestion=array(); //$formquestion=array();
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>'; //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text = $langs->trans("ConfirmDeleteSubscription"); $text = $langs->trans("ConfirmDeleteSubscription");
if (!empty($conf->banque->enabled) && !empty($conf->global->ADHERENT_BANK_USE)) { if (isModEnabled("banque") && !empty($conf->global->ADHERENT_BANK_USE)) {
$text .= '<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); $text .= '<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
} }
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1);
@ -325,7 +325,7 @@ if ($rowid && $action != 'edit') {
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
// Bank line // Bank line
if (!empty($conf->banque->enabled) && ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)) { if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">'; print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
if ($object->fk_bank) { if ($object->fk_bank) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);

View File

@ -507,7 +507,7 @@ print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>"; print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled)) { if (empty($conf->facture->enabled)) {
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0"; $sql .= " WHERE clos = 0";

View File

@ -186,12 +186,12 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '') . "\n";
print getTitleFieldOfList("Value", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print getTitleFieldOfList("Value", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print getTitleFieldOfList("Comment", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print getTitleFieldOfList("Comment", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n";
if (!empty($conf->multicompany->enabled) && !$user->entity) { if (isModEnabled('multicompany') && !$user->entity) {
print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n";
} }
print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
print "</tr>\n"; print "</tr>\n";
@ -212,14 +212,14 @@ print '</td>';
print '<td>'; print '<td>';
print '</td>'; print '</td>';
// Limit to superadmin // Limit to superadmin
if (!empty($conf->multicompany->enabled) && !$user->entity) { if (isModEnabled('multicompany') && !$user->entity) {
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">'; print '<input type="text" class="flat" size="1" name="entity" value="' . $conf->entity . '">';
print '</td>'; print '</td>';
print '<td class="center">'; print '<td class="center">';
} else { } else {
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="' . $conf->entity . '">';
} }
print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">'; print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">';
print "</td>\n"; print "</td>\n";
@ -281,7 +281,7 @@ if ($result) {
print '</td>'; print '</td>';
// Entity limit to superadmin // Entity limit to superadmin
if (!empty($conf->multicompany->enabled) && !$user->entity) { if (isModEnabled('multicompany') && !$user->entity) {
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.((int) $obj->entity).'">'; print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.((int) $obj->entity).'">';
print '</td>'; print '</td>';

View File

@ -185,13 +185,13 @@ $message .= ajax_autoselect('webdavpublicurl');
$message .= '<br>'; $message .= '<br>';
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) { if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : ''); $urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>'; $url = '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '')); $message .= img_picto('', 'globe') . ' ' . str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
$message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'">'; $message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '">';
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">'; $message .= '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">';
$message .= ' '.img_picto('', 'globe'); $message .= ' ' . img_picto('', 'globe');
$message .= '</a>'; $message .= '</a>';
$message .= '</div>'; $message .= '</div>';
$message .= ajax_autoselect('webdavurl'); $message .= ajax_autoselect('webdavurl');

View File

@ -306,7 +306,7 @@ if ($mode != 'focus' && $mode != 'mandatory') {
print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder); print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder);
} }
// Entity // Entity
if (!empty($conf->multicompany->enabled) && !$user->entity) { if (isModEnabled('multicompany') && !$user->entity) {
print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder);
} else { } else {
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
@ -335,13 +335,13 @@ if ($mode != 'focus' && $mode != 'mandatory') {
print '</td>'; print '</td>';
} }
// Limit to superadmin // Limit to superadmin
if (!empty($conf->multicompany->enabled) && !$user->entity) { if (isModEnabled('multicompany') && !$user->entity) {
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity print '<input type="text" class="flat" size="1" disabled name="entity" value="' . $conf->entity . '">'; // We see environment, but to change it we must switch on other entity
print '</td>'; print '</td>';
} else { } else {
print '<td class="center">'; print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="' . $conf->entity . '">';
print '</td>'; print '</td>';
} }
print '<td class="center">'; print '<td class="center">';

View File

@ -172,7 +172,7 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
if ($action == 'update') { if ($action == 'update') {
foreach ($modules as $module => $delays) { foreach ($modules as $module => $delays) {
if (!empty($conf->$module->enabled)) { if (isModEnabled('module')) {
foreach ($delays as $delay) { foreach ($delays as $delay) {
if (GETPOST($delay['code']) != '') { if (GETPOST($delay['code']) != '') {
dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity);
@ -226,13 +226,13 @@ if ($action == 'edit') {
print '<td class="right">'.$langs->trans("LateWarningAfter").'</td></tr>'; print '<td class="right">'.$langs->trans("LateWarningAfter").'</td></tr>';
foreach ($modules as $module => $delays) { foreach ($modules as $module => $delays) {
if (!empty($conf->$module->enabled)) { if (isModEnabled('module')) {
foreach ($delays as $delay) { foreach ($delays as $delay) {
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0); $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="20px">'.img_object('', $delay['img']).'</td>'; print '<td width="20px">' . img_object('', $delay['img']) . '</td>';
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td class="nowraponall right">'; print '<td>' . $langs->trans('Delays_' . $delay['code']) . '</td><td class="nowraponall right">';
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>'; print '<input class="right maxwidth75" type="number" name="' . $delay['code'] . '" value="' . $value . '"> ' . $langs->trans("days") . '</td></tr>';
} }
} }
} }
@ -260,13 +260,13 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="right">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
foreach ($modules as $module => $delays) { foreach ($modules as $module => $delays) {
if (!empty($conf->$module->enabled)) { if (isModEnabled('module')) {
foreach ($delays as $delay) { foreach ($delays as $delay) {
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0); $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="20px">'.img_object('', $delay['img']).'</td>'; print '<td width="20px">' . img_object('', $delay['img']) . '</td>';
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td>'; print '<td>' . $langs->trans('Delays_' . $delay['code']) . '</td>';
print '<td class="right">'.$value.' '.$langs->trans("days").'</td></tr>'; print '<td class="right">' . $value . ' ' . $langs->trans("days") . '</td></tr>';
} }
} }
} }

View File

@ -483,33 +483,33 @@ $tabrowid[44] = "rowid";
// Condition to show dictionary in setup page // Condition to show dictionary in setup page
$tabcond = array(); $tabcond = array();
$tabcond[1] = (!empty($conf->societe->enabled)); $tabcond[1] = (isModEnabled("societe"));
$tabcond[2] = true; $tabcond[2] = true;
$tabcond[3] = true; $tabcond[3] = true;
$tabcond[4] = true; $tabcond[4] = true;
$tabcond[5] = (!empty($conf->societe->enabled) || !empty($conf->adherent->enabled)); $tabcond[5] = (isModEnabled("societe") || !empty($conf->adherent->enabled));
$tabcond[6] = isModEnabled('agenda'); $tabcond[6] = isModEnabled('agenda');
$tabcond[7] = !empty($conf->tax->enabled); $tabcond[7] = !empty($conf->tax->enabled);
$tabcond[8] = !empty($conf->societe->enabled); $tabcond[8] = isModEnabled("societe");
$tabcond[9] = true; $tabcond[9] = true;
$tabcond[10] = true; $tabcond[10] = true;
$tabcond[11] = (!empty($conf->societe->enabled)); $tabcond[11] = (isModEnabled("societe"));
$tabcond[12] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || isModEnabled('facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled)); $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) || !empty($conf->propal->enabled) || isModEnabled('facture') || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled) || !empty($conf->supplier_order->enabled)); $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[14] = (!empty($conf->product->enabled) && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
$tabcond[15] = true; $tabcond[15] = true;
$tabcond[16] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)); $tabcond[16] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS));
$tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled)); $tabcond[17] = (!empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled));
$tabcond[18] = !empty($conf->expedition->enabled) || !empty($conf->reception->enabled); $tabcond[18] = isModEnabled("expedition") || isModEnabled("reception");
$tabcond[19] = !empty($conf->societe->enabled); $tabcond[19] = isModEnabled("societe");
$tabcond[20] = (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled); $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order");
$tabcond[21] = !empty($conf->propal->enabled); $tabcond[21] = isModEnabled("propal");
$tabcond[22] = (!empty($conf->commande->enabled) || !empty($conf->propal->enabled)); $tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal"));
$tabcond[23] = true; $tabcond[23] = true;
$tabcond[24] = !empty($conf->resource->enabled); $tabcond[24] = !empty($conf->resource->enabled);
$tabcond[25] = !empty($conf->website->enabled); $tabcond[25] = !empty($conf->website->enabled);
//$tabcond[26]= !empty($conf->product->enabled); //$tabcond[26]= isModEnabled("product");
$tabcond[27] = !empty($conf->societe->enabled); $tabcond[27] = isModEnabled("societe");
$tabcond[28] = !empty($conf->holiday->enabled); $tabcond[28] = !empty($conf->holiday->enabled);
$tabcond[29] = !empty($conf->project->enabled); $tabcond[29] = !empty($conf->project->enabled);
$tabcond[30] = !empty($conf->label->enabled); $tabcond[30] = !empty($conf->label->enabled);
@ -519,13 +519,13 @@ $tabcond[33] = !empty($conf->hrm->enabled);
$tabcond[34] = !empty($conf->hrm->enabled); $tabcond[34] = !empty($conf->hrm->enabled);
$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $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[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[37] = !empty($conf->product->enabled); $tabcond[37] = isModEnabled("product");
$tabcond[38] = !empty($conf->socialnetworks->enabled); $tabcond[38] = !empty($conf->socialnetworks->enabled);
$tabcond[39] = (!empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[40] = (!empty($conf->societe->enabled) && !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] = !empty($conf->intracommreport->enabled);
$tabcond[42] = !empty($conf->product->enabled); $tabcond[42] = isModEnabled("product");
$tabcond[43] = !empty($conf->product->enabled) && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
$tabcond[44] = !empty($conf->asset->enabled); $tabcond[44] = !empty($conf->asset->enabled);
// List of help for fields (no more used, help is defined into tabcomplete) // List of help for fields (no more used, help is defined into tabcomplete)

View File

@ -37,7 +37,7 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
if (!$user->admin) { if (!$user->admin) {
accessforbidden(); accessforbidden();
} }
if (empty($conf->emailcollector->enabled)) { if (!isModEnabled('emailcollector')) {
accessforbidden(); accessforbidden();
} }
@ -547,20 +547,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</tr>'; print '</tr>';
$arrayoftypes = array( $arrayoftypes = array(
'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), 'loadthirdparty' => $langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), 'loadandcreatethirdparty' => $langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
'recordjoinpiece'=>'AttachJoinedDocumentsToObject', 'recordjoinpiece' => 'AttachJoinedDocumentsToObject',
'recordevent'=>'RecordEvent'); 'recordevent' => 'RecordEvent'
);
$arrayoftypesnocondition = $arrayoftypes; $arrayoftypesnocondition = $arrayoftypes;
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$arrayoftypes['project'] = 'CreateLeadAndThirdParty'; $arrayoftypes['project'] = 'CreateLeadAndThirdParty';
} }
$arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty'; $arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty';
if (!empty($conf->ticket->enabled)) { if (isModEnabled('ticket')) {
$arrayoftypes['ticket'] = 'CreateTicketAndThirdParty'; $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty';
} }
$arrayoftypesnocondition['ticket'] = 'CreateTicketAndThirdParty'; $arrayoftypesnocondition['ticket'] = 'CreateTicketAndThirdParty';
if (!empty($conf->recruitment->enabled)) { if (isModEnabled('recruitment')) {
$arrayoftypes['candidature'] = 'CreateCandidature'; $arrayoftypes['candidature'] = 'CreateCandidature';
} }
$arrayoftypesnocondition['candidature'] = 'CreateCandidature'; $arrayoftypesnocondition['candidature'] = 'CreateCandidature';

View File

@ -278,7 +278,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -148,7 +148,7 @@ if ($action == 'updateMask') {
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
$res3 = 0; $res3 = 0;
if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
} }
@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">'; print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('ProjectIsRequiredOnExpenseReports'); print $langs->trans('ProjectIsRequiredOnExpenseReports');
print '</td><td class="right">'; print '</td><td class="right">';

View File

@ -62,11 +62,11 @@ $conditions = array(
'NOTE_PUBLIC' => 1, 'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1, 'NOTE_PRIVATE' => 1,
'SOCIETE' => 1, 'SOCIETE' => 1,
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)), 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")),
'DETAILS' => (isModEnabled('facture') || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), '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")),
'USERSIGN' => 1, 'USERSIGN' => 1,
'MAILING' => !empty($conf->mailing->enabled), 'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (isModEnabled('facture') || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)), 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled)),
'TICKET' => !empty($conf->ticket->enabled), 'TICKET' => !empty($conf->ticket->enabled),
); );
// Picto // Picto

View File

@ -492,14 +492,14 @@ if ($action == 'edit') {
print '</td><td>'; print '</td><td>';
if ($val['type'] == 'textarea') { if ($val['type'] == 'textarea') {
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n"; print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
print $conf->global->{$constname}; print $conf->global->{$constname};
print "</textarea>\n"; print "</textarea>\n";
} elseif ($val['type']== 'integer') { } elseif ($val['type'] == 'integer') {
print '<input class="flat" name="'.$constname.'" id="'.$constname.'" value="'.$conf->global->$constname.'" type="number" step="1" min="0" max="50" >' . "\n"; print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . $conf->global->$constname . '" type="number" step="1" min="0" max="50" >' . "\n";
} elseif ($val['type']== 'html') { } elseif ($val['type'] == 'html') {
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
$doleditor->Create(); $doleditor->Create();
} elseif ($val['type'] == 'yesno') { } elseif ($val['type'] == 'yesno') {
print $form->selectyesno($constname, $conf->global->{$constname}, 1); print $form->selectyesno($constname, $conf->global->{$constname}, 1);
@ -532,25 +532,25 @@ if ($action == 'edit') {
print img_picto('', 'category', 'class="pictofixedwidth"'); print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
} elseif (preg_match('/thirdparty_type/', $val['type'])) { } elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
} elseif ($val['type'] == 'securekey') { } elseif ($val['type'] == 'securekey') {
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">'; print '<input required="required" type="text" class="flat" id="' . $constname . '" name="' . $constname . '" value="' . (GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : $conf->global->{$constname}) . '" size="40">';
if (!empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); print '&nbsp;' . img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token' . $constname . '" class="linkobject"');
} }
// Add button to autosuggest a key // Add button to autosuggest a key
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled('product') || isModEnabled('service')) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }
} else { } else {
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">'; print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . $conf->global->{$constname} . '">';
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -208,12 +208,12 @@ if ($action == 'edit') {
print '</td><td>'; print '</td><td>';
if ($val['type'] == 'textarea') { if ($val['type'] == 'textarea') {
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n"; print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
print $conf->global->{$constname}; print $conf->global->{$constname};
print "</textarea>\n"; print "</textarea>\n";
} elseif ($val['type']== 'html') { } elseif ($val['type'] == 'html') {
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
$doleditor->Create(); $doleditor->Create();
} elseif ($val['type'] == 'yesno') { } elseif ($val['type'] == 'yesno') {
print $form->selectyesno($constname, $conf->global->{$constname}, 1); print $form->selectyesno($constname, $conf->global->{$constname}, 1);

View File

@ -158,24 +158,24 @@ if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && empty($conf->global->LDAP_USER
print '</td></tr>'; print '</td></tr>';
// Synchro contact active // Synchro contact active
if (!empty($conf->societe->enabled)) { if (isModEnabled('societe')) {
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR)); print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR));
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>'; print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnContactActiveExample") . '</span></td></tr>';
} }
// Synchro member active // Synchro member active
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>'; print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberActive") . '</td><td>';
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2);
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>'; print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberActiveExample") . '</span></td></tr>';
} }
// Synchro member type active // Synchro member type active
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberTypeActive").'</td><td>'; print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberTypeActive") . '</td><td>';
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2);
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>'; print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberTypeActiveExample") . '</span></td></tr>';
} }
// Fields from hook // Fields from hook

View File

@ -36,7 +36,7 @@ if (!$user->admin) {
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$currencycode = GETPOST('currencycode', 'alpha'); $currencycode = GETPOST('currencycode', 'alpha');
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
// When MULTICURRENCY_USE_LIMIT_BY_CURRENCY is on, we use always a defined currency code instead of '' even for default. // When MULTICURRENCY_USE_LIMIT_BY_CURRENCY is on, we use always a defined currency code instead of '' even for default.
$currencycode = (!empty($currencycode) ? $currencycode : $conf->currency); $currencycode = (!empty($currencycode) ? $currencycode : $conf->currency);
} }
@ -105,12 +105,12 @@ print load_fiche_titre($title, '', 'title_setup');
$aCurrencies = array($conf->currency); // Default currency always first position $aCurrencies = array($conf->currency); // Default currency always first position
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/multicurrency.lib.php';
$sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency"; $sql = "SELECT rowid, code FROM " . MAIN_DB_PREFIX . "multicurrency";
$sql .= " WHERE entity = ".((int) $conf->entity); $sql .= " WHERE entity = " . ((int) $conf->entity);
$sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position $sql .= " AND code <> '" . $db->escape($conf->currency) . "'"; // Default currency always first position
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
while ($obj = $db->fetch_object($resql)) { while ($obj = $db->fetch_object($resql)) {
@ -129,11 +129,11 @@ print '<span class="opacitymedium">'.$langs->trans("LimitsDesc")."</span><br>\n"
print "<br>\n"; print "<br>\n";
if ($action == 'edit') { if ($action == 'edit') {
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
print '<input type="hidden" name="currencycode" value="'.$currencycode.'">'; print '<input type="hidden" name="currencycode" value="' . $currencycode . '">';
} }
clearstatcache(); clearstatcache();
@ -194,7 +194,7 @@ if ($action == 'edit') {
print '</div>'; print '</div>';
} }
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
if (!empty($aCurrencies) && count($aCurrencies) > 1) { if (!empty($aCurrencies) && count($aCurrencies) > 1) {
print dol_get_fiche_end(); print dol_get_fiche_end();
} }

View File

@ -26,7 +26,7 @@ require '../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
} }
@ -76,7 +76,7 @@ if ($action == 'update') {
llxHeader(); llxHeader();
$form = new Form($db); $form = new Form($db);
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
} }
@ -100,14 +100,14 @@ foreach ($list as $key) {
// Param // Param
$label = $langs->trans($key); $label = $langs->trans($key);
print '<td><label for="'.$key.'">'.$label.'</label></td>'; print '<td><label for="' . $key . '">' . $label . '</label></td>';
// Value // Value
print '<td>'; print '<td>';
if (!empty($conf->accounting->enabled)) { if (isModEnabled('accounting')) {
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
} else { } else {
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">'; print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . getDolGlobalString($key) . '">';
} }
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -294,16 +294,16 @@ if ($action == 'edit') {
} }
print '</td><td>'; print '</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">'; print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">';
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>'; print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>';
} else { } else {
$text = !empty($mainserver) ? $mainserver : $smtpserver; $text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">';
} }
print '</td>'; print '</td>';
} }
@ -326,15 +326,15 @@ if ($action == 'edit') {
} }
print '</td><td>'; print '</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">'; print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">';
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>'; print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
} else { } else {
$text = (!empty($mainport) ? $mainport : $smtpport); $text = (!empty($mainport) ? $mainport : $smtpport);
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">'; print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">';
} }
} }
print '</td></tr>'; print '</td></tr>';
@ -342,14 +342,14 @@ if ($action == 'edit') {
// ID // ID
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
$mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : '');
print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'; print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">'; print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">';
} else { } else {
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -357,14 +357,14 @@ if ($action == 'edit') {
// PW // PW
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
$mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : ''); $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : '');
print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'; print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>';
// SuperAdministrator access only // SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">'; print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">';
} else { } else {
$htmltext = $langs->trans("ContactSuperAdminForChange"); $htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin');
print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">'; print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">';
} }
print '</td></tr>'; print '</td></tr>';
} }
@ -533,16 +533,16 @@ if ($action == 'edit') {
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) {
if (function_exists('fsockopen') && $port && $server) { if (function_exists('fsockopen') && $port && $server) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>';
} }
} else { } else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>';
} }
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>'; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&amp;mode=init">' . $langs->trans("DoTestSend") . '</a>';
if (!empty($conf->fckeditor->enabled)) { if (isModEnabled('fckeditor')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&amp;mode=init">'.$langs->trans("DoTestSendHTML").'</a>'; print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&amp;mode=init">' . $langs->trans("DoTestSendHTML") . '</a>';
} }
} }

View File

@ -185,13 +185,13 @@ if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) {
if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) {
$elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures'));
} }
if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { if (isModEnabled("societe") && !empty($user->rights->societe->lire)) {
$elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty')); $elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty'));
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject')); $elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
} }
if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) { if (isModEnabled("propal") && !empty($user->rights->propal->lire)) {
$elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); $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 (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
@ -200,10 +200,10 @@ if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) {
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
$elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice')); $elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice'));
} }
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
$elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment')); $elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment'));
} }
if (!empty($conf->reception->enabled)) { if (isModEnabled("reception")) {
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception'));
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
@ -212,10 +212,10 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->supplier_proposal->enabled)) {
$elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation'));
} }
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire))) { 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))) {
$elementList['order_supplier_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierOrder')); $elementList['order_supplier_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierOrder'));
} }
if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { 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')); $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 (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) {

View File

@ -177,7 +177,7 @@ print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_set
print '<span class="opacitymedium">'; print '<span class="opacitymedium">';
print $langs->trans("NotificationsDesc").'<br>'; print $langs->trans("NotificationsDesc").'<br>';
print $langs->trans("NotificationsDescUser").'<br>'; print $langs->trans("NotificationsDescUser").'<br>';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
print $langs->trans("NotificationsDescContact").'<br>'; print $langs->trans("NotificationsDescContact").'<br>';
} }
print $langs->trans("NotificationsDescGlobal").'<br>'; print $langs->trans("NotificationsDescGlobal").'<br>';
@ -361,7 +361,7 @@ print $form->buttonsSaveCancel("Save", '');
print '<div class="opacitymedium">'; print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>'; print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>'; print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
} }
print '</div>'; print '</div>';
@ -384,7 +384,7 @@ print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
print '<div class="info">'; print '<div class="info">';
print $langs->trans("Note").':<br>'; print $langs->trans("Note").':<br>';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>'; print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>'; print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
} }
print '</div>'; print '</div>';

View File

@ -525,7 +525,7 @@ print '<tr class="oddeven">';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>"; print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>"; print "<td>";
if (empty($conf->facture->enabled)) { if (empty($conf->facture->enabled)) {
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql .= " WHERE clos = 0"; $sql .= " WHERE clos = 0";

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* *
@ -47,9 +47,6 @@ $allow_disable_encryption = true;
if ($action == 'setgeneraterule') { if ($action == 'setgeneraterule') {
if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) { if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) {
dol_print_error($db); dol_print_error($db);
} else {
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} }
} }
@ -94,8 +91,6 @@ if ($action == 'activate_encrypt') {
//exit; //exit;
if (!$error) { if (!$error) {
$db->commit(); $db->commit();
header("Location: security.php");
exit;
} else { } else {
$db->rollback(); $db->rollback();
dol_print_error($db, ''); dol_print_error($db, '');
@ -106,8 +101,6 @@ if ($action == 'activate_encrypt') {
if ($allow_disable_encryption) { if ($allow_disable_encryption) {
dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity); dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
} }
header("Location: security.php");
exit;
} }
if ($action == 'activate_encryptdbpassconf') { if ($action == 'activate_encryptdbpassconf') {
@ -138,12 +131,8 @@ if ($action == 'activate_encryptdbpassconf') {
if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') { if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity);
header("Location: security.php");
exit;
} elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') { } elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity); dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity);
header("Location: security.php");
exit;
} }
if ($action == 'updatepattern') { if ($action == 'updatepattern') {
@ -387,9 +376,9 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
// Cryptage mot de passe // Cryptage mot de passe
print '<br>'; print '<br>';
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">"; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print "<input type=\"hidden\" name=\"action\" value=\"encrypt\">"; print '<input type="hidden" name="action" value="encrypt">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -408,7 +397,7 @@ if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
print '</td>'; print '</td>';
if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) { if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
print '<td align="center" width="100">'; print '<td align="center" width="100">';
print '<a href="security.php?action=activate_encrypt">'.$langs->trans("Activate").'</a>'; print '<a class="reposition" href="security.php?action=activate_encrypt&token='.newToken().'">'.$langs->trans("Activate").'</a>';
print "</td>"; print "</td>";
} }
@ -418,7 +407,7 @@ if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
if ($allow_disable_encryption) { if ($allow_disable_encryption) {
//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
//Do not allow "disable encryption" as passwords cannot be decrypted //Do not allow "disable encryption" as passwords cannot be decrypted
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_encrypt&token='.newToken().'">'.$langs->trans("Disable").'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encrypt&token='.newToken().'">'.$langs->trans("Disable").'</a>';
} else { } else {
print '-'; print '-';
} }
@ -444,10 +433,10 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
print img_warning($langs->trans("WarningPassIsEmpty")); print img_warning($langs->trans("WarningPassIsEmpty"));
} else { } else {
if (empty($dolibarr_main_db_encrypted_pass)) { if (empty($dolibarr_main_db_encrypted_pass)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Activate").'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Activate").'</a>';
} }
if (!empty($dolibarr_main_db_encrypted_pass)) { if (!empty($dolibarr_main_db_encrypted_pass)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Disable").'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Disable").'</a>';
} }
} }
print "</td>"; print "</td>";
@ -467,12 +456,12 @@ if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
print '</td>'; print '</td>';
if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
print '<td align="center" width="100">'; print '<td align="center" width="100">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Activate").'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Activate").'</a>';
print "</td>"; print "</td>";
} }
if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) { if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
print '<td align="center" width="100">'; print '<td align="center" width="100">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>';
print "</td>"; print "</td>";
} }
print "</td>"; print "</td>";

View File

@ -200,10 +200,10 @@ print '</tr>';
print '</table>'; print '</table>';
print dol_get_fiche_end();
print $form->buttonsSaveCancel("Modify", ''); print $form->buttonsSaveCancel("Modify", '');
print dol_get_fiche_end();
print '</form>'; print '</form>';
// End of page // End of page

View File

@ -245,7 +245,7 @@ $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnShipment").'</td>'; print '<td>'.$langs->trans("DeStockOnShipment").'</td>';
print '<td class="right">'; print '<td class="right">';
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -262,7 +262,7 @@ $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>'; print '<td>'.$langs->trans("DeStockOnShipmentOnClosing").'</td>';
print '<td class="right">'; print '<td class="right">';
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -293,7 +293,7 @@ $found = 0;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ReStockOnBill").'</td>'; print '<td>'.$langs->trans("ReStockOnBill").'</td>';
print '<td class="right">'; print '<td class="right">';
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -311,7 +311,7 @@ $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>'; print '<td>'.$langs->trans("ReStockOnValidateOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -324,7 +324,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
$found++; $found++;
if (!empty($conf->reception->enabled)) { if (isModEnabled("reception")) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockOnReception").'</td>'; print '<td>'.$langs->trans("StockOnReception").'</td>';
print '<td class="right">'; print '<td class="right">';
@ -356,7 +356,7 @@ if (!empty($conf->reception->enabled)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>'; print '<td>'.$langs->trans("ReStockOnDispatchOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -422,7 +422,7 @@ if (!empty($conf->order->enabled)) {
print "</tr>\n"; print "</tr>\n";
} }
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
print '<td class="right">'; print '<td class="right">';

View File

@ -343,7 +343,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }

View File

@ -62,7 +62,7 @@ $workflowcodes = array(
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
'family'=>'create', 'family'=>'create',
'position'=>10, 'position'=>10,
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
@ -84,14 +84,14 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
'family'=>'classify_proposal', 'family'=>'classify_proposal',
'position'=>30, 'position'=>30,
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)),
'picto'=>'propal', 'picto'=>'propal',
'warning'=>'' 'warning'=>''
), ),
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array( 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array(
'family'=>'classify_proposal', 'family'=>'classify_proposal',
'position'=>31, 'position'=>31,
'enabled'=>(!empty($conf->propal->enabled) && isModEnabled('facture')), 'enabled'=>(isModEnabled("propal") && isModEnabled('facture')),
'picto'=>'propal', 'picto'=>'propal',
'warning'=>'' 'warning'=>''
), ),
@ -100,13 +100,13 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>40, 'position'=>40,
'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>41, 'position'=>41,
'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
@ -123,7 +123,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array( 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
'family'=>'classify_supplier_proposal', 'family'=>'classify_supplier_proposal',
'position'=>60, 'position'=>60,
'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
'picto'=>'supplier_proposal', 'picto'=>'supplier_proposal',
'warning'=>'' 'warning'=>''
), ),
@ -132,7 +132,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
'family'=>'classify_supplier_order', 'family'=>'classify_supplier_order',
'position'=>63, 'position'=>63,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order', 'picto'=>'supplier_order',
'warning'=>'' 'warning'=>''
), ),
@ -140,7 +140,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array( 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
'family'=>'classify_supplier_order', 'family'=>'classify_supplier_order',
'position'=>64, 'position'=>64,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))), 'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (isModEnabled("reception")) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order', 'picto'=>'supplier_order',
'warning'=>'' 'warning'=>''
), ),
@ -148,7 +148,7 @@ $workflowcodes = array(
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
'family'=>'classify_supplier_order', 'family'=>'classify_supplier_order',
'position'=>65, 'position'=>65,
'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), 'enabled'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
'picto'=>'supplier_order', 'picto'=>'supplier_order',
'warning'=>'' 'warning'=>''
), ),
@ -157,7 +157,7 @@ $workflowcodes = array(
'WORKFLOW_BILL_ON_RECEPTION'=>array( 'WORKFLOW_BILL_ON_RECEPTION'=>array(
'family'=>'classify_reception', 'family'=>'classify_reception',
'position'=>80, 'position'=>80,
'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))), 'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
'picto'=>'reception' 'picto'=>'reception'
), ),
@ -165,7 +165,7 @@ $workflowcodes = array(
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array( 'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
'family' => 'classify_shipping', 'family' => 'classify_shipping',
'position' => 90, 'position' => 90,
'enabled' => !empty($conf->expedition->enabled) && !empty($conf->facture->enabled), 'enabled' => isModEnabled("expedition") && isModEnabled("facture"),
'picto' => 'shipment' 'picto' => 'shipment'
), ),

View File

@ -160,8 +160,8 @@ class DolibarrApi
unset($object->statuts_short); unset($object->statuts_short);
unset($object->statuts_logo); unset($object->statuts_logo);
unset($object->statuts_long); unset($object->statuts_long);
unset($object->labelStatus); //unset($object->labelStatus);
unset($object->labelStatusShort); //unset($object->labelStatusShort);
unset($object->stats_propale); unset($object->stats_propale);
unset($object->stats_commande); unset($object->stats_commande);

View File

@ -524,7 +524,7 @@ if ($action == 'edit') {
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
} elseif ($val['type'] == 'product') { } elseif ($val['type'] == 'product') {
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
$form->select_produits($selected, $constname, '', 0); $form->select_produits($selected, $constname, '', 0);
} }

View File

@ -1171,10 +1171,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref; global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $this->thirdparty->default_lang; $newlang = $this->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1234,10 +1234,10 @@ class Asset extends CommonObject
global $hidedetails, $hidedesc, $hideref; global $hidedetails, $hidedesc, $hideref;
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $this->thirdparty->default_lang; $newlang = $this->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -151,7 +151,7 @@ class BlockedLog
} }
/* Supplier /* Supplier
if (!empty($conf->fournisseur->enabled)) { 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_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['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done
@ -184,7 +184,7 @@ class BlockedLog
$this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY';
$this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE';
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE';
$this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY';
$this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE';

View File

@ -87,7 +87,7 @@ $coldisplay++;
print '<td class="bordertop nobottom linecoldescription minwidth500imp">'; print '<td class="bordertop nobottom linecoldescription minwidth500imp">';
// Predefined product/service // Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (isModEnabled("product") || isModEnabled("service")) {
if (!empty($conf->global->BOM_SUB_BOM)) { if (!empty($conf->global->BOM_SUB_BOM)) {
print $langs->trans("Product"); print $langs->trans("Product");
} }

View File

@ -67,7 +67,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
* View * View
*/ */
$help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías'; $help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías|DE:Modul_Kategorien';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
llxHeader('', $langs->trans("Categories"), $help_url); llxHeader('', $langs->trans("Categories"), $help_url);

View File

@ -63,7 +63,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
$textobject = $langs->transnoentitiesnoconv("Categories"); $textobject = $langs->transnoentitiesnoconv("Categories");
$help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías'; $help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías|DE:Modul_Kategorien';
llxHeader('', $langs->trans("Categories"), $help_url); llxHeader('', $langs->trans("Categories"), $help_url);

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file htdocs/product/traduction.php * \file htdocs/categories/traduction.php
* \ingroup product * \ingroup categories
* \brief Page of translation of products * \brief Page of translation of categories
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('categories', 'languages')); $langs->loadLangs(array('categories', 'languages'));
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$label = GETPOST('label', 'alpha'); $label = GETPOST('label', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
@ -56,21 +56,23 @@ if ($result <= 0) {
$type = $object->type; $type = $object->type;
if (is_numeric($type)) { if (is_numeric($type)) {
$type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
} }
/* /*
* Actions * Actions
*/ */
$error = 0; $error = 0;
// retour a l'affichage des traduction si annulation // return to translation view if cancelled
if ($cancel == $langs->trans("Cancel")) { if ($cancel == $langs->trans("Cancel")) {
$action = ''; $action = '';
} }
// Validation de l'ajout // validation of addition
if ($action == 'vadd' && if ($action == 'vadd' &&
$cancel != $langs->trans("Cancel") && $cancel != $langs->trans("Cancel") &&
($user->rights->categorie->creer)) { ($user->rights->categorie->creer)) {
@ -94,7 +96,7 @@ $cancel != $langs->trans("Cancel") &&
} }
if (!$error) { if (!$error) {
// update de l'objet // update the object
if ($forcelangprod == $current_lang) { if ($forcelangprod == $current_lang) {
$object->label = $libelle; $object->label = $libelle;
$object->description = dol_htmlcleanlastbr($desc); $object->description = dol_htmlcleanlastbr($desc);
@ -103,7 +105,7 @@ $cancel != $langs->trans("Cancel") &&
$object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc); $object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr($desc);
} }
// sauvegarde en base // save in base / sauvegarde en base
$res = $object->setMultiLangs($user); $res = $object->setMultiLangs($user);
if ($res < 0) { if ($res < 0) {
$error++; $error++;
@ -119,14 +121,14 @@ $cancel != $langs->trans("Cancel") &&
} }
} }
// Validation de l'edition // validation of the edition
if ($action == 'vedit' && if ($action == 'vedit' &&
$cancel != $langs->trans("Cancel") && $cancel != $langs->trans("Cancel") &&
($user->rights->categorie->creer)) { ($user->rights->categorie->creer)) {
$object->fetch($id); $object->fetch($id);
$current_lang = $langs->getDefaultLang(); $current_lang = $langs->getDefaultLang();
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet foreach ($object->multilangs as $key => $value) { // recording of new values in the object
$libelle = GETPOST('libelle-'.$key, 'alpha'); $libelle = GETPOST('libelle-'.$key, 'alpha');
$desc = GETPOST('desc-'.$key); $desc = GETPOST('desc-'.$key);
@ -164,7 +166,7 @@ $cancel != $langs->trans("Cancel") &&
* View * View
*/ */
$form = new Form($db); $form = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formother = new FormOther($db); $formother = new FormOther($db);
@ -223,10 +225,10 @@ print dol_get_fiche_end();
/* /*
* Action bar * Action bar
*/ */
print "\n<div class=\"tabsAction\">\n"; print "\n<div class=\"tabsAction\">\n";
if ($action == '') { if ($action == '') {
@ -243,7 +245,7 @@ print "\n</div>\n";
if ($action == 'edit') { if ($action == 'edit') {
//WYSIWYG Editor // WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -260,6 +262,7 @@ if ($action == 'edit') {
// Label // Label
$libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']); $libelle = (GETPOST('libelle-'.$key, 'alpha') ? GETPOST('libelle-'.$key, 'alpha') : $object->multilangs[$key]['label']);
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$libelle.'"></td></tr>'; print '<tr><td class="titlefield fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$libelle.'"></td></tr>';
// Desc // Desc
$desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']);
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';

View File

@ -538,7 +538,7 @@ if (empty($reshook) && $action == 'add') {
$error++; $error++;
} }
// End date // End date
$repeateventlimitdate = dol_mktime('23', '59', '59', GETPOSTISSET("limitmonth") ? GETPOST("limitmonth", 'int') : 01, GETPOSTISSET("limitday", 'int') ? GETPOST("limitday", 'int') : 01, GETPOSTISSET("limityear", 'int') && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuser'); $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOST("limitmonth", 'int') : 1, GETPOSTISSET("limitday") ? GETPOST("limitday", 'int') : 1, GETPOSTISSET("limityear") && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuser');
// Set date of end of event // Set date of end of event
$deltatime = num_between_day($object->datep, $datep); $deltatime = num_between_day($object->datep, $datep);
$datef = dol_time_plus_duree($datef, $deltatime, 'd'); $datef = dol_time_plus_duree($datef, $deltatime, 'd');
@ -1378,7 +1378,7 @@ if ($action == 'create') {
print '<table class="border centpercent">'; print '<table class="border centpercent">';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
// Related company // Related company
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ActionOnCompany").'</td><td>'; print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ActionOnCompany").'</td><td>';
if (GETPOST('socid', 'int') > 0) { if (GETPOST('socid', 'int') > 0) {
@ -1891,7 +1891,7 @@ if ($id > 0) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
// Related company // Related company
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>'; print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
print '<td>'; print '<td>';
@ -2300,7 +2300,7 @@ if ($id > 0) {
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
// Related company // Related company
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : ('<span class="opacitymedium">'.$langs->trans("None").'</span>')); print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : ('<span class="opacitymedium">'.$langs->trans("None").'</span>'));
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') { if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') {

View File

@ -129,19 +129,19 @@ class AgendaEvents extends DolibarrApi
} }
$sql = "SELECT t.id as rowid"; $sql = "SELECT t.id as rowid";
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
} }
} }
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as t"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as t";
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
} }
} }
$sql .= ' WHERE t.entity IN ('.getEntity('agenda').')'; $sql .= ' WHERE t.entity IN ('.getEntity('agenda').')';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) { if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) {
$sql .= " AND t.fk_soc = sc.fk_soc"; $sql .= " AND t.fk_soc = sc.fk_soc";
} }

View File

@ -204,16 +204,16 @@ class CActionComm
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) { if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) { if ($obj->module == 'invoice_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) { if ($obj->module == 'order_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) { if ($obj->module == 'shipping' && isModEnabled("expedition") && !empty($user->rights->expedition->lire)) {
$qualified = 1; $qualified = 1;
} }
// For case module = 'myobject@eventorganization' // For case module = 'myobject@eventorganization'

View File

@ -44,13 +44,13 @@ if (isModEnabled('facture')) {
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
} }
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->commande->enabled)) { if (!empty($conf->commande->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
} }
if (!empty($conf->contrat->enabled)) { if (!empty($conf->contrat->enabled)) {
@ -72,7 +72,7 @@ if (!empty($conf->contrat->enabled)) {
if (!empty($conf->commande->enabled)) { if (!empty($conf->commande->enabled)) {
$langs->load("orders"); $langs->load("orders");
} }
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
$langs->load("sendings"); $langs->load("sendings");
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -438,7 +438,7 @@ if ($object->id > 0) {
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Compte bancaire par défaut // Compte bancaire par défaut
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
@ -697,7 +697,7 @@ if ($object->id > 0) {
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">'; $boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">'; $boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
// Box proposals // Box proposals
$tmp = $object->getOutstandingProposals(); $tmp = $object->getOutstandingProposals();
$outstandingOpened = $tmp['opened']; $outstandingOpened = $tmp['opened'];
@ -818,7 +818,7 @@ if ($object->id > 0) {
/* /*
* Latest proposals * Latest proposals
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$langs->load("propal"); $langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht"; $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
@ -1024,7 +1024,7 @@ if ($object->id > 0) {
/* /*
* Latest shipments * Latest shipments
*/ */
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) { if (isModEnabled("expedition") && $user->rights->expedition->lire) {
$sql = 'SELECT e.rowid as id'; $sql = 'SELECT e.rowid as id';
$sql .= ', e.ref, e.entity'; $sql .= ', e.ref, e.entity';
$sql .= ', e.date_creation'; $sql .= ', e.date_creation';
@ -1548,7 +1548,7 @@ if ($object->id > 0) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>'; print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("ThirdPartyIsClosed").'</a></div>';
} }
if (!empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status == 1) { if (isModEnabled("propal") && $user->rights->propal->creer && $object->status == 1) {
$langs->load("propal"); $langs->load("propal");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
} }

View File

@ -90,7 +90,7 @@ $maxofloop = (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global-
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$companystatic = new Societe($db); $companystatic = new Societe($db);
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
$propalstatic = new Propal($db); $propalstatic = new Propal($db);
} }
if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->supplier_proposal->enabled)) {
@ -99,7 +99,7 @@ if (!empty($conf->supplier_proposal->enabled)) {
if (!empty($conf->commande->enabled)) { if (!empty($conf->commande->enabled)) {
$orderstatic = new Commande($db); $orderstatic = new Commande($db);
} }
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
$supplierorderstatic = new CommandeFournisseur($db); $supplierorderstatic = new CommandeFournisseur($db);
} }
@ -128,7 +128,7 @@ if ($tmp) {
* Draft customer proposals * Draft customer proposals
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql = "SELECT p.rowid, p.ref, p.ref_client, 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.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
@ -421,7 +421,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
* Draft purchase orders * Draft purchase orders
*/ */
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)) {
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status"; $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
@ -592,7 +592,7 @@ print '</div><div class="fichetwothirdright">';
/* /*
* Last modified customers or prospects * Last modified customers or prospects
*/ */
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { if (isModEnabled("societe") && $user->rights->societe->lire) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@ -667,7 +667,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>'; $s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
} }
/* /*
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $obj->fournisseur)
{ {
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>'; $s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
}*/ }*/
@ -698,7 +698,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
/* /*
* Last suppliers * Last suppliers
*/ */
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->societe->lire) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
@ -763,7 +763,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
{ {
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>'; $s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
}*/ }*/
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $obj->fournisseur) {
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>'; $s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
} }
print $s; print $s;
@ -887,7 +887,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
/* /*
* Opened (validated) proposals * Opened (validated) proposals
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -324,8 +324,8 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -624,10 +624,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1750,7 +1750,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) { if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && isModEnabled("banque")) {
print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">'; print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>'; print '</td></tr>';
@ -1773,7 +1773,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Shipping Method // Shipping Method
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) { if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) {
$shipping_method_id = $soc->shipping_method_id; $shipping_method_id = $soc->shipping_method_id;
} }
@ -2434,7 +2434,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Shipping Method // Shipping Method
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding centpercent"><tr><td>'; print '<table class="nobordernopadding centpercent"><tr><td>';
print $langs->trans('SendingMethod'); print $langs->trans('SendingMethod');
@ -2552,7 +2552,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
} }
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) { if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && isModEnabled("banque")) {
// Bank Account // Bank Account
print '<tr><td>'; print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>';
@ -2806,7 +2806,7 @@ if ($action == 'create') {
// Create a purchase order // Create a purchase order
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) { if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) {
if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { if ($object->statut == Propal::STATUS_SIGNED && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order"))) {
if ($usercancreatepurchaseorder) { if ($usercancreatepurchaseorder) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddPurchaseOrder").'</a>';
} }
@ -2814,7 +2814,7 @@ if ($action == 'create') {
} }
// Create an intervention // Create an intervention
if (!empty($conf->service->enabled) && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateintervention) { if ($usercancreateintervention) {
$langs->load("interventions"); $langs->load("interventions");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>';

View File

@ -496,8 +496,12 @@ class Proposals extends DolibarrApi
$request_data = (object) $request_data; $request_data = (object) $request_data;
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml'); if (isset($request_data->desc)) {
$request_data->label = sanitizeVal($request_data->label); $request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
}
if (isset($request_data->label)) {
$request_data->label = sanitizeVal($request_data->label);
}
$propalline = new PropaleLigne($this->db); $propalline = new PropaleLigne($this->db);
$result = $propalline->fetch($lineid); $result = $propalline->fetch($lineid);

View File

@ -76,7 +76,7 @@ if ($tmp) {
/* /*
* Draft proposals * Draft proposals
*/ */
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc"; $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc";
$sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
@ -226,7 +226,7 @@ if ($resql) {
/* /*
* Open (validated) proposals * Open (validated) proposals
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
$sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";

View File

@ -52,7 +52,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
$langs->loadLangs(array('sendings')); $langs->loadLangs(array('sendings'));
} }
@ -218,7 +218,7 @@ $arrayfields = array(
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0), 'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)), 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("expedition")),
'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1), 'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1),
'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0), 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0),
'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),

View File

@ -59,7 +59,7 @@ print load_fiche_titre($langs->trans("ProspectionArea"));
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
$var = false; $var = false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/card.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/card.php">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
@ -118,7 +118,7 @@ if ($resql) {
/* /*
* Liste des propal brouillons * Liste des propal brouillons
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."societe as s";
@ -176,7 +176,7 @@ if (isModEnabled('agenda')) {
/* /*
* Dernieres propales ouvertes * Dernieres propales ouvertes
*/ */
if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { if (isModEnabled("propal") && $user->rights->propale->lire) {
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,";
$sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";

View File

@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -220,10 +220,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -583,7 +583,7 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha'); $newlang = GETPOST('lang_id', 'alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1142,10 +1142,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1310,10 +1310,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1783,7 +1783,7 @@ if ($action == 'create' && $usercancreate) {
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) { if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>'; print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>'; print '</td></tr>';
@ -2581,7 +2581,7 @@ if ($action == 'create' && $usercancreate) {
} }
// Bank Account // Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) { if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && isModEnabled("banque")) {
print '<tr><td>'; print '<tr><td>';
$editenable = $usercancreate; $editenable = $usercancreate;
print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable); print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable);
@ -2768,7 +2768,7 @@ if ($action == 'create' && $usercancreate) {
// Create a purchase order // Create a purchase order
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) { if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_SALE_ORDER)) {
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
if ($usercancreatepurchaseorder) { if ($usercancreatepurchaseorder) {
print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, ''); print dolGetButtonAction('', $langs->trans('AddPurchaseOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid, '');
} }

View File

@ -3710,7 +3710,7 @@ class Commande extends CommonOrder
$result = ''; $result = '';
if (!empty($conf->expedition->enabled) && ($option == '1' || $option == '2')) { if (isModEnabled("expedition") && ($option == '1' || $option == '2')) {
$url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
} else { } else {
$url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id;

View File

@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products')); $langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products'));
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha'); $massaction = GETPOST('massaction', 'alpha');
@ -70,6 +70,7 @@ $search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_start_mo
$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int')); $search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int'));
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int')); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int'));
$search_product_category = GETPOST('search_product_category', 'int'); $search_product_category = GETPOST('search_product_category', 'int');
$search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
@ -77,22 +78,25 @@ $search_company = GETPOST('search_company', 'alpha');
$search_company_alias = GETPOST('search_company_alias', 'alpha'); $search_company_alias = GETPOST('search_company_alias', 'alpha');
$search_town = GETPOST('search_town', 'alpha'); $search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state", 'alpha'); $search_state = GETPOST('search_state', 'alpha');
$search_country = GETPOST("search_country", 'int'); $search_country = GETPOST('search_country', 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); $search_type_thirdparty = GETPOST('search_type_thirdparty', 'int');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
$search_user = GETPOST('search_user', 'int'); $search_user = GETPOST('search_user', 'int');
$search_sale = GETPOST('search_sale', '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_vat = GETPOST('search_total_vat', 'alpha');
$search_total_ttc = GETPOST('search_total_ttc', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha');
$search_warehouse = GETPOST('search_warehouse', 'int'); $search_warehouse = GETPOST('search_warehouse', 'int');
$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha'); $search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha'); $search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha'); $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha'); $search_login = GETPOST('search_login', 'alpha');
$search_categ_cus = GETPOST("search_categ_cus", 'int'); $search_categ_cus = GETPOST("search_categ_cus", 'int');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
@ -103,10 +107,11 @@ $search_remove_btn = GETPOST('button_removefilter', 'alpha');
$search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project_ref = GETPOST('search_project_ref', 'alpha');
$search_project = GETPOST('search_project', 'alpha'); $search_project = GETPOST('search_project', 'alpha');
$search_shippable = GETPOST('search_shippable', 'aZ09'); $search_shippable = GETPOST('search_shippable', 'aZ09');
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int'); $search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'int');
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int'); $search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int');
$search_fk_input_reason = GETPOST("search_fk_input_reason", 'int'); $search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int');
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int');
// Security check // Security check
$id = (GETPOST('orderid') ?GETPOST('orderid', 'int') : GETPOST('id', 'int')); $id = (GETPOST('orderid') ?GETPOST('orderid', 'int') : GETPOST('id', 'int'));
@ -176,7 +181,7 @@ $arrayfields = array(
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)), 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("expedition")),
'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67),
'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68),
'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69),
@ -199,7 +204,7 @@ $arrayfields = array(
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>990), 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990),
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995),
'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), '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) 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
@ -2394,7 +2399,7 @@ if ($resql) {
} }
$stock_order = $generic_product->stats_commande['qty']; $stock_order = $generic_product->stats_commande['qty'];
} }
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
$generic_product->load_stats_commande_fournisseur(0, '3'); $generic_product->load_stats_commande_fournisseur(0, '3');
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty']; $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
@ -2415,7 +2420,7 @@ if ($resql) {
} else { } else {
$text_info .= '<span class="ok">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>'; $text_info .= '<span class="ok">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
} }
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
$text_info .= '&nbsp;'.$langs->trans('SupplierOrder').'&nbsp;:&nbsp;'.$stock_order_supplier; $text_info .= '&nbsp;'.$langs->trans('SupplierOrder').'&nbsp;:&nbsp;'.$stock_order_supplier;
} }
$text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : ''); $text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : '');

View File

@ -1,9 +1,10 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr> * Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr> * Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr> * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -134,12 +135,12 @@ $error = 0;
$listofchoices = array( $listofchoices = array(
'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)), 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => !empty($user->rights->facture->lire)),
'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->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' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)),
'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)),
'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)), 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => isModEnabled("banque"), 'perms' => !empty($user->rights->banque->lire)),
'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)), 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)),
); );
@ -626,6 +627,7 @@ print '</form>'."\n";
print dol_get_fiche_end(); print dol_get_fiche_end();
$param = '';
if (!empty($date_start) && !empty($date_stop)) { if (!empty($date_start) && !empty($date_stop)) {
$param .= '&date_startday='.GETPOST('date_startday', 'int'); $param .= '&date_startday='.GETPOST('date_startday', 'int');
$param .= '&date_startmonth='.GETPOST('date_startmonth', 'int'); $param .= '&date_startmonth='.GETPOST('date_startmonth', 'int');

View File

@ -6,7 +6,7 @@
* Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com> * Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -1079,7 +1079,7 @@ if ($action == 'create') {
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET('ics') ? GETPOST('ics', 'alphanohtml') : $object->ics).'"></td></tr>'; print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET('ics') ? GETPOST('ics', 'alphanohtml') : $object->ics).'"></td></tr>';
} }
if (!empty(isModEnabled('paymentbybanktransfer'))) { if (isModEnabled('paymentbybanktransfer')) {
print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>'; print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>';
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.(GETPOSTISSET('ics_transfer') ? GETPOST('ics_transfer', 'alphanohtml') : $object->ics_transfer).'"></td></tr>'; print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.(GETPOSTISSET('ics_transfer') ? GETPOST('ics_transfer', 'alphanohtml') : $object->ics_transfer).'"></td></tr>';

View File

@ -423,11 +423,11 @@ class PaymentVarious extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5; return -5;
} }
if (!empty($conf->banque->enabled) && (empty($this->fk_account) || $this->fk_account <= 0)) { if (isModEnabled("banque") && (empty($this->fk_account) || $this->fk_account <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
return -6; return -6;
} }
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) { if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -7; return -7;
} }
@ -481,7 +481,7 @@ class PaymentVarious extends CommonObject
$this->ref = $this->id; $this->ref = $this->id;
if ($this->id > 0) { if ($this->id > 0) {
if (!empty($conf->banque->enabled) && !empty($this->amount)) { if (isModEnabled("banque") && !empty($this->amount)) {
// Insert into llx_bank // Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -139,7 +139,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
$error++; $error++;
} }
if (!empty($conf->banque->enabled) && !$object->accountid > 0) { if (isModEnabled("banque") && !$object->accountid > 0) {
$langs->load('errors'); $langs->load('errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
$error++; $error++;
@ -413,7 +413,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Bank // Bank
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td>'; print '<tr><td>';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
@ -428,7 +428,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Number // Number
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td><label for="num_payment">'.$langs->trans('Numero'); print '<tr><td><label for="num_payment">'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</label></td>'; print '</label></td>';
@ -642,7 +642,7 @@ if ($id) {
print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0); print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0);
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($object->fk_account > 0) { if ($object->fk_account > 0) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank); $bankline->fetch($object->fk_bank);

View File

@ -152,8 +152,8 @@ $arrayfields = array(
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)),
'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)), 'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>!empty($conf->accounting->enabled)),
'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500), 'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500),

View File

@ -146,7 +146,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
} }
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -220,7 +220,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
} }
print $obj->num_payment.'</td>'; print $obj->num_payment.'</td>';
// Account // Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td>'; print '<td>';
if ($obj->fk_bank > 0) { if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank); //$accountstatic->fetch($obj->fk_bank);
@ -254,7 +254,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td></td>'; print '<td></td>';
} }
print '<td class="liste_total right">'.price($totalpaid)."</td>"; print '<td class="liste_total right">'.price($totalpaid)."</td>";
@ -304,7 +304,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
} }
print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder);
@ -341,7 +341,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print $obj->num_payment.'</td>'; print $obj->num_payment.'</td>';
// Account // Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td>'; print '<td>';
if ($obj->fk_bank > 0) { if ($obj->fk_bank > 0) {
//$accountstatic->fetch($obj->fk_bank); //$accountstatic->fetch($obj->fk_bank);

View File

@ -650,8 +650,8 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -857,9 +857,9 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id','aZ09'))
$newlang = GETPOST('lang_id','aZ09'); $newlang = GETPOST('lang_id','aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang))
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
@ -990,8 +990,8 @@ if ($action == 'create') {
$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')';
$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')';
// Only on template invoices // Only on template invoices
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')'; $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), 'dayhour').')';
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')'; $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 2, 'm'), 'dayhour').')';
$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); $substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");

View File

@ -272,10 +272,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id')) {
$newlang = GETPOST('lang_id'); $newlang = GETPOST('lang_id');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -520,10 +520,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -604,10 +604,10 @@ if (empty($reshook)) {
if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($error) && empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -659,10 +659,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -749,10 +749,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -1956,10 +1956,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($object->lines)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -2305,10 +2305,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -2555,10 +2555,10 @@ if (empty($reshook)) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -3688,7 +3688,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print $form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
@ -4588,7 +4588,7 @@ if ($action == 'create') {
} }
// Bank Account // Bank Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">'; print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
print $langs->trans('BankAccount'); print $langs->trans('BankAccount');
@ -4844,7 +4844,7 @@ if ($action == 'create') {
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
$nbrows++; $nbrows++;
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$nbrows++; $nbrows++;
$nbcols++; $nbcols++;
} }
@ -4873,7 +4873,7 @@ if ($action == 'create') {
print '<td>'.$langs->trans('ListOfSituationInvoices').'</td>'; print '<td>'.$langs->trans('ListOfSituationInvoices').'</td>';
print '<td></td>'; print '<td></td>';
print '<td class="center">'.$langs->trans('Situation').'</td>'; print '<td class="center">'.$langs->trans('Situation').'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="right"></td>'; print '<td class="right"></td>';
} }
print '<td class="right">'.$langs->trans('AmountHT').'</td>'; print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@ -4897,7 +4897,7 @@ if ($action == 'create') {
print '<td>'.$prev_invoice->getNomUrl(1).'</td>'; print '<td>'.$prev_invoice->getNomUrl(1).'</td>';
print '<td></td>'; print '<td></td>';
print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.'</td>'; print '<td align="center" >'.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="right"></td>'; print '<td class="right"></td>';
} }
print '<td class="right"><span class="amount">'.price($prev_invoice->total_ht).'</span></td>'; print '<td class="right"><span class="amount">'.price($prev_invoice->total_ht).'</span></td>';
@ -4917,7 +4917,7 @@ if ($action == 'create') {
print '<td>'.$object->getNomUrl(1).'</td>'; print '<td>'.$object->getNomUrl(1).'</td>';
print '<td></td>'; print '<td></td>';
print '<td class="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.'</td>'; print '<td class="center">'.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="right"></td>'; print '<td class="right"></td>';
} }
print '<td class="right"><span class="amount">'.price($object->total_ht).'</span></td>'; print '<td class="right"><span class="amount">'.price($object->total_ht).'</span></td>';
@ -4940,7 +4940,7 @@ if ($action == 'create') {
$i++; $i++;
} }
print '</td>'; print '</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td></td>'; print '<td></td>';
} }
print '<td class="right"><b>'.price($total_global_ht).'</b></td>'; print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -4972,7 +4972,7 @@ if ($action == 'create') {
print '<td>'.$next_invoice->getNomUrl(1).'</td>'; print '<td>'.$next_invoice->getNomUrl(1).'</td>';
print '<td></td>'; print '<td></td>';
print '<td class="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.'</td>'; print '<td class="center">'.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="right"></td>'; print '<td class="right"></td>';
} }
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>'; print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
@ -4986,7 +4986,7 @@ if ($action == 'create') {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="3" class="right"></td>'; print '<td colspan="3" class="right"></td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="right"></td>'; print '<td class="right"></td>';
} }
print '<td class="right"><b>'.price($total_global_ht).'</b></td>'; print '<td class="right"><b>'.price($total_global_ht).'</b></td>';
@ -5013,7 +5013,7 @@ if ($action == 'create') {
print '<td class="liste_titre">'.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>'; print '<td class="liste_titre">'.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>'; print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Date').'</span></td>';
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>'; print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('Type').'</span></td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('BankAccount').'</span></td>'; print '<td class="liste_titre"><span class="hideonsmartphone">'.$langs->trans('BankAccount').'</span></td>';
} }
print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>'; print '<td class="liste_titre right">'.$langs->trans('Amount').'</td>';
@ -5062,7 +5062,7 @@ if ($action == 'create') {
print '</td>'; print '</td>';
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; $label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
print '<td>'.$label.' '.$objp->num_payment.'</td>'; print '<td>'.$label.' '.$objp->num_payment.'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid; $bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref; $bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref; $bankaccountstatic->label = $objp->baref;

View File

@ -1410,7 +1410,7 @@ class Invoices extends DolibarrApi
throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if (empty($accountid)) { if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory'); throw new RestException(400, 'Account ID is mandatory');
} }
@ -1469,7 +1469,7 @@ class Invoices extends DolibarrApi
throw new RestException(400, 'Payment error : '.$paymentobj->error); throw new RestException(400, 'Payment error : '.$paymentobj->error);
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$label = '(CustomerInvoicePayment)'; $label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
@ -1533,7 +1533,7 @@ class Invoices extends DolibarrApi
} }
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if (empty($accountid)) { if (empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory'); throw new RestException(400, 'Account ID is mandatory');
} }
@ -1617,7 +1617,7 @@ class Invoices extends DolibarrApi
$this->db->rollback(); $this->db->rollback();
throw new RestException(400, 'Payment error : '.$paymentobj->error); throw new RestException(400, 'Payment error : '.$paymentobj->error);
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$label = '(CustomerInvoicePayment)'; $label = '(CustomerInvoicePayment)';
if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) {
throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode); throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode);

View File

@ -598,10 +598,10 @@ class Facture extends CommonInvoice
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($this->thirdparty->default_lang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->thirdparty->default_lang)) {
$newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ... $newlang = $this->thirdparty->default_lang; // for proposal, order, invoice, ...
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($this->default_lang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($this->default_lang)) {
$newlang = $this->default_lang; // for thirdparty $newlang = $this->default_lang; // for thirdparty
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -174,7 +174,7 @@ if ($action == 'create') {
// Amount // Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Type payment // Type payment
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx'); $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx');
@ -243,7 +243,7 @@ if ($id) {
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($object->fk_account > 0) { if ($object->fk_account > 0) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$bankline->fetch($object->fk_bank); $bankline->fetch($object->fk_bank);

View File

@ -467,11 +467,11 @@ class Localtax extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4; return -4;
} }
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5; return -5;
} }
if (!empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { if (isModEnabled("banque") && (empty($this->paymenttype) || $this->paymenttype <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -5; return -5;
} }
@ -503,7 +503,7 @@ class Localtax extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax
if ($this->id > 0) { if ($this->id > 0) {
$ok = 1; $ok = 1;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Insertion dans llx_bank // Insertion dans llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -170,7 +170,7 @@ if (empty($reshook)) {
$error++; $error++;
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// If bank module is on, account is required to enter a payment // If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0) { if (GETPOST('accountid') <= 0) {
setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -244,7 +244,7 @@ if (empty($reshook)) {
$multicurrency_code[$key] = $tmpinvoice->multicurrency_code; $multicurrency_code[$key] = $tmpinvoice->multicurrency_code;
} }
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// If the bank module is active, an account is required to input a payment // If the bank module is active, an account is required to input a payment
if (GETPOST('accountid', 'int') <= 0) { if (GETPOST('accountid', 'int') <= 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors');
@ -492,7 +492,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bank account // Bank account
print '<tr>'; print '<tr>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($facture->type != 2) { if ($facture->type != 2) {
print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>'; print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
} }

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
} }
@ -285,7 +285,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, '',
$disable_delete = 0; $disable_delete = 0;
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
if ($object->fk_account > 0) { if ($object->fk_account > 0) {
@ -327,7 +327,7 @@ print '</td></tr>';
*/ */
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($object->fk_account > 0) { if ($object->fk_account > 0) {
if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) {
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';

View File

@ -138,10 +138,10 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->rights->ban
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -189,10 +189,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->banque-
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
@ -231,10 +231,10 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
//if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; //if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) $newlang=$object->client->default_lang;
if (!empty($newlang)) { if (!empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);

View File

@ -8,7 +8,7 @@
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2018 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com> * Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2021 OpenDsi <support@open-dsi.fr> * Copyright (C) 2021 OpenDsi <support@open-dsi.fr>
* *
@ -455,7 +455,7 @@ class Paiement extends CommonObject
$newlang = ''; $newlang = '';
$outputlangs = $langs; $outputlangs = $langs;
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$invoice->fetch_thirdparty(); $invoice->fetch_thirdparty();
$newlang = $invoice->thirdparty->default_lang; $newlang = $invoice->thirdparty->default_lang;
} }
@ -464,8 +464,8 @@ class Paiement extends CommonObject
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0; $hidedetails = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0; $hidedesc = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0; $hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
$ret = $invoice->fetch($facid); // Reload to get new records $ret = $invoice->fetch($facid); // Reload to get new records
@ -628,7 +628,7 @@ class Paiement extends CommonObject
$error = 0; $error = 0;
$bank_line_id = 0; $bank_line_id = 0;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($accountid <= 0) { if ($accountid <= 0) {
$this->error = 'Bad value for parameter accountid='.$accountid; $this->error = 'Bad value for parameter accountid='.$accountid;
dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR); dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR);

View File

@ -104,8 +104,8 @@ $arrayfields = array(
'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), 'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20),
's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40), 'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40),
'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->banque->enabled))), 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("banque"))),
'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(!empty($conf->banque->enabled))), 'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))),
'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), 'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"),
'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), 'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80),
'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))), 'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))),

View File

@ -71,7 +71,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++; $error++;
$action = 'create'; $action = 'create';
} }
if (!empty($conf->banque->enabled) && !(GETPOST("accountid") > 0)) { if (isModEnabled("banque") && !(GETPOST("accountid") > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors');
$error++; $error++;
$action = 'create'; $action = 'create';

View File

@ -69,7 +69,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
$error++; $error++;
$action = 'create'; $action = 'create';
} }
if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) { if (isModEnabled("banque") && !(GETPOST("accountid", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors');
$error++; $error++;
$action = 'create'; $action = 'create';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
} }
@ -141,7 +141,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($object->bank_account) { if ($object->bank_account) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$bankline->fetch($object->bank_line); $bankline->fetch($object->bank_line);

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
} }
@ -194,7 +194,7 @@ print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
if ($object->bank_account) { if ($object->bank_account) {
$bankline = new AccountLine($db); $bankline = new AccountLine($db);
$bankline->fetch($object->bank_line); $bankline->fetch($object->bank_line);

View File

@ -69,12 +69,12 @@ if (!$sortorder) {
// Date range // Date range
$year = GETPOST('year', 'int'); $year = GETPOST('year', 'int');
if (empty($year)) { if (empty($year)) {
$year_current = strftime("%Y", dol_now()); $year_current = dol_print_date(dol_now(), "%Y");
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current; $year_start = $year_current;
} else { } else {
$year_current = $year; $year_current = $year;
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year; $year_start = $year;
} }
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@ -1039,7 +1039,7 @@ if ($modecompta == 'BOOKKEEPING') {
if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') {
$langs->load('trips'); $langs->load('trips');
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, p.total_ht as amount_ht, p.total_ttc as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql .= " WHERE p.entity IN (".getEntity('expensereport').")"; $sql .= " WHERE p.entity IN (".getEntity('expensereport').")";
@ -1047,7 +1047,7 @@ if ($modecompta == 'BOOKKEEPING') {
$column = 'p.date_valid'; $column = 'p.date_valid';
} else { } else {
$sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht, sum(p.total_ttc) as amount_ttc"; $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(pe.amount) as amount_ht, sum(pe.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid";
@ -1127,7 +1127,7 @@ if ($modecompta == 'BOOKKEEPING') {
*/ */
//$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1; //$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1;
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
$subtotal_ht = 0; $subtotal_ht = 0;
$subtotal_ttc = 0; $subtotal_ttc = 0;

View File

@ -47,12 +47,12 @@ $nbofyear = 4;
// Date range // Date range
$year = GETPOST('year', 'int'); $year = GETPOST('year', 'int');
if (empty($year)) { if (empty($year)) {
$year_current = strftime("%Y", dol_now()); $year_current = dol_print_date(dol_now(), "%Y");
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current - ($nbofyear - 1); $year_start = $year_current - ($nbofyear - 1);
} else { } else {
$year_current = $year; $year_current = $year;
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year - ($nbofyear - 1); $year_start = $year - ($nbofyear - 1);
} }
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@ -796,7 +796,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom
* Various Payments * Various Payments
*/ */
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
// decaiss // decaiss
$sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com> /* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2016-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr> * Copyright (C) 2018-2020 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
@ -228,7 +228,7 @@ if ($modecompta == "CREANCES-DETTES") {
$period .= ' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); $period .= ' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink = $textprevyear.$textnextyear; $periodlink = $textprevyear.$textnextyear;
$exportlink = ''; $exportlink = '';
$description = $langs->trans("RulesResultBookkeepingPersonalized"). $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")).')'; $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"); //else $description.= $langs->trans("DepositsAreIncluded");

View File

@ -426,7 +426,7 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
// Bank Account // Bank Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td>'.$langs->trans('DefaultBankAccount').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('DefaultBankAccount').'</td><td colspan="2">';
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1); print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1);
print '</td></tr>'; print '</td></tr>';
@ -638,7 +638,7 @@ if ($id > 0) {
print '</td></tr>'; print '</td></tr>';
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('DefaultBankAccount'); print $langs->trans('DefaultBankAccount');
@ -668,7 +668,7 @@ if ($id > 0) {
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
$nbcols = 3; $nbcols = 3;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$nbcols++; $nbcols++;
} }
@ -703,7 +703,7 @@ if ($id > 0) {
print '<td>'.$langs->trans("RefPayment").'</td>'; print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>'; print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
} }
print '<td class="right">'.$langs->trans("Amount").'</td>'; print '<td class="right">'.$langs->trans("Amount").'</td>';
@ -726,7 +726,7 @@ if ($id > 0) {
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n"; print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n"; print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid; $bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref; $bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref; $bankaccountstatic->label = $objp->baref;

View File

@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject
$error = 0; $error = 0;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db); $acc = new Account($this->db);

View File

@ -107,7 +107,7 @@ $arrayfields = array(
'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110),
); );
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount"); $arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount");
} }

View File

@ -225,7 +225,7 @@ print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
} }
@ -245,7 +245,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
} }
@ -323,7 +323,7 @@ while ($i < min($num, $limit)) {
print '<td>'.$obj->num_payment.'</td>'; print '<td>'.$obj->num_payment.'</td>';
// Account // Account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Bank transaction // Bank transaction
print '<td class="nowraponall">'; print '<td class="nowraponall">';
$accountlinestatic->id = $obj->fk_bank; $accountlinestatic->id = $obj->fk_bank;
@ -379,7 +379,7 @@ print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -54,7 +55,9 @@ if (empty($year)) {
} }
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
// Quarter // Quarter
$q = '';
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
$q = GETPOST("q", "int"); $q = GETPOST("q", "int");
if (empty($q)) { if (empty($q)) {
@ -155,10 +158,12 @@ foreach ($listofparams as $param) {
llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring); llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring);
$exportlink="";
$namelink="";
//print load_fiche_titre($langs->trans("VAT"),""); //print load_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>'; //$fsearch.='<br>';
$fsearch = '';
$fsearch .= ' <input type="hidden" name="year" value="'.$year.'">'; $fsearch .= ' <input type="hidden" name="year" value="'.$year.'">';
$fsearch .= ' <input type="hidden" name="modetax" value="'.$modetax.'">'; $fsearch .= ' <input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
@ -198,14 +203,17 @@ if ($nextquarter < 4) {
$nextquarter = 1; $nextquarter = 1;
$nextyear++; $nextyear++;
} }
$description .= $fsearch; $description = $fsearch;
$builddate = dol_now(); $builddate = dol_now();
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
}
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') { if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') {
$description .= $langs->trans("RulesVATDueProducts"); $description .= '<br>'.$langs->trans("RulesVATDueProducts");
} }
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') { if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') {
$description .= $langs->trans("RulesVATInProducts"); $description .= '<br>'.$langs->trans("RulesVATInProducts");
} }
if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') { if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') {
$description .= '<br>'.$langs->trans("RulesVATDueServices"); $description .= '<br>'.$langs->trans("RulesVATDueServices");
@ -216,9 +224,6 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= '<br>'.$langs->trans("DepositsAreNotIncluded"); $description .= '<br>'.$langs->trans("DepositsAreNotIncluded");
} }
if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) {
$description .= '<br>'.$langs->trans("ThisIsAnEstimatedValue");
}
// Customers invoices // Customers invoices
$elementcust = $langs->trans("CustomersInvoices"); $elementcust = $langs->trans("CustomersInvoices");
@ -229,9 +234,6 @@ $amountcust = $langs->trans("AmountHT");
$elementsup = $langs->trans("SuppliersInvoices"); $elementsup = $langs->trans("SuppliersInvoices");
$productsup = $productcust; $productsup = $productcust;
$amountsup = $amountcust; $amountsup = $amountcust;
$namesup = $namecust;
// TODO Report from bookkeeping not yet available, so we switch on report on business events // TODO Report from bookkeeping not yet available, so we switch on report on business events
if ($modecompta == "BOOKKEEPING") { if ($modecompta == "BOOKKEEPING") {
@ -247,7 +249,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeDebt"); $calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')'; //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$description = $langs->trans("RulesCADue"); $description .= '<br>'.$langs->trans("RulesCADue");
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("DepositsAreNotIncluded"); $description .= $langs->trans("DepositsAreNotIncluded");
} else { } else {
@ -260,7 +262,7 @@ if ($modecompta == "CREANCES-DETTES") {
$calcmode = $langs->trans("CalcModeEngagement"); $calcmode = $langs->trans("CalcModeEngagement");
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')'; //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$description = $langs->trans("RulesCAIn"); $description .= $langs->trans("RulesCAIn");
$description .= $langs->trans("DepositsAreIncluded"); $description .= $langs->trans("DepositsAreIncluded");
$builddate = dol_now(); $builddate = dol_now();

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -186,7 +187,9 @@ if (!empty($year)) {
if (!empty($month)) { if (!empty($month)) {
$headerparams['month'] = $month; $headerparams['month'] = $month;
} }
$headerparams['q'] = $q; if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array(); $tableparams = array();
if (!empty($selected_cat)) { if (!empty($selected_cat)) {
@ -205,6 +208,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams);
$headerparams = array_merge($commonparams, $headerparams); $headerparams = array_merge($commonparams, $headerparams);
$tableparams = array_merge($commonparams, $tableparams); $tableparams = array_merge($commonparams, $tableparams);
$paramslink="";
foreach ($allparams as $key => $value) { foreach ($allparams as $key => $value) {
$paramslink .= '&'.$key.'='.$value; $paramslink .= '&'.$key.'='.$value;
} }
@ -227,6 +231,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES"; $modecompta = "RECETTES-DEPENSES";
} }
$exportlink="";
$namelink="";
// Show report header // Show report header
if ($modecompta == "CREANCES-DETTES") { if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices"); $name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices");

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr> * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -135,23 +136,36 @@ $commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield; $commonparams['sortfield'] = $sortfield;
$headerparams = array(); $headerparams = array();
$headerparams['date_startyear'] = $date_startyear; if (!empty($date_startyear)) {
$headerparams['date_startmonth'] = $date_startmonth; $headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startday'] = $date_startday; }
$headerparams['date_endyear'] = $date_endyear; if (!empty($date_startmonth)) {
$headerparams['date_endmonth'] = $date_endmonth; $headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_endday'] = $date_endday; }
$headerparams['q'] = $q; if (!empty($date_startday)) {
$headerparams['date_startday'] = $date_startday;
}
if (!empty($date_endyear)) {
$headerparams['date_endyear'] = $date_endyear;
}
if (!empty($date_endmonth)) {
$headerparams['date_endmonth'] = $date_endmonth;
}
if (!empty($date_endday)) {
$headerparams['date_endday'] = $date_endday;
}
if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array(); $tableparams = array();
$tableparams['search_categ'] = $selected_cat;
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
// Adding common parameters // Adding common parameters
$allparams = array_merge($commonparams, $headerparams, $tableparams); $allparams = array_merge($commonparams, $headerparams, $tableparams);
$headerparams = array_merge($commonparams, $headerparams); $headerparams = array_merge($commonparams, $headerparams);
$tableparams = array_merge($commonparams, $tableparams); $tableparams = array_merge($commonparams, $tableparams);
$paramslink="";
foreach ($allparams as $key => $value) { foreach ($allparams as $key => $value) {
$paramslink .= '&'.$key.'='.$value; $paramslink .= '&'.$key.'='.$value;
} }
@ -172,6 +186,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
$modecompta = "RECETTES-DEPENSES"; $modecompta = "RECETTES-DEPENSES";
} }
$exportlink="";
$namelink="";
// Show report header // Show report header
if ($modecompta == "CREANCES-DETTES") { if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice"); $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
@ -230,6 +247,8 @@ foreach ($headerparams as $key => $value) {
} }
$catotal = 0; $catotal = 0;
$catotal_ht = 0;
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
@ -245,8 +264,8 @@ if ($modecompta == 'CREANCES-DETTES') {
} }
} elseif ($modecompta == "RECETTES-DEPENSES") { } elseif ($modecompta == "RECETTES-DEPENSES") {
/* /*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * List of payments (old payments are not seen by this query because on older versions,
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) * they were not linked via the table llx_paiement_facture. They are added later)
*/ */
$sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc"; $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
@ -287,7 +306,7 @@ if ($result) {
dol_print_error($db); dol_print_error($db);
} }
// Adding old-version payments, non-bound by "paiement_facture" then without User // Adding old-version payments, non-bound by table llx_paiement_facture then without User
if ($modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'RECETTES-DEPENSES') {
$sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc"; $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
@ -478,7 +497,7 @@ if (count($amount)) {
// Other stats // Other stats
print '<td class="center">'; print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) { if (isModEnabled("propal") && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
} }
if (!empty($conf->commande->enabled) && $key > 0) { if (!empty($conf->commande->enabled) && $key > 0) {

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr> * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -158,13 +159,27 @@ $commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield; $commonparams['sortfield'] = $sortfield;
$headerparams = array(); $headerparams = array();
$headerparams['date_startyear'] = $date_startyear; if (!empty($date_startyear)) {
$headerparams['date_startmonth'] = $date_startmonth; $headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startday'] = $date_startday; }
$headerparams['date_endyear'] = $date_endyear; if (!empty($date_startmonth)) {
$headerparams['date_endmonth'] = $date_endmonth; $headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_endday'] = $date_endday; }
$headerparams['q'] = $q; if (!empty($date_startday)) {
$headerparams['date_startday'] = $date_startday;
}
if (!empty($date_endyear)) {
$headerparams['date_endyear'] = $date_endyear;
}
if (!empty($date_endmonth)) {
$headerparams['date_endmonth'] = $date_endmonth;
}
if (!empty($date_endday)) {
$headerparams['date_endday'] = $date_endday;
}
if (!empty($q)) {
$headerparams['q'] = $q;
}
$tableparams = array(); $tableparams = array();
$tableparams['search_categ'] = $selected_cat; $tableparams['search_categ'] = $selected_cat;
@ -250,8 +265,10 @@ $name = array();
// Show Array // Show Array
$catotal = 0; $catotal = 0;
$catotal_ht = 0;
if ($modecompta == 'CREANCES-DETTES') { if ($modecompta == 'CREANCES-DETTES') {
$sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,"; $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,";
$sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; $sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
if ($selected_cat === -2) { // Without any category if ($selected_cat === -2) { // Without any category
@ -281,10 +298,10 @@ if ($modecompta == 'CREANCES-DETTES') {
} }
} elseif ($modecompta == "RECETTES-DEPENSES") { } elseif ($modecompta == "RECETTES-DEPENSES") {
/* /*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * List of payments (old payments are not seen by this query because on older versions,
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) * they were not linked via the table llx_paiement_facture. They are added later)
*/ */
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc"; $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql .= ", ".MAIN_DB_PREFIX."paiement_facture as pf";
$sql .= ", ".MAIN_DB_PREFIX."paiement as p"; $sql .= ", ".MAIN_DB_PREFIX."paiement as p";
@ -329,7 +346,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) { if ($socid) {
$sql .= " AND f.fk_soc = ".((int) $socid); $sql .= " AND f.fk_soc = ".((int) $socid);
} }
$sql .= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays"; $sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.zip, s.town, s.fk_pays";
$sql .= " ORDER BY s.rowid"; $sql .= " ORDER BY s.rowid";
//echo $sql; //echo $sql;
@ -344,7 +361,11 @@ if ($result) {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$amount_ht[$obj->socid] = $obj->amount; $amount_ht[$obj->socid] = $obj->amount;
$amount[$obj->socid] = $obj->amount_ttc; $amount[$obj->socid] = $obj->amount_ttc;
$name[$obj->socid] = $obj->name.' '.$obj->firstname; $fullname = $obj->name;
if (!empty($obj->name_alias)) {
$fullname .= ' ('.$obj->name_alias.')';
}
$name[$obj->socid] = $fullname;
$address_zip[$obj->socid] = $obj->zip; $address_zip[$obj->socid] = $obj->zip;
$address_town[$obj->socid] = $obj->town; $address_town[$obj->socid] = $obj->town;
$address_pays[$obj->socid] = getCountry($obj->fk_pays); $address_pays[$obj->socid] = getCountry($obj->fk_pays);
@ -356,7 +377,7 @@ if ($result) {
dol_print_error($db); dol_print_error($db);
} }
// On ajoute les paiements anciennes version, non lies par paiement_facture // We add the old versions of payments, not linked by table llx_paiement_facture
if ($modecompta == "RECETTES-DEPENSES") { if ($modecompta == "RECETTES-DEPENSES") {
$sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc"; $sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
@ -409,7 +430,7 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
// Category filter // Category filter
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'; print '<td class="nowraponall">';
print img_picto('', 'category', 'class="paddingrightonly"'); print img_picto('', 'category', 'class="paddingrightonly"');
print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
print ' '; print ' ';
@ -435,7 +456,7 @@ print '<td class="liste_titre left">';
print '<input class="flat" size="6" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">'; print '<input class="flat" size="6" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre left">'; print '<td class="liste_titre left">';
print $form->select_country($search_country, 'search_country'); print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
//print '<input class="flat" size="6" type="text" name="search_country" value="'.$search_country.'">'; //print '<input class="flat" size="6" type="text" name="search_country" value="'.$search_country.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
@ -652,7 +673,7 @@ if (count($amount)) {
// Other stats // Other stats
print '<td class="center">'; print '<td class="center">';
if (!empty($conf->propal->enabled) && $key > 0) { if (isModEnabled("propal") && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
} }
if (!empty($conf->commande->enabled) && $key > 0) { if (!empty($conf->commande->enabled) && $key > 0) {

View File

@ -69,6 +69,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$month_end = $month_start - 1; $month_end = $month_start - 1;
if ($month_end < 1) { if ($month_end < 1) {
$month_end = 12; $month_end = 12;
} else {
$year_end++;
} }
} else { } else {
$month_end = $month_start; $month_end = $month_start;

View File

@ -39,12 +39,12 @@ $nbofyear = 4;
// Date range // Date range
$year = GETPOST('year', 'int'); $year = GETPOST('year', 'int');
if (empty($year)) { if (empty($year)) {
$year_current = strftime("%Y", dol_now()); $year_current = dol_print_date(dol_now(), "%Y");
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year_current - ($nbofyear - 1); $year_start = $year_current - ($nbofyear - 1);
} else { } else {
$year_current = $year; $year_current = $year;
$month_current = strftime("%m", dol_now()); $month_current = dol_print_date(dol_now(), "%m");
$year_start = $year - ($nbofyear - 1); $year_start = $year - ($nbofyear - 1);
} }
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
@ -56,7 +56,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
if ($q == 0) { if ($q == 0) {
// We define date_start and date_end // We define date_start and date_end
$year_end = $year_start + ($nbofyear - 1); $year_end = $year_start + ($nbofyear - 1);
$month_start = GETPOST("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
if (!GETPOST('month')) { if (!GETPOST('month')) {
if (!GETPOST("year") && $month_start > $month_current) { if (!GETPOST("year") && $month_start > $month_current) {
$year_start--; $year_start--;
@ -65,6 +65,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$month_end = $month_start - 1; $month_end = $month_start - 1;
if ($month_end < 1) { if ($month_end < 1) {
$month_end = 12; $month_end = 12;
} else {
$year_end++;
} }
} else { } else {
$month_end = $month_start; $month_end = $month_start;

View File

@ -590,10 +590,10 @@ if (count($amount)) {
if (!empty($conf->supplier_proposal->enabled) && $key > 0) { if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
} }
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && $key > 0) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
} }
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) && $key > 0) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) && $key > 0) {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
} }
print '</td>'; print '</td>';

View File

@ -494,7 +494,7 @@ if ($action == 'create') {
print "</td>\n"; print "</td>\n";
print "</tr>"; print "</tr>";
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Bank account // Bank account
print '<tr><td class="fieldrequired" id="label_fk_account">'.$langs->trans("BankAccount").'</td><td>'; print '<tr><td class="fieldrequired" id="label_fk_account">'.$langs->trans("BankAccount").'</td><td>';
print img_picto('', 'bank_account', 'pictofixedwidth'); print img_picto('', 'bank_account', 'pictofixedwidth');
@ -629,7 +629,7 @@ if ($id > 0) {
print '</td></tr>'; print '</td></tr>';
// Bank account // Bank account
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount'); print $langs->trans('BankAccount');
@ -660,7 +660,7 @@ if ($id > 0) {
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
$nbcols = 3; $nbcols = 3;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$nbcols++; $nbcols++;
} }
@ -695,7 +695,7 @@ if ($id > 0) {
print '<td>'.$langs->trans("RefPayment").'</td>'; print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.$langs->trans("Type").'</td>'; print '<td>'.$langs->trans("Type").'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>'; print '<td class="liste_titre right">'.$langs->trans('BankAccount').'</td>';
} }
print '<td class="right">'.$langs->trans("Amount").'</td>'; print '<td class="right">'.$langs->trans("Amount").'</td>';
@ -712,7 +712,7 @@ if ($id > 0) {
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n"; print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
$labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
print "<td>".$labeltype.' '.$objp->num_payment."</td>\n"; print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid; $bankaccountstatic->id = $objp->baid;
$bankaccountstatic->ref = $objp->baref; $bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref; $bankaccountstatic->label = $objp->baref;

View File

@ -560,7 +560,7 @@ class PaymentVAT extends CommonObject
$error = 0; $error = 0;
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db); $acc = new Account($this->db);

View File

@ -572,11 +572,11 @@ class Tva extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -4; return -4;
} }
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -5; return -5;
} }
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) { if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
return -5; return -5;
} }
@ -633,7 +633,7 @@ class Tva extends CommonObject
if ($this->id > 0) { if ($this->id > 0) {
$ok = 1; $ok = 1;
if (!empty($conf->banque->enabled) && !empty($this->amount)) { if (isModEnabled("banque") && !empty($this->amount)) {
// Insert into llx_bank // Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -83,7 +83,7 @@ $arrayfields = array(
't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"),
); );
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
$arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount");
} }

View File

@ -129,7 +129,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber');
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder);
} }
@ -221,7 +221,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
// Chq number // Chq number
print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>'; print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
// Bank transaction // Bank transaction
print '<td>'; print '<td>';
$accountlinestatic->id = $obj->fk_bank; $accountlinestatic->id = $obj->fk_bank;
@ -258,7 +258,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
print '<td class="liste_total right"></td>'; // A total here has no sense print '<td class="liste_total right"></td>'; // A total here has no sense
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
if (!empty($conf->banque->enabled)) { if (isModEnabled("banque")) {
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
print '<td align="center" class="liste_total">&nbsp;</td>'; print '<td align="center" class="liste_total">&nbsp;</td>';
} }

View File

@ -196,7 +196,7 @@ abstract class ActionsContactCardCommon
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder");
$i++; $i++;
} }
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal");
$i++; $i++;

View File

@ -1228,7 +1228,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal ? $object->ref_propal : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyProposal").'</span>'); print $object->ref_propal ? $object->ref_propal : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyProposal").'</span>');
print '</td></tr>'; print '</td></tr>';
@ -1326,7 +1326,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
//array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External')))
); );
$text = $langs->trans("ConfirmCreateContact").'<br>'; $text = $langs->trans("ConfirmCreateContact").'<br>';
if (!empty($conf->societe->enabled)) { if (isModEnabled("societe")) {
if ($object->socid > 0) { if ($object->socid > 0) {
$text .= $langs->trans("UserWillBeExternalUser"); $text .= $langs->trans("UserWillBeExternalUser");
} else { } else {
@ -1489,22 +1489,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->load_ref_elements(); $object->load_ref_elements();
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
print '<tr><td class="titlefield">'.$langs->trans("ContactForProposals").'</td><td colspan="3">'; print '<tr><td class="titlefield">'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal"); print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal");
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->commande->enabled) || !empty($conf->expedition->enabled)) { if (!empty($conf->commande->enabled) || isModEnabled("expedition")) {
print '<tr><td>'; print '<tr><td>';
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
print $langs->trans("ContactForOrdersOrShipments"); print $langs->trans("ContactForOrdersOrShipments");
} else { } else {
print $langs->trans("ContactForOrders"); print $langs->trans("ContactForOrders");
} }
print '</td><td colspan="3">'; print '</td><td colspan="3">';
$none = $langs->trans("NoContactForAnyOrder"); $none = $langs->trans("NoContactForAnyOrder");
if (!empty($conf->expedition->enabled)) { if (isModEnabled("expedition")) {
$none = $langs->trans("NoContactForAnyOrderOrShipments"); $none = $langs->trans("NoContactForAnyOrderOrShipments");
} }
print $object->ref_commande ? $object->ref_commande : $none; print $object->ref_commande ? $object->ref_commande : $none;

View File

@ -154,7 +154,7 @@ print '</td></tr>';
if ($object->thirdparty->client) { if ($object->thirdparty->client) {
$thirdTypeArray['customer'] = $langs->trans("customer"); $thirdTypeArray['customer'] = $langs->trans("customer");
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->rights->propal->lire) {
$elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals');
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
@ -174,15 +174,15 @@ if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
if ($object->thirdparty->fournisseur) { if ($object->thirdparty->fournisseur) {
$thirdTypeArray['supplier'] = $langs->trans("supplier"); $thirdTypeArray['supplier'] = $langs->trans("supplier");
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled("supplier_invoice") && $user->rights->supplier_invoice->lire)) {
$elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices'); $elementTypeArray['supplier_invoice'] = $langs->transnoentitiesnoconv('SuppliersInvoices');
} }
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)) {
$elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders'); $elementTypeArray['supplier_order'] = $langs->transnoentitiesnoconv('SuppliersOrders');
} }
// There no contact type for supplier proposals // There no contact type for supplier proposals
// if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); // if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
} }
print '</table>'; print '</table>';

View File

@ -753,7 +753,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->fournisseur->enabled) && (empty($type) || $type == 'f')) { if (isModEnabled("fournisseur") && (empty($type) || $type == 'f')) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('SuppliersCategoriesShort'); $tmptitle = $langs->trans('SuppliersCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');

View File

@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (!empty($conf->propal->enabled)) { if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
} }
if (!empty($conf->project->enabled)) { if (!empty($conf->project->enabled)) {
@ -577,10 +577,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && !empty($conf->global->CONTRACT_ADDON_PDF)) { // No generation if default type not defined
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -754,10 +754,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -366,10 +366,10 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -442,10 +442,10 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -486,10 +486,10 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) { if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

View File

@ -34,10 +34,10 @@ if ($action == 'up' && $permissiontoedit) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {
@ -59,10 +59,10 @@ if ($action == 'down' && $permissiontoedit) {
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09'); $newlang = GETPOST('lang_id', 'aZ09');
} }
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang; $newlang = $object->thirdparty->default_lang;
} }
if (!empty($newlang)) { if (!empty($newlang)) {

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