Merge remote-tracking branch 'upstream/develop' into pr/grandoc/22009

This commit is contained in:
Frédéric FRANCE 2022-09-02 11:44:45 +02:00
commit 9150f5102e
407 changed files with 2779 additions and 2105 deletions

View File

@ -632,7 +632,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;

View File

@ -24,6 +24,7 @@ fi
if [ "x$1" = "xfix" ] if [ "x$1" = "xfix" ]
then then
find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \;
find ./htdocs/install/ -type d -exec chmod ug+rw {} \;
chmod a+x ./scripts/*/*.php chmod a+x ./scripts/*/*.php
chmod a+x ./scripts/*/*.sh chmod a+x ./scripts/*/*.sh
chmod g-w ./scripts/*/*.php chmod g-w ./scripts/*/*.php

View File

@ -97,6 +97,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('accountancyadminaccount'));
/* /*
* Actions * Actions
@ -109,8 +112,8 @@ if (!GETPOST('confirmmassaction', 'alpha')) {
$massaction = ''; $massaction = '';
} }
$parameters = array(); $parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been monowraponalldified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $accounting, $action); // Note that $action and $object may have been monowraponalldified by some hooks
if ($reshook < 0) { if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
} }
@ -398,6 +401,11 @@ if ($resql) {
print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button button-edit" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">'; print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button button-edit" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<br>'; print '<br>';
$parameters = array('chartofaccounts' => $chartofaccounts, 'permissiontoadd' => $permissiontoadd, 'permissiontodelete' => $permissiontodelete);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $accounting, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<br>'; print '<br>';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;

View File

@ -167,10 +167,30 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print $enabledisablehtml; print $enabledisablehtml;
print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC) ? 0 : 1).'">'; print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC) ? 0 : 1).'">';
print '<br><br>';
print '<br>';
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
if (isModEnabled('multicompany')) {
$entity_qr = '?entity='.$conf->entity;
} else {
$entity_qr = '';
}
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
print '<br>'; print '<br>';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
@ -248,29 +268,6 @@ print dol_get_fiche_end();
print '</form>'; print '</form>';
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans('BlankSubscriptionForm').'</span><br>';
if (isModEnabled('multicompany')) {
$entity_qr = '?entity='.$conf->entity;
} else {
$entity_qr = '';
}
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
}
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -2061,7 +2061,7 @@ class Adherent extends CommonObject
$err = 0; $err = 0;
// mailman // mailman
if (!empty($conf->global->ADHERENT_USE_MAILMAN) && !empty($conf->mailmanspip->enabled)) { if (!empty($conf->global->ADHERENT_USE_MAILMAN) && isModEnabled('mailmanspip')) {
$result = $mailmanspip->add_to_mailman($this); $result = $mailmanspip->add_to_mailman($this);
if ($result < 0) { if ($result < 0) {
@ -2081,7 +2081,7 @@ class Adherent extends CommonObject
} }
// spip // spip
if (!empty($conf->global->ADHERENT_USE_SPIP) && !empty($conf->mailmanspip->enabled)) { if (!empty($conf->global->ADHERENT_USE_SPIP) && isModEnabled('mailmanspip')) {
$result = $mailmanspip->add_to_spip($this); $result = $mailmanspip->add_to_spip($this);
if ($result < 0) { if ($result < 0) {
$this->errors[] = $mailmanspip->error; $this->errors[] = $mailmanspip->error;
@ -2132,7 +2132,7 @@ class Adherent extends CommonObject
} }
} }
if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) { if ($conf->global->ADHERENT_USE_SPIP && isModEnabled('mailmanspip')) {
$result = $mailmanspip->del_to_spip($this); $result = $mailmanspip->del_to_spip($this);
if ($result < 0) { if ($result < 0) {
$this->errors[] = $mailmanspip->error; $this->errors[] = $mailmanspip->error;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2022 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
* 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
@ -184,7 +185,7 @@ if (!empty($triggers)) {
} }
//print 'module='.$module.' code='.$trigger['code'].'<br>'; //print 'module='.$module.' code='.$trigger['code'].'<br>';
if (isModEnabled('module')) { if (isModEnabled($module)) {
// Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED // Discard special case: If option FICHINTER_CLASSIFY_BILLED is not set, we discard both trigger FICHINTER_CLASSIFY_BILLED and FICHINTER_CLASSIFY_UNBILLED
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
continue; continue;

View File

@ -0,0 +1,118 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file admin/bankline_extrafields.php
* \ingroup bank
* \brief Page to setup extra fields of bankline
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "companies", "bills", "other", "banks"));
$extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$tmptype2label = ExtraFields::$type2label;
$type2label = [];
foreach ($tmptype2label as $key => $val) {
$type2label[$key] = $langs->transnoentitiesnoconv($val);
}
$action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'bank'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) {
accessforbidden();
}
/*
* Actions
*/
require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
/*
* View
*/
$help_url = '';
$page_name = "BankSetupModule";
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
$head = bank_admin_prepare_head(null);
print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}
/*
* Creation of an optional field
*/
if ($action == 'create') {
print '<br><div id="newattrib"></div>';
print load_fiche_titre($langs->trans('NewAttribute'));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/*
* Edition of an optional field
*/
if ($action == 'edit' && !empty($attrname)) {
print "<br>";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
llxFooter();
$db->close();

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com> * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2022 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
* 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
@ -172,7 +173,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 (isModEnabled('module')) { 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,7 +227,7 @@ 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 (isModEnabled('module')) { 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">';
@ -260,7 +261,7 @@ 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 (isModEnabled('module')) { 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">';
@ -319,16 +320,20 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE
$cursor = 10; // By default $cursor = 10; // By default
//if (!empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; //if (!empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET;
//if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; //if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP;
$level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) { $level0 = $offset;
if (!empty($conf->global->MAIN_METEO_LEVEL0)) {
$level0 = $conf->global->MAIN_METEO_LEVEL0; $level0 = $conf->global->MAIN_METEO_LEVEL0;
} }
$level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) { $level1 = $offset + 1 * $cursor;
if (!empty($conf->global->MAIN_METEO_LEVEL1)) {
$level1 = $conf->global->MAIN_METEO_LEVEL1; $level1 = $conf->global->MAIN_METEO_LEVEL1;
} }
$level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) { $level2 = $offset + 2 * $cursor;
if (!empty($conf->global->MAIN_METEO_LEVEL2)) {
$level2 = $conf->global->MAIN_METEO_LEVEL2; $level2 = $conf->global->MAIN_METEO_LEVEL2;
} }
$level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) { $level3 = $offset + 3 * $cursor;
if (!empty($conf->global->MAIN_METEO_LEVEL3)) {
$level3 = $conf->global->MAIN_METEO_LEVEL3; $level3 = $conf->global->MAIN_METEO_LEVEL3;
} }
$text = ''; $options = 'class="valignmiddle" height="60px"'; $text = ''; $options = 'class="valignmiddle" height="60px"';

View File

@ -11,7 +11,7 @@
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020-2022 Open-Dsi <support@open-dsi.fr> * Copyright (C) 2020-2022 Open-Dsi <support@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
@ -487,45 +487,45 @@ $tabcond[1] = (isModEnabled("societe"));
$tabcond[2] = true; $tabcond[2] = true;
$tabcond[3] = true; $tabcond[3] = true;
$tabcond[4] = true; $tabcond[4] = true;
$tabcond[5] = (isModEnabled("societe") || !empty($conf->adherent->enabled)); $tabcond[5] = (isModEnabled("societe") || isModEnabled('adherent'));
$tabcond[6] = isModEnabled('agenda'); $tabcond[6] = isModEnabled('agenda');
$tabcond[7] = !empty($conf->tax->enabled); $tabcond[7] = isModEnabled('tax');
$tabcond[8] = isModEnabled("societe"); $tabcond[8] = isModEnabled("societe");
$tabcond[9] = true; $tabcond[9] = true;
$tabcond[10] = true; $tabcond[10] = true;
$tabcond[11] = (isModEnabled("societe")); $tabcond[11] = (isModEnabled("societe"));
$tabcond[12] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[12] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order"));
$tabcond[13] = (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order")); $tabcond[13] = (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice") || isModEnabled("supplier_order"));
$tabcond[14] = (isModEnabled("product") && (!empty($conf->ecotax->enabled) || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY))); $tabcond[14] = (isModEnabled("product") && (isModEnabled('ecotax') || !empty($conf->global->MAIN_SHOW_ECOTAX_DICTIONNARY)));
$tabcond[15] = true; $tabcond[15] = true;
$tabcond[16] = (isModEnabled("societe") && 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] = (isModEnabled('deplacement') || isModEnabled('expensereport'));
$tabcond[18] = isModEnabled("expedition") || isModEnabled("reception"); $tabcond[18] = isModEnabled("expedition") || isModEnabled("reception");
$tabcond[19] = isModEnabled("societe"); $tabcond[19] = isModEnabled("societe");
$tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order"); $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order");
$tabcond[21] = isModEnabled("propal"); $tabcond[21] = isModEnabled("propal");
$tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal")); $tabcond[22] = (isModEnabled('commande') || isModEnabled("propal"));
$tabcond[23] = true; $tabcond[23] = true;
$tabcond[24] = !empty($conf->resource->enabled); $tabcond[24] = isModEnabled('resource');
$tabcond[25] = !empty($conf->website->enabled); $tabcond[25] = isModEnabled('website');
//$tabcond[26]= isModEnabled("product"); //$tabcond[26]= isModEnabled("product");
$tabcond[27] = isModEnabled("societe"); $tabcond[27] = isModEnabled("societe");
$tabcond[28] = !empty($conf->holiday->enabled); $tabcond[28] = isModEnabled('holiday');
$tabcond[29] = isModEnabled('project'); $tabcond[29] = isModEnabled('project');
$tabcond[30] = !empty($conf->label->enabled); $tabcond[30] = isModEnabled('label');
//$tabcond[31]= !empty($conf->accounting->enabled); //$tabcond[31]= !empty($conf->accounting->enabled);
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = !empty($conf->hrm->enabled); $tabcond[33] = isModEnabled('hrm');
$tabcond[34] = !empty($conf->hrm->enabled); $tabcond[34] = isModEnabled('hrm');
$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[35] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK); $tabcond[36] = isModEnabled('expensereport') && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[37] = isModEnabled("product"); $tabcond[37] = isModEnabled("product");
$tabcond[38] = !empty($conf->socialnetworks->enabled); $tabcond[38] = isModEnabled('socialnetworks');
$tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)); $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[41] = !empty($conf->intracommreport->enabled); $tabcond[41] = isModEnabled('intracommreport');
$tabcond[42] = isModEnabled("product"); $tabcond[42] = isModEnabled("product");
$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2; $tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2;
$tabcond[44] = isModEnabled('asset'); $tabcond[44] = isModEnabled('asset');
// 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

@ -34,6 +34,16 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectorfilter.class
include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php'; include_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollectoraction.class.php';
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
// use Webklex\PHPIMAP;
require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php';
use Webklex\PHPIMAP\ClientManager;
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException;
use OAuth\Common\Storage\DoliStorage;
use OAuth\Common\Consumer\Credentials;
if (!$user->admin) { if (!$user->admin) {
accessforbidden(); accessforbidden();
} }
@ -377,6 +387,97 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$connectstringserver = $object->getConnectStringIMAP($usessl); $connectstringserver = $object->getConnectStringIMAP($usessl);
if ($action == 'scan') { if ($action == 'scan') {
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
if ($object->acces_type == 1) {
// Mode OAUth2 with PHP-IMAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // define $supportedoauth2array
$keyforsupportedoauth2array = $object->oauth_service;
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
} else {
$keyforprovider = '';
}
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
$OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : ''));
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
//$debugtext = "Host: ".$this->host."<br>Port: ".$this->port."<br>Login: ".$this->login."<br>Password: ".$this->password."<br>access type: ".$this->acces_type."<br>oauth service: ".$this->oauth_service."<br>Max email per collect: ".$this->maxemailpercollect;
//dol_syslog($debugtext);
$storage = new DoliStorage($db, $conf);
try {
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
$expire = true;
// Is token expired or will token expire in the next 30 seconds
// if (is_object($tokenobj)) {
// $expire = ($tokenobj->getEndOfLife() !== -9002 && $tokenobj->getEndOfLife() !== -9001 && time() > ($tokenobj->getEndOfLife() - 30));
// }
// Token expired so we refresh it
if (is_object($tokenobj) && $expire) {
$credentials = new Credentials(
getDolGlobalString('OAUTH_'.$object->oauth_service.'_ID'),
getDolGlobalString('OAUTH_'.$object->oauth_service.'_SECRET'),
getDolGlobalString('OAUTH_'.$object->oauth_service.'_URLAUTHORIZE')
);
$serviceFactory = new \OAuth\ServiceFactory();
$oauthname = explode('-', $OAUTH_SERVICENAME);
// ex service is Google-Emails we need only the first part Google
$apiService = $serviceFactory->createService($oauthname[0], $credentials, $storage, array());
// We have to save the token because Google give it only once
$refreshtoken = $tokenobj->getRefreshToken();
$tokenobj = $apiService->refreshAccessToken($tokenobj);
$tokenobj->setRefreshToken($refreshtoken);
$storage->storeAccessToken($OAUTH_SERVICENAME, $tokenobj);
}
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
if (is_object($tokenobj)) {
$token = $tokenobj->getAccessToken();
} else {
$object->error = "Token not found";
return -1;
}
} catch (Exception $e) {
print $e->getMessage();
}
$cm = new ClientManager();
$client = $cm->make([
'host' => $object->host,
'port' => $object->port,
'encryption' => 'ssl',
'validate_cert' => true,
'protocol' => 'imap',
'username' => $object->login,
'password' => $token,
'authentication' => "oauth",
]);
} else {
// Mode login/pass with PHP-IMAP
$cm = new ClientManager();
$client = $cm->make([
'host' => $object->host,
'port' => $object->port,
'encryption' => 'ssl',
'validate_cert' => true,
'protocol' => 'imap',
'username' => $object->login,
'password' => $object->password,
'authentication' => "login",
]);
}
try {
$client->connect();
} catch (ConnectionFailedException $e) {
print $e->getMessage();
}
$f = $client->getFolders(false, $object->source_directory);
$nbemail = $f[0]->examine()["exists"];
$morehtml .= $nbemail;
} else {
try { try {
if ($sourcedir) { if ($sourcedir) {
//$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
@ -422,6 +523,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
dol_syslog("Imap close"); dol_syslog("Imap close");
imap_close($connection); imap_close($connection);
} }
}
} else { } else {
$morehtml .= '<a class="flat" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=scan&token='.newToken().'">'.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").'</a>'; $morehtml .= '<a class="flat" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=scan&token='.newToken().'">'.img_picto('', 'refresh', 'class="paddingrightonly"').$langs->trans("Refresh").'</a>';
} }

View File

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

View File

@ -385,6 +385,20 @@ if ($mode == 'other') {
print '<td class="titlefieldmiddle"></td>'; print '<td class="titlefieldmiddle"></td>';
print '</tr>'; print '</tr>';
// Show Quick Add link
print '<tr class="oddeven"><td>' . $langs->trans("ShowQuickAddLink") . '</td><td>';
print ajax_constantonoff("MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '</tr>';
// Max size of lists // Max size of lists
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>'; print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
print '</tr>'; print '</tr>';
@ -449,12 +463,6 @@ if ($mode == 'other') {
print '</tr>'; print '</tr>';
*/ */
// Show Quick Add link
print '<tr class="oddeven"><td>' . $langs->trans("ShowQuickAddLink") . '</td><td>';
print ajax_constantonoff("MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// Show bugtrack link // Show bugtrack link
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc")); print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
@ -463,14 +471,6 @@ if ($mode == 'other') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td>' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . '</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
print '</tr>';
// Disable javascript and ajax // Disable javascript and ajax
print '<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . '</td><td>'; print '<tr class="oddeven"><td>' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . '</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');

View File

@ -45,10 +45,10 @@ 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
$langsArray=array("errors", "admin", "mails", "languages"); $langsArray=array("errors", "admin", "mails", "languages");
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langsArray[]='members'; $langsArray[]='members';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
$langsArray[]='eventorganization'; $langsArray[]='eventorganization';
} }
@ -179,10 +179,10 @@ $elementList = array();
$elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --';
$elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --';
$elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser'));
if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) { if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) {
$elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember'));
} }
if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { if (isModEnabled('recruitment') && !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 (isModEnabled("societe") && !empty($user->rights->societe->lire)) { if (isModEnabled("societe") && !empty($user->rights->societe->lire)) {
@ -194,7 +194,7 @@ if (isModEnabled('project')) {
if (isModEnabled("propal") && !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 (isModEnabled('commande') && !empty($user->rights->commande->lire)) {
$elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder'));
} }
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) { if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
@ -209,7 +209,7 @@ if (isModEnabled("reception")) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
} }
if (!empty($conf->supplier_proposal->enabled)) { if (isModEnabled('supplier_proposal')) {
$elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation'));
} }
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) { if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) {
@ -218,19 +218,19 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande-
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { 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 (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
} }
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket')); $elementList['ticket_send'] = img_picto('', 'ticket', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToTicket'));
} }
if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) { if (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire)) {
$elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport')); $elementList['expensereport_send'] = img_picto('', 'trip', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToExpenseReport'));
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); $elementList['actioncomm_send'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
} }
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { if (isModEnabled('eventorganization') && !empty($user->rights->eventorganization->read)) {
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
} }
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {

View File

@ -180,7 +180,7 @@ $formproduct = new FormProduct($db);
$disabled = ''; $disabled = '';
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
$disabled = ' disabled'; $disabled = ' disabled';
print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced")); print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced"));
@ -226,7 +226,7 @@ $found++;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>'; print '<td>'.$langs->trans("DeStockOnValidateOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1); print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER', array(), null, 0, 0, 0, 2, 1);
} else { } else {
@ -394,7 +394,7 @@ print "</td>\n";
print "</tr>\n"; print "</tr>\n";
// Option to force stock to be enough before adding a line into document // Option to force stock to be enough before adding a line into document
if (!empty($conf->invoice->enabled)) { if (isModEnabled('facture')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
print '<td class="right">'; print '<td class="right">';
@ -408,7 +408,7 @@ if (!empty($conf->invoice->enabled)) {
print "</tr>\n"; print "</tr>\n";
} }
if (!empty($conf->order->enabled)) { if (isModEnabled('commande')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>'; print '<td>'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
print '<td class="right">'; print '<td class="right">';
@ -763,7 +763,7 @@ print "</td>\n";
print "</tr>\n"; print "</tr>\n";
/* Disabled. Would be better to be managed with a user cookie /* Disabled. Would be better to be managed with a user cookie
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>'; print '<td>' . $langs->trans("ShowAllBatchByDefault") . '</td>';
print '<td class="right">'; print '<td class="right">';

View File

@ -101,7 +101,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
} }
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml'); $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
if (!empty($text_home)) { if (GETPOSTISSET('TICKET_PUBLIC_TEXT_HOME')) {
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
} else { } else {
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
@ -235,12 +235,10 @@ $head = ticketAdminPrepareHead();
print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php?entity='.$conf->entity.'" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).'</a>';
print dol_get_fiche_end();
$param = ''; $param = '';
print '<br>';
$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
// Button off, click to enable // Button off, click to enable
@ -256,9 +254,30 @@ if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $enabledisablehtml; print $enabledisablehtml;
print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">'; print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">';
print '<br><br>'; print dol_get_fiche_end();
if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print '<br>';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> :<br>';
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
print '<br><br>';
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >'; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setvar">'; print '<input type="hidden" name="action" value="setvar">';
@ -371,8 +390,8 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
print '</td></tr>'; print '</td></tr>';
// Texte d'accueil homepage // Text on home page
$public_text_home = $conf->global->TICKET_PUBLIC_TEXT_HOME ? $conf->global->TICKET_PUBLIC_TEXT_HOME : $langs->trans('TicketPublicInterfaceTextHome'); $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>'; print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
print '</td><td>'; print '</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -383,7 +402,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help'); print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
print '</td></tr>'; print '</td></tr>';
// Texte d'aide à la saisie du message // Text to help to enter a ticket
$public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'); $public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe');
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>'; print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
print '</td><td>'; print '</td><td>';

View File

@ -62,13 +62,13 @@ $workflowcodes = array(
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array(
'family'=>'create', 'family'=>'create',
'position'=>10, 'position'=>10,
'enabled'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
'family'=>'create', 'family'=>'create',
'position'=>20, 'position'=>20,
'enabled'=>(!empty($conf->commande->enabled) && isModEnabled('facture')), 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')),
'picto'=>'bill' 'picto'=>'bill'
), ),
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array ( 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
@ -84,7 +84,7 @@ $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'=>(isModEnabled("propal") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')),
'picto'=>'propal', 'picto'=>'propal',
'warning'=>'' 'warning'=>''
), ),
@ -100,19 +100,19 @@ $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'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')),
'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'=>(isModEnabled("expedition") && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')),
'picto'=>'order' 'picto'=>'order'
), ),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array(
'family'=>'classify_order', 'family'=>'classify_order',
'position'=>42, 'position'=>42,
'enabled'=>(isModEnabled('facture') && !empty($conf->commande->enabled)), 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')),
'picto'=>'order', 'picto'=>'order',
'warning'=>'' 'warning'=>''
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
@ -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) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))), 'enabled'=>(isModEnabled('supplier_proposal') && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
'picto'=>'supplier_proposal', 'picto'=>'supplier_proposal',
'warning'=>'' 'warning'=>''
), ),

View File

@ -22,21 +22,24 @@
* \brief Page setup for blockedlog module * \brief Page setup for blockedlog module
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("admin", "other", "blockedlog")); $langs->loadLangs(array('admin', 'blockedlog', 'other'));
// Access Control
if (!$user->admin || empty($conf->blockedlog->enabled)) { if (!$user->admin || empty($conf->blockedlog->enabled)) {
accessforbidden(); accessforbidden();
} }
// Get Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$withtab = GETPOST('withtab', 'int'); $withtab = GETPOST('withtab', 'int');

View File

@ -23,6 +23,8 @@
* \brief Page setup for blockedlog module * \brief Page setup for blockedlog module
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
@ -31,12 +33,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("admin", "other", "blockedlog", "bills")); $langs->loadLangs(array('admin', 'bills', 'blockedlog', 'other'));
// Access Control
if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) { if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
accessforbidden(); accessforbidden();
} }
// Get Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'blockedloglist'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'blockedloglist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
@ -95,7 +99,7 @@ $block_static->loadTrackedEvents();
$result = restrictedArea($user, 'blockedlog', 0, ''); $result = restrictedArea($user, 'blockedlog', 0, '');
// Execution Time
$max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_time = @ini_get("max_execution_time"); $max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport) { if ($max_time && $max_time < $max_execution_time_for_importexport) {

View File

@ -140,6 +140,7 @@ class BlockedLog
$this->trackedevents = array(); $this->trackedevents = array();
// Customer Invoice/Facture / Payment
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE';
$this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE';
@ -151,18 +152,19 @@ class BlockedLog
} }
/* Supplier /* Supplier
// Supplier Invoice / Payment
if (isModEnabled("fournisseur")) { 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
$this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done
$this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done
$this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate'; $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate';
$this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate'; $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate';
} }
*/ */
// Donation
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
$this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE'; $this->trackedevents['DON_VALIDATE'] = 'logDON_VALIDATE';
$this->trackedevents['DON_DELETE'] = 'logDON_DELETE'; $this->trackedevents['DON_DELETE'] = 'logDON_DELETE';
@ -172,6 +174,7 @@ class BlockedLog
} }
/* /*
// Salary
if (!empty($conf->salary->enabled)) { if (!empty($conf->salary->enabled)) {
$this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate'; $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate';
$this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate'; $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate';
@ -179,16 +182,21 @@ class BlockedLog
} }
*/ */
if (!empty($conf->adherent->enabled)) { // Members
if (isModEnabled('adherent')) {
$this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE';
$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';
} }
// Bank
if (isModEnabled("banque")) { 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';
} }
// Cashdesk
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules
$moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); $moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
if ($moduleposenabled) { if ($moduleposenabled) {

View File

@ -682,9 +682,6 @@ class Categories extends DolibarrApi
unset($object->total_ttc); unset($object->total_ttc);
unset($object->total_tva); unset($object->total_tva);
unset($object->lines); unset($object->lines);
unset($object->fk_incoterms);
unset($object->label_incoterms);
unset($object->location_incoterms);
unset($object->civility_id); unset($object->civility_id);
unset($object->name); unset($object->name);
unset($object->lastname); unset($object->lastname);

View File

@ -1362,7 +1362,7 @@ if ($action == 'create') {
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>'; print '</td></tr>';
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
// Categories // Categories
print '<tr><td>'.$langs->trans("Categories").'</td><td>'; print '<tr><td>'.$langs->trans("Categories").'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
@ -1870,7 +1870,7 @@ if ($id > 0) {
print '</td></tr>'; print '</td></tr>';
// Tags-Categories // Tags-Categories
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
$c = new Categorie($db); $c = new Categorie($db);
@ -2285,7 +2285,7 @@ if ($id > 0) {
} }
// Categories // Categories
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1); print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1);
print "</td></tr>"; print "</td></tr>";

View File

@ -201,7 +201,7 @@ class CActionComm
if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) { if ($obj->module == 'invoice' && isModEnabled('facture') && !empty($user->rights->facture->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) { if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) {
$qualified = 1; $qualified = 1;
} }
if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) {
@ -218,7 +218,7 @@ class CActionComm
} }
// For case module = 'myobject@eventorganization' // For case module = 'myobject@eventorganization'
$tmparray = preg_split("/@/", $obj->module, -1); $tmparray = preg_split("/@/", $obj->module, -1);
if (count($tmparray) > 1 && $tmparray[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) { if (count($tmparray) > 1 && $tmparray[1] == 'eventorganization' && isModEnabled('eventorganization')) {
$qualified = 1; $qualified = 1;
} }
// For the generic case with type = 'module...' and module = 'myobject@mymodule' // For the generic case with type = 'module...' and module = 'myobject@mymodule'

View File

@ -47,16 +47,16 @@ if (isModEnabled('facture')) {
if (isModEnabled("propal")) { 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 (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if (isModEnabled("expedition")) { 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 (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
@ -66,10 +66,10 @@ if (!empty($conf->ficheinter->enabled)) {
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('companies', 'banks')); $langs->loadLangs(array('companies', 'banks'));
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$langs->load("contracts"); $langs->load("contracts");
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$langs->load("orders"); $langs->load("orders");
} }
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
@ -510,7 +510,7 @@ if ($object->id > 0) {
} }
if ($object->client) { if ($object->client) {
if (!empty($conf->commande->enabled) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) { if (isModEnabled('commande') && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) {
print '<!-- Minimim amount for orders -->'."\n"; print '<!-- Minimim amount for orders -->'."\n";
print '<tr class="nowrap">'; print '<tr class="nowrap">';
print '<td>'; print '<td>';
@ -584,7 +584,7 @@ if ($object->id > 0) {
print '</tr>'; print '</tr>';
} }
if (!empty($conf->intracommreport->enabled)) { if (isModEnabled('intracommreport')) {
// Transport mode by default // Transport mode by default
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">'; print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">';
@ -605,7 +605,7 @@ if ($object->id > 0) {
} }
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load("categories"); $langs->load("categories");
print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>'; print '<tr><td>'.$langs->trans("CustomersCategoriesShort").'</td>';
print '<td>'; print '<td>';
@ -621,7 +621,7 @@ if ($object->id > 0) {
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$langs->load("members"); $langs->load("members");
$langs->load("users"); $langs->load("users");
@ -718,7 +718,7 @@ if ($object->id > 0) {
} }
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
// Box commandes // Box commandes
$tmp = $object->getOutstandingOrders(); $tmp = $object->getOutstandingOrders();
$outstandingOpened = $tmp['opened']; $outstandingOpened = $tmp['opened'];
@ -913,7 +913,7 @@ if ($object->id > 0) {
/* /*
* Latest orders * Latest orders
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$param =""; $param ="";
$sql = "SELECT s.nom, s.rowid"; $sql = "SELECT s.nom, s.rowid";
@ -1122,7 +1122,7 @@ if ($object->id > 0) {
/* /*
* Latest contracts * Latest contracts
*/ */
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,"; $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,";
$sql .= " c.last_main_doc, c.model_pdf"; $sql .= " c.last_main_doc, c.model_pdf";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
@ -1553,7 +1553,7 @@ if ($object->id > 0) {
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>';
} }
if (!empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status == 1) { if (isModEnabled('commande') && $user->rights->commande->creer && $object->status == 1) {
$langs->load("orders"); $langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
} }
@ -1570,7 +1570,7 @@ if ($object->id > 0) {
// Add invoice // Add invoice
if ($user->socid == 0) { if ($user->socid == 0) {
if (!empty($conf->deplacement->enabled) && $object->status == 1) { if (isModEnabled('deplacement') && $object->status == 1) {
$langs->load("trips"); $langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
} }
@ -1581,7 +1581,7 @@ if ($object->id > 0) {
} else { } else {
$langs->loadLangs(array("orders", "bills")); $langs->loadLangs(array("orders", "bills"));
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if ($object->client != 0 && $object->client != 2) { if ($object->client != 0 && $object->client != 2) {
if (!empty($orders2invoice) && $orders2invoice > 0) { if (!empty($orders2invoice) && $orders2invoice > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';

View File

@ -93,10 +93,10 @@ $companystatic = new Societe($db);
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
$propalstatic = new Propal($db); $propalstatic = new Propal($db);
} }
if (!empty($conf->supplier_proposal->enabled)) { if (isModEnabled('supplier_proposal')) {
$supplierproposalstatic = new SupplierProposal($db); $supplierproposalstatic = new SupplierProposal($db);
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$orderstatic = new Commande($db); $orderstatic = new Commande($db);
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
@ -226,7 +226,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
* Draft supplier proposals * Draft supplier proposals
*/ */
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.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";
@ -323,7 +323,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
* Draft customer orders * Draft customer orders
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.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";
@ -810,7 +810,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
/* /*
* Latest contracts * Latest contracts
*/ */
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
$staticcontrat = new Contrat($db); $staticcontrat = new Contrat($db);
$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";
@ -1007,7 +1007,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
/* /*
* Opened (validated) order * Opened (validated) order
*/ */
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.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

@ -38,7 +38,7 @@ 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('mails', 'companies')); $langs->loadLangs(array('mails', 'companies'));
if (!empty($conf->categorie->enabled)) { if (isModEnabled('categorie')) {
$langs->load("categories"); $langs->load("categories");
} }

View File

@ -980,7 +980,7 @@ if ($action == 'create') {
} }
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) {
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithEditor").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithEditor").'</a>';
} else { } else {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithTextEditor").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithTextEditor").'</a>';

View File

@ -1792,7 +1792,7 @@ if ($action == 'create') {
// Delivery delay // Delivery delay
print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod'); print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print ' ('.$langs->trans('AfterOrder').')'; print ' ('.$langs->trans('AfterOrder').')';
} }
print '</td><td class="valuefieldcreate">'; print '</td><td class="valuefieldcreate">';
@ -2441,7 +2441,7 @@ if ($action == 'create') {
// Delivery delay // Delivery delay
print '<tr class="fielddeliverydelay"><td>'; print '<tr class="fielddeliverydelay"><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
} else { } else {
print $langs->trans('AvailabilityPeriod'); print $langs->trans('AvailabilityPeriod');
@ -2826,7 +2826,7 @@ if ($action == 'create') {
} }
// Create a sale order // Create a sale order
if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateorder) { if ($usercancreateorder) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddOrder").'</a>';
} }
@ -2850,7 +2850,7 @@ if ($action == 'create') {
} }
// Create contract // Create contract
if (!empty($conf->contrat->enabled) && $object->statut == Propal::STATUS_SIGNED) { if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) {
$langs->load("contracts"); $langs->load("contracts");
if ($usercancreatecontract) { if ($usercancreatecontract) {

View File

@ -1057,7 +1057,7 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view products // If the user can view products
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
@ -1065,7 +1065,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');

View File

@ -71,7 +71,7 @@ if (!empty($conf->incoterm->enabled)) {
if (!empty($conf->margin->enabled)) { if (!empty($conf->margin->enabled)) {
$langs->load('margins'); $langs->load('margins');
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }
@ -2836,7 +2836,7 @@ if ($action == 'create' && $usercancreate) {
} }
// Create contract // Create contract
if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
$langs->load("contracts"); $langs->load("contracts");
if ($user->hasRight('contrat', 'creer')) { if ($user->hasRight('contrat', 'creer')) {

View File

@ -92,7 +92,7 @@ if ($tmp) {
/* /*
* Draft orders * Draft orders
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
@ -244,7 +244,7 @@ $max = 10;
/* /*
* Orders to process * Orders to process
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled)) {
/* /*
* Orders that are in process * Orders that are in process
*/ */
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client"; $sql .= ", s.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";

View File

@ -33,6 +33,8 @@
* \brief Page to list orders * \brief Page to list orders
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@ -51,6 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page // 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'));
// Get Parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha'); $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int'); $show_files = GETPOST('show_files', 'int');
@ -58,6 +61,7 @@ $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array'); $toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist'; $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist';
// Search Parameters
$search_datecloture_start = GETPOST('search_datecloture_start', 'int'); $search_datecloture_start = GETPOST('search_datecloture_start', 'int');
if (empty($search_datecloture_start)) { if (empty($search_datecloture_start)) {
$search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int'));
@ -209,6 +213,7 @@ $arrayfields = array(
'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)
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
@ -724,6 +729,7 @@ if ($action == 'shipped' && $permissiontoadd) {
} }
} }
} }
// Closed records // Closed records
if (!$error && $massaction === 'setbilled' && $permissiontoclose) { if (!$error && $massaction === 'setbilled' && $permissiontoclose) {
$db->begin(); $db->begin();
@ -760,10 +766,12 @@ if (!$error && $massaction === 'setbilled' && $permissiontoclose) {
} }
} }
/* /*
* View * View
*/ */
$now = dol_now(); $now = dol_now();
$form = new Form($db); $form = new Form($db);
@ -799,12 +807,14 @@ $sql .= ' c.fk_input_reason, c.import_key';
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
$sql .= ", cc.fk_categorie, cc.fk_soc"; $sql .= ", cc.fk_categorie, cc.fk_soc";
} }
// Add fields from extrafields // Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) { if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
} }
} }
// Add fields from hooks // Add fields from hooks
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@ -1221,7 +1231,7 @@ if ($resql) {
if ($permissiontocancel) { if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"); $arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
} }
if (!empty($conf->invoice->enabled) && $user->rights->facture->creer) { if (isModEnabled('facture') && $user->rights->facture->creer) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer"); $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
} }
if ($permissiontoclose) { if ($permissiontoclose) {
@ -1327,7 +1337,7 @@ if ($resql) {
$moreforfilter = ''; $moreforfilter = '';
// If the user can view prospects other than his' // If the user can view prospects? sales other than his own
if ($user->rights->user->user->lire) { if ($user->rights->user->user->lire) {
$langs->load("commercial"); $langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
@ -1342,8 +1352,9 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view prospects other than his'
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { // If the user can view other products/services than his own
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
@ -1351,13 +1362,15 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { // If Categories are enabled & user has rights to see
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, 'maxwidth300 widthcentpercentminusx');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If Stock is enabled
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db); $formproduct = new FormProduct($db);
@ -1509,60 +1522,61 @@ if ($resql) {
$form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1); $form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1);
print '</td>'; print '</td>';
} }
// Amount HT / net
if (!empty($arrayfields['c.total_ht']['checked'])) { if (!empty($arrayfields['c.total_ht']['checked'])) {
// Amount
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_total_ht" value="'.dol_escape_htmltag($search_total_ht).'">'; print '<input class="flat" type="text" size="4" name="search_total_ht" value="'.dol_escape_htmltag($search_total_ht).'">';
print '</td>'; print '</td>';
} }
// Amount of VAT
if (!empty($arrayfields['c.total_vat']['checked'])) { if (!empty($arrayfields['c.total_vat']['checked'])) {
// Amount
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_total_vat" value="'.dol_escape_htmltag($search_total_vat).'">'; print '<input class="flat" type="text" size="4" name="search_total_vat" value="'.dol_escape_htmltag($search_total_vat).'">';
print '</td>'; print '</td>';
} }
// Total Amount (TTC / gross)
if (!empty($arrayfields['c.total_ttc']['checked'])) { if (!empty($arrayfields['c.total_ttc']['checked'])) {
// Amount
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">'; print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['c.multicurrency_code']['checked'])) {
// Currency // Currency
if (!empty($arrayfields['c.multicurrency_code']['checked'])) {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['c.multicurrency_tx']['checked'])) {
// Currency rate // Currency rate
if (!empty($arrayfields['c.multicurrency_tx']['checked'])) {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).'">'; print '<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).'">';
print '</td>'; print '</td>';
} }
// Amount HT/net in foreign currency
if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) {
// Amount
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).'">'; print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).'">';
print '</td>'; print '</td>';
} }
// VAT in foreign currency
if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) {
// Amount VAT
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).'">'; print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).'">';
print '</td>'; print '</td>';
} }
// Amount/Total (TTC / gross) in foreign currency
if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) {
// Amount
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).'">'; print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).'">';
print '</td>'; print '</td>';
} }
if (!empty($arrayfields['u.login']['checked'])) {
// Author // Author
if (!empty($arrayfields['u.login']['checked'])) {
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">'; print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">';
print '</td>'; print '</td>';
} }
// Sales Representative
if (!empty($arrayfields['sale_representative']['checked'])) { if (!empty($arrayfields['sale_representative']['checked'])) {
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
} }
@ -1582,12 +1596,15 @@ if ($resql) {
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '</td>'; print '</td>';
} }
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Fields from hook // Fields from hook
$parameters = array('arrayfields'=>$arrayfields); $parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Date creation // Date creation
if (!empty($arrayfields['c.datec']['checked'])) { if (!empty($arrayfields['c.datec']['checked'])) {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
@ -1775,8 +1792,10 @@ if ($resql) {
), ),
'pos' => array(), 'pos' => array(),
); );
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields // Hook fields
$parameters = array( $parameters = array(
'arrayfields' => $arrayfields, 'arrayfields' => $arrayfields,
@ -1976,6 +1995,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Alias name // Alias name
if (!empty($arrayfields['s.name_alias']['checked'])) { if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="nocellnopadd">'; print '<td class="nocellnopadd">';
@ -1985,6 +2005,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Town // Town
if (!empty($arrayfields['s.town']['checked'])) { if (!empty($arrayfields['s.town']['checked'])) {
print '<td class="nocellnopadd">'; print '<td class="nocellnopadd">';
@ -1994,6 +2015,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Zip // Zip
if (!empty($arrayfields['s.zip']['checked'])) { if (!empty($arrayfields['s.zip']['checked'])) {
print '<td class="nocellnopadd">'; print '<td class="nocellnopadd">';
@ -2003,6 +2025,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// State // State
if (!empty($arrayfields['state.nom']['checked'])) { if (!empty($arrayfields['state.nom']['checked'])) {
print "<td>".$obj->state_name."</td>\n"; print "<td>".$obj->state_name."</td>\n";
@ -2010,6 +2033,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Country // Country
if (!empty($arrayfields['country.code_iso']['checked'])) { if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="center">'; print '<td class="center">';
@ -2020,6 +2044,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Type ent // Type ent
if (!empty($arrayfields['typent.code']['checked'])) { if (!empty($arrayfields['typent.code']['checked'])) {
print '<td class="center">'; print '<td class="center">';
@ -2046,6 +2071,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Plannned date of delivery // Plannned date of delivery
if (!empty($arrayfields['c.date_delivery']['checked'])) { if (!empty($arrayfields['c.date_delivery']['checked'])) {
print '<td class="center">'; print '<td class="center">';
@ -2055,6 +2081,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Shipping Method // Shipping Method
if (!empty($arrayfields['c.fk_shipping_method']['checked'])) { if (!empty($arrayfields['c.fk_shipping_method']['checked'])) {
print '<td>'; print '<td>';
@ -2064,6 +2091,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Payment terms // Payment terms
if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) { if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) {
print '<td>'; print '<td>';
@ -2073,6 +2101,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Payment mode // Payment mode
if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) { if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) {
print '<td>'; print '<td>';
@ -2082,6 +2111,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Channel // Channel
if (!empty($arrayfields['c.fk_input_reason']['checked'])) { if (!empty($arrayfields['c.fk_input_reason']['checked'])) {
print '<td>'; print '<td>';
@ -2091,7 +2121,8 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Amount HT
// Amount HT/net
if (!empty($arrayfields['c.total_ht']['checked'])) { if (!empty($arrayfields['c.total_ht']['checked'])) {
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ht)."</span></td>\n"; print '<td class="nowrap right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
if (!$i) { if (!$i) {
@ -2106,6 +2137,7 @@ if ($resql) {
$totalarray['val']['c.total_ht'] = $obj->total_ht; $totalarray['val']['c.total_ht'] = $obj->total_ht;
} }
} }
// Amount VAT // Amount VAT
if (!empty($arrayfields['c.total_vat']['checked'])) { if (!empty($arrayfields['c.total_vat']['checked'])) {
print '<td class="nowrap right"><span class="amount">'.price($obj->total_tva)."</span></td>\n"; print '<td class="nowrap right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
@ -2117,7 +2149,8 @@ if ($resql) {
} }
$totalarray['val']['c.total_tva'] += $obj->total_tva; $totalarray['val']['c.total_tva'] += $obj->total_tva;
} }
// Amount TTC
// Amount TTC / gross
if (!empty($arrayfields['c.total_ttc']['checked'])) { if (!empty($arrayfields['c.total_ttc']['checked'])) {
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n"; print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
if (!$i) { if (!$i) {
@ -2146,21 +2179,22 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Amount HT
// Amount HT/net in foreign currency
if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_ht']['checked'])) {
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n"; print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Amount VAT // Amount VAT in foreign currency
if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_vat']['checked'])) {
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n"; print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Amount TTC // Amount TTC / gross in foreign currency
if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) { if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) {
print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n"; print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
if (!$i) { if (!$i) {
@ -2196,8 +2230,8 @@ if ($resql) {
} }
} }
if (!empty($arrayfields['sale_representative']['checked'])) {
// Sales representatives // Sales representatives
if (!empty($arrayfields['sale_representative']['checked'])) {
print '<td>'; print '<td>';
if ($obj->socid > 0) { if ($obj->socid > 0) {
$listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
@ -2250,6 +2284,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Total margin // Total margin
if (!empty($arrayfields['total_margin']['checked'])) { if (!empty($arrayfields['total_margin']['checked'])) {
print '<td class="right nowrap">'.price($marginInfo['total_margin']).'</td>'; print '<td class="right nowrap">'.price($marginInfo['total_margin']).'</td>';
@ -2261,6 +2296,7 @@ if ($resql) {
} }
$totalarray['val']['total_margin'] += $marginInfo['total_margin']; $totalarray['val']['total_margin'] += $marginInfo['total_margin'];
} }
// Total margin rate // Total margin rate
if (!empty($arrayfields['total_margin_rate']['checked'])) { if (!empty($arrayfields['total_margin_rate']['checked'])) {
print '<td class="right nowrap">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').'</td>'; print '<td class="right nowrap">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').'</td>';
@ -2268,6 +2304,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Total mark rate // Total mark rate
if (!empty($arrayfields['total_mark_rate']['checked'])) { if (!empty($arrayfields['total_mark_rate']['checked'])) {
print '<td class="right nowrap">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').'</td>'; print '<td class="right nowrap">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').'</td>';
@ -2389,7 +2426,7 @@ if ($resql) {
$stock_order = 0; $stock_order = 0;
$stock_order_supplier = 0; $stock_order_supplier = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ? if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ?
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0, '1,2'); $generic_product->load_stats_commande(0, '1,2');
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
@ -2456,6 +2493,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Import key // Import key
if (!empty($arrayfields['c.import_key']['checked'])) { if (!empty($arrayfields['c.import_key']['checked'])) {
print '<td class="nowrap center">'.$obj->import_key.'</td>'; print '<td class="nowrap center">'.$obj->import_key.'</td>';
@ -2463,6 +2501,7 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Status // Status
if (!empty($arrayfields['c.fk_statut']['checked'])) { if (!empty($arrayfields['c.fk_statut']['checked'])) {
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>'; print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';

View File

@ -2321,7 +2321,7 @@ if (empty($reshook)) {
if (!$error) { if (!$error) {
// Add batchinfo if the detail_batch array is defined // Add batchinfo if the detail_batch array is defined
if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { if (isModEnabled('productbatch') && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) {
$langs->load('productbatch'); $langs->load('productbatch');
foreach ($lines[$i]->detail_batch as $batchline) { foreach ($lines[$i]->detail_batch as $batchline) {
$desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' ';
@ -5511,7 +5511,7 @@ if ($action == 'create') {
// Create contract // Create contract
if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) { if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) {
if (!empty($conf->contrat->enabled) && $object->statut == Facture::STATUS_VALIDATED) { if (isModEnabled('contrat') && $object->statut == Facture::STATUS_VALIDATED) {
$langs->load("contracts"); $langs->load("contracts");
if ($usercancreatecontract) { if ($usercancreatecontract) {

View File

@ -25,7 +25,7 @@
/** /**
* \file htdocs/compta/facture/class/facture-rec.class.php * \file htdocs/compta/facture/class/facture-rec.class.php
* \ingroup facture * \ingroup facture
* \brief Fichier de la classe des factures recurentes * \brief File of class to manage recurring invoices
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
@ -462,7 +462,7 @@ class FactureRec extends CommonInvoice
/** /**
* Update a line to invoice_rec. * Update a line invoice_rec.
* *
* @param User $user User * @param User $user User
* @param int $notrigger No trigger * @param int $notrigger No trigger
@ -470,8 +470,6 @@ class FactureRec extends CommonInvoice
*/ */
public function update(User $user, $notrigger = 0) public function update(User $user, $notrigger = 0)
{ {
global $conf;
$error = 0; $error = 0;
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET";
@ -480,8 +478,8 @@ class FactureRec extends CommonInvoice
$sql .= " suspended = ".((int) $this->suspended).","; $sql .= " suspended = ".((int) $this->suspended).",";
$sql .= " fk_soc = ".((int) $this->socid).","; $sql .= " fk_soc = ".((int) $this->socid).",";
$sql .= " total_tva = ".((float) $this->total_tva).","; $sql .= " total_tva = ".((float) $this->total_tva).",";
$sql .= " localtax1 = ".((float) $this->localtax1).","; $sql .= " localtax1 = ".((float) $this->total_localtax1).",";
$sql .= " localtax2 = ".((float) $this->localtax2).","; $sql .= " localtax2 = ".((float) $this->total_localtax2).",";
$sql .= " total_ht = ".((float) $this->total_ht).","; $sql .= " total_ht = ".((float) $this->total_ht).",";
$sql .= " total_ttc = ".((float) $this->total_ttc).","; $sql .= " total_ttc = ".((float) $this->total_ttc).",";
$sql .= " remise_percent = ".((float) $this->remise_percent); $sql .= " remise_percent = ".((float) $this->remise_percent);

View File

@ -587,7 +587,7 @@ if (count($amount)) {
// Other stats // Other stats
print '<td class="center">'; print '<td class="center">';
if (!empty($conf->supplier_proposal->enabled) && $key > 0) { if (isModEnabled('supplier_proposal') && $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 (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) { if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) {

View File

@ -191,7 +191,7 @@ abstract class ActionsContactCardCommon
$this->object->load_ref_elements(); $this->object->load_ref_elements();
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders");
$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++;
@ -201,7 +201,7 @@ abstract class ActionsContactCardCommon
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal");
$i++; $i++;
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract");
$i++; $i++;

View File

@ -215,7 +215,7 @@ if (empty($reshook)) {
//$object->facebook = GETPOST("facebook", 'alpha'); //$object->facebook = GETPOST("facebook", 'alpha');
//$object->linkedin = GETPOST("linkedin", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha');
$object->socialnetworks = array(); $object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
@ -427,7 +427,7 @@ if (empty($reshook)) {
//$object->facebook = GETPOST("facebook", 'alpha'); //$object->facebook = GETPOST("facebook", 'alpha');
//$object->linkedin = GETPOST("linkedin", 'alpha'); //$object->linkedin = GETPOST("linkedin", 'alpha');
$object->socialnetworks = array(); $object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml'); $object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
@ -859,7 +859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
print '<tr>'; print '<tr>';
@ -892,7 +892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%');
@ -1146,7 +1146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</tr>'; print '</tr>';
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
print '<tr>'; print '<tr>';
@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$arrayselected = array(); $arrayselected = array();
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td>'; print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
@ -1225,7 +1225,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->load_ref_elements(); $object->load_ref_elements();
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
print $object->ref_commande ? $object->ref_commande : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyOrder").'</span>'); print $object->ref_commande ? $object->ref_commande : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyOrder").'</span>');
print '</td></tr>'; print '</td></tr>';
@ -1237,7 +1237,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
print $object->ref_contrat ? $object->ref_contrat : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyContract").'</span>'); print $object->ref_contrat ? $object->ref_contrat : ('<span class="opacitymedium">'.$langs->trans("NoContactForAnyContract").'</span>');
print '</td></tr>'; print '</td></tr>';
@ -1316,7 +1316,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$login = dol_buildlogin($object->lastname, $object->firstname); $login = dol_buildlogin($object->lastname, $object->firstname);
$generated_password = ''; $generated_password = '';
if (!$ldap_sid) { // TODO ldap_sid ? if (empty($ldap_sid)) { // TODO ldap_sid ?
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$generated_password = getRandomPassword(false); $generated_password = getRandomPassword(false);
} }
@ -1471,7 +1471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Categories // Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1);
@ -1498,7 +1498,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->commande->enabled) || isModEnabled("expedition")) { if (isModEnabled('commande') || isModEnabled("expedition")) {
print '<tr><td>'; print '<tr><td>';
if (isModEnabled("expedition")) { if (isModEnabled("expedition")) {
print $langs->trans("ContactForOrdersOrShipments"); print $langs->trans("ContactForOrdersOrShipments");
@ -1514,7 +1514,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract");
print '</td></tr>'; print '</td></tr>';

View File

@ -159,13 +159,13 @@ if ($object->thirdparty->client) {
if (isModEnabled("propal") && $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 (isModEnabled('commande') && $user->rights->commande->lire) {
$elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders');
} }
if (isModEnabled('facture') && $user->rights->facture->lire) { if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
} }
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
} }
} }

View File

@ -83,7 +83,7 @@ if (!empty($conf->mailing->enabled)) {
} else { } else {
$search_no_email = -1; $search_no_email = -1;
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
$search_[$key] = GETPOST("search_".$key, 'alpha'); $search_[$key] = GETPOST("search_".$key, 'alpha');
@ -221,7 +221,7 @@ $arrayfields['unsubscribed'] = array(
'enabled'=>(!empty($conf->mailing->enabled)), 'enabled'=>(!empty($conf->mailing->enabled)),
'position'=>111); 'position'=>111);
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
$arrayfields['p.'.$key] = array( $arrayfields['p.'.$key] = array(
@ -289,7 +289,7 @@ if (empty($reshook)) {
$search_fax = ""; $search_fax = "";
$search_email = ""; $search_email = "";
$search_no_email = -1; $search_no_email = -1;
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
$search_[$key] = ""; $search_[$key] = "";
@ -499,7 +499,7 @@ if (strlen($search_phone_mobile)) {
if (strlen($search_fax)) { if (strlen($search_fax)) {
$sql .= natural_search('p.fax', $search_fax); $sql .= natural_search('p.fax', $search_fax);
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active'] && strlen($search_[$key])) { if ($value['active'] && strlen($search_[$key])) {
$sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'"; $sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'";
@ -734,7 +734,7 @@ if ($search_firstlast_only) {
} }
$moreforfilter = ''; $moreforfilter = '';
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ContactCategoriesShort'); $tmptitle = $langs->trans('ContactCategoriesShort');
@ -880,7 +880,7 @@ if (!empty($arrayfields['unsubscribed']['checked'])) {
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email); print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
print '</td>'; print '</td>';
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active']) { if ($value['active']) {
if (!empty($arrayfields['p.'.$key]['checked'])) { if (!empty($arrayfields['p.'.$key]['checked'])) {
@ -1004,7 +1004,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
if (!empty($arrayfields['unsubscribed']['checked'])) { if (!empty($arrayfields['unsubscribed']['checked'])) {
print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder); print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder);
@ -1219,7 +1219,7 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'</td>'; print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'</td>';

View File

@ -2116,7 +2116,7 @@ if ($action == 'create') {
} }
} }
if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { if (isModEnabled('commande') && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) {
$langs->load("orders"); $langs->load("orders");
if ($user->rights->commande->creer) { if ($user->rights->commande->creer) {
print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params); print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);

View File

@ -239,7 +239,7 @@ print "</table></div><br>";
// Draft contracts // Draft contracts
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$sql = "SELECT c.rowid, c.ref,"; $sql = "SELECT c.rowid, c.ref,";
$sql .= " s.nom as name, s.rowid as socid"; $sql .= " s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";

View File

@ -571,7 +571,7 @@ if ($user->rights->user->user->lire) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view categories of products // If the user can view categories of products
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');

View File

@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes
} }
// list the summary of the orders // list the summary of the orders
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic = new Commande($this->db); $commandestatic = new Commande($this->db);

View File

@ -214,7 +214,7 @@ class box_graph_product_distribution extends ModeleBoxes
} }
} }
if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { if (isModEnabled('commande') && !empty($user->rights->commande->lire)) {
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showordernb) { if ($showordernb) {
$langs->load("orders"); $langs->load("orders");
@ -369,7 +369,7 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals"); $stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals");
$stringtoshow .= '&nbsp;'; $stringtoshow .= '&nbsp;';
} }
if (!empty($conf->commande->enabled) || !empty($user->rights->commande->lire)) { if (isModEnabled('commande') || !empty($user->rights->commande->lire)) {
$stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders"); $stringtoshow .= '<input type="checkbox" name="'.$param_showordernb.'"'.($showordernb ? ' checked' : '').'> '.$langs->trans("ForCustomersOrders");
} }
if (isModEnabled('facture') || !empty($user->rights->facture->lire)) { if (isModEnabled('facture') || !empty($user->rights->facture->lire)) {

View File

@ -68,7 +68,7 @@ class box_members_by_type extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_last_modified extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_last_subscriptions extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -67,7 +67,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
$this->enabled = 0; // disabled for external users $this->enabled = 0; // disabled for external users
} }
$this->hidden = !(!empty($conf->adherent->enabled) && $user->rights->adherent->lire); $this->hidden = !(isModEnabled('adherent') && $user->rights->adherent->lire);
} }
/** /**

View File

@ -150,6 +150,11 @@ class box_produits extends ModeleBoxes
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
$productstatic->date_modification = $datem; $productstatic->date_modification = $datem;
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
if ($productstatic->isService()) {
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
}
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"', 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
'text' => $productstatic->getNomUrl(1), 'text' => $productstatic->getNomUrl(1),
@ -162,6 +167,7 @@ class box_produits extends ModeleBoxes
); );
$price = ''; $price = '';
$price_base_type = ''; $price_base_type = '';
if ($usercancreadprice) {
if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) { if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) {
$price_base_type = $langs->trans($objp->price_base_type); $price_base_type = $langs->trans($objp->price_base_type);
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc); $price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
@ -180,6 +186,7 @@ class box_produits extends ModeleBoxes
$price = price($price_result); $price = price($price_result);
} }
} }
}
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'td' => 'class="nowraponall right amount"', 'td' => 'class="nowraponall right amount"',
'text' => $price, 'text' => $price,

View File

@ -749,7 +749,7 @@ abstract class CommonObject
$this->lastname = dol_ucwords(dol_strtolower($this->lastname)); $this->lastname = dol_ucwords(dol_strtolower($this->lastname));
$this->firstname = dol_ucwords(dol_strtolower($this->firstname)); $this->firstname = dol_ucwords(dol_strtolower($this->firstname));
$this->name = dol_ucwords(dol_strtolower($this->name)); $this->name = dol_ucwords(dol_strtolower($this->name));
$this->name_alias = dol_ucwords(dol_strtolower($this->name_alias)); $this->name_alias = isset($this->name_alias)?dol_ucwords(dol_strtolower($this->name_alias)):'';
} }
if (!empty($conf->global->MAIN_ALL_TO_UPPER)) { if (!empty($conf->global->MAIN_ALL_TO_UPPER)) {
$this->lastname = dol_strtoupper($this->lastname); $this->lastname = dol_strtoupper($this->lastname);
@ -968,7 +968,7 @@ abstract class CommonObject
$outdone++; $outdone++;
} }
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
$outsocialnetwork = ''; $outsocialnetwork = '';
if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) { if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
@ -6902,7 +6902,7 @@ abstract class CommonObject
} elseif (preg_match('/^html/', $type)) { } elseif (preg_match('/^html/', $type)) {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
$out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss); $out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss);
} else { } else {
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';

View File

@ -152,7 +152,7 @@ class DolEditor
$out .= htmlspecialchars($this->content); $out .= htmlspecialchars($this->content);
$out .= '</textarea>'; $out .= '</textarea>';
if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) { if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && isModEnabled('fckeditor')) {
if (!defined('REQUIRE_CKEDITOR')) { if (!defined('REQUIRE_CKEDITOR')) {
define('REQUIRE_CKEDITOR', '1'); define('REQUIRE_CKEDITOR', '1');
} }

View File

@ -9,7 +9,7 @@
* Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr> * Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2022 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
* 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
@ -42,30 +42,6 @@ class ExtraFields
*/ */
public $db; public $db;
/**
* @var array Array with type of the extra field
* @deprecated
*/
public $attribute_type;
/**
* @var array Array with label of extra field
* @deprecated
*/
public $attribute_label;
/**
* @var array Array with list of possible values for some types of extra fields
* @deprecated
*/
public $attribute_choice;
/**
* @var array array to store extrafields definition
* @deprecated
*/
public $attribute_list;
/** /**
* @var array New array to store extrafields definition * @var array New array to store extrafields definition
*/ */
@ -91,7 +67,9 @@ class ExtraFields
*/ */
public $errno; public $errno;
/**
* @var array array of type to label
*/
public static $type2label = array( public static $type2label = array(
'varchar'=>'String1Line', 'varchar'=>'String1Line',
'text'=>'TextLongNLines', 'text'=>'TextLongNLines',
@ -128,10 +106,6 @@ class ExtraFields
$this->error = ''; $this->error = '';
$this->errors = array(); $this->errors = array();
$this->attributes = array(); $this->attributes = array();
// For old usage
$this->attribute_type = array();
$this->attribute_label = array();
} }
/** /**
@ -838,7 +812,7 @@ class ExtraFields
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load array this->attributes (and some old this->attribute_xxx like attribute_label, attribute_type, ... * Load array this->attributes
* *
* @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
* @param boolean $forceload Force load of extra fields whatever is status of cache. * @param boolean $forceload Force load of extra fields whatever is status of cache.
@ -892,11 +866,6 @@ class ExtraFields
$array_name_label[$tab->name] = $tab->label; $array_name_label[$tab->name] = $tab->label;
} }
// Old usage
$this->attribute_type[$tab->name] = $tab->type;
$this->attribute_label[$tab->name] = $tab->label;
// New usage
$this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type; $this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type;
$this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label; $this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label;
$this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size; $this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size;
@ -946,7 +915,7 @@ class ExtraFields
* @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
* @param int $objectid Current object id * @param int $objectid Current object id
* @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @param string $extrafieldsobjectkey The key to use to store retreived data (for example $object->table_element)
* @param string $mode 1=Used for search filters * @param string $mode 1=Used for search filters
* @return string * @return string
*/ */
@ -965,7 +934,11 @@ class ExtraFields
$keyprefix = $keyprefix.'options_'; $keyprefix = $keyprefix.'options_';
} }
if (!empty($extrafieldsobjectkey)) { if (empty($extrafieldsobjectkey)) {
dol_syslog(get_class($this).'::showInputField extrafieldsobjectkey required', LOG_ERR);
return 'BadValueForParamExtraFieldsObjectKey';
}
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; $label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; $type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; $size = $this->attributes[$extrafieldsobjectkey]['size'][$key];
@ -980,13 +953,6 @@ class ExtraFields
$totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
} else {
// Old usage
$label = $this->attribute_label[$key];
$type = $this->attribute_type[$key];
$list = $this->attribute_list[$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
if ($computed) { if ($computed) {
if (!preg_match('/^search_/', $keyprefix)) { if (!preg_match('/^search_/', $keyprefix)) {
@ -1098,7 +1064,7 @@ class ExtraFields
} elseif ($type == 'html') { } elseif ($type == 'html') {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
$out = $doleditor->Create(1); $out = $doleditor->Create(1);
} else { } else {
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>'; $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
@ -1591,7 +1557,11 @@ class ExtraFields
{ {
global $conf, $langs; global $conf, $langs;
if (!empty($extrafieldsobjectkey)) { if (empty($extrafieldsobjectkey)) {
dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_ERR);
return 'BadValueForParamExtraFieldsObjectKey';
}
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; $label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; $type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
@ -1605,11 +1575,6 @@ class ExtraFields
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
} else {
// Old usage not allowed anymore
dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_WARNING);
return '';
}
if ($hidden) { if ($hidden) {
return ''; // This is a protection. If field is hidden, we should just not call this method. return ''; // This is a protection. If field is hidden, we should just not call this method.

View File

@ -529,7 +529,7 @@ class Form
$savemethod = $tmp[4]; $savemethod = $tmp[4];
} }
if (!empty($conf->fckeditor->enabled)) { if (isModEnabled('fckeditor')) {
$out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
} else { } else {
$inputType = 'textarea'; $inputType = 'textarea';
@ -8721,7 +8721,7 @@ class Form
'label'=>'LinkToIntervention', 'label'=>'LinkToIntervention',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'),
'supplier_proposal'=>array( 'supplier_proposal'=>array(
'enabled'=>(!empty($conf->supplier_proposal->enabled) ? $conf->supplier_proposal->enabled : 0), 'enabled'=>(isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0),
'perms'=>1, 'perms'=>1,
'label'=>'LinkToSupplierProposal', 'label'=>'LinkToSupplierProposal',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'),

View File

@ -1630,7 +1630,7 @@ class FormMail extends Form
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
$tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN; $tmparray['__SECUREKEYPAYMENT__'] = $conf->global->PAYMENT_SECURITY_TOKEN;
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -1639,15 +1639,15 @@ class FormMail extends Form
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine'; $tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine';
} }
//Online payement link //Online payement link
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember';
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -1656,10 +1656,10 @@ class FormMail extends Form
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice';
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine'; $tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine';
} }
} }

View File

@ -328,7 +328,7 @@ class FormTicket
print '</td></tr>'; print '</td></tr>';
// Severity // Severity
print '<tr><td><span class="fieldrequired"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>'; print '<tr><td><span class="none"><label for="selectseverity_code">'.$langs->trans("TicketSeverity").'</span></label></td><td>';
$this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1); $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1);
print '</td></tr>'; print '</td></tr>';
@ -643,7 +643,7 @@ class FormTicket
print dol_get_fiche_end(); print dol_get_fiche_end();
} }
print '<br>'; print '<br><br>';
print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : "")); print $form->buttonsSaveCancel(((isset($this->withreadid) && $this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));

View File

@ -157,6 +157,11 @@ function bank_admin_prepare_head($object)
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
$head[$h][1] = $langs->trans("BanklineExtraFields");
$head[$h][2] = 'bankline_extrafields';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin', 'remove');

View File

@ -128,7 +128,7 @@ function societe_prepare_head(Societe $object)
} }
} }
$supplier_module_enabled = 0; $supplier_module_enabled = 0;
if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$supplier_module_enabled = 1; $supplier_module_enabled = 1;
} }
if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) { if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {

View File

@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
} }
// Related items // Related items
if (!empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Referers"); $head[$tab][1] = $langs->trans("Referers");
$head[$tab][2] = 'consumption'; $head[$tab][2] = 'consumption';

View File

@ -2933,7 +2933,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i', $original_file)) { if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1; $accessallowed = 1;
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$original_file = $conf->productbatch->multidir_output[$entity].'/'.$original_file; $original_file = $conf->productbatch->multidir_output[$entity].'/'.$original_file;
} }
} elseif ($modulepart == 'movement' || $modulepart == 'mouvement') { } elseif ($modulepart == 'movement' || $modulepart == 'mouvement') {

View File

@ -2976,7 +2976,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
$newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); $newemail .= img_warning($langs->trans("ErrorBadEMail", $email));
} }
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
$type = 'AC_EMAIL'; $type = 'AC_EMAIL';
$link = ''; $link = '';
if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) { if (!empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) {
@ -3082,7 +3082,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
$htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">'; $htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">';
$htmllink .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">'; $htmllink .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
$htmllink .= '</a>'; $htmllink .= '</a>';
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { if (($cid || $socid) && isModEnabled('agenda') && $user->rights->agenda->myactions->create) {
$addlink = 'AC_SKYPE'; $addlink = 'AC_SKYPE';
$link = ''; $link = '';
if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) { if (!empty($conf->global->AGENDA_ADDACTIONFORSKYPE)) {
@ -7371,7 +7371,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__';
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';
} }
if (!empty($conf->adherent->enabled) && (!is_object($object) || $object->element == 'adherent')) { if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent')) {
$substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__';
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
@ -7393,7 +7393,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__'; $substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__';
} }
if (!empty($conf->recruitment->enabled) && (!is_object($object) || $object->element == 'recruitmentcandidature')) { if (isModEnabled('recruitment') && (!is_object($object) || $object->element == 'recruitmentcandidature')) {
$substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__'; $substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__';
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__';
$substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__'; $substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__';
@ -7405,7 +7405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
/*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__'; /*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__';
$substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/ $substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/
} }
if (!empty($conf->contrat->enabled) && (!is_object($object) || $object->element == 'contract')) { if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract')) {
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';

View File

@ -64,14 +64,14 @@ function ldap_prepare_head()
$h++; $h++;
} }
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE)) { if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_ACTIVE)) {
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php";
$head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][1] = $langs->trans("LDAPMembersSynchro");
$head[$h][2] = 'members'; $head[$h][2] = 'members';
$h++; $h++;
} }
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) { if (isModEnabled('adherent') && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE)) {
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php";
$head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro");
$head[$h][2] = 'memberstypes'; $head[$h][2] = 'memberstypes';

View File

@ -123,7 +123,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
$i++; $i++;
$texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."',"; $texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."',";
$texttoinsert .= " 'label'=>'".$val['label']."',"; $texttoinsert .= " 'label'=>'".$val['label']."',";
if ($val['picto']) { if (!empty($val['picto'])) {
$texttoinsert .= " 'picto'=>'".$val['picto']."',"; $texttoinsert .= " 'picto'=>'".$val['picto']."',";
} }
$texttoinsert .= " 'enabled'=>'".($val['enabled'] !== '' ? $val['enabled'] : 1)."',"; $texttoinsert .= " 'enabled'=>'".($val['enabled'] !== '' ? $val['enabled'] : 1)."',";

View File

@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object)
$h = 0; $h = 0;
$head = array(); $head = array();
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][1] = $langs->trans("CustomerOrder");
$head[$h][2] = 'order'; $head[$h][2] = 'order';

View File

@ -1605,7 +1605,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
$libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice;
// Add an additional description for the category products // Add an additional description for the category products
if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) { if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && isModEnabled('categorie')) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categstatic = new Categorie($db); $categstatic = new Categorie($db);
// recovering the list of all the categories linked to product // recovering the list of all the categories linked to product

View File

@ -124,7 +124,7 @@ function product_prepare_head($object)
} }
// Tab to link resources // Tab to link resources
if (!empty($conf->resource->enabled)) { if (isModEnabled('resource')) {
if ($object->isProduct() && !empty($conf->global->RESOURCE_ON_PRODUCTS)) { if ($object->isProduct() && !empty($conf->global->RESOURCE_ON_PRODUCTS)) {
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&ref='.$object->ref; $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&ref='.$object->ref;
$head[$h][1] = $langs->trans("Resources"); $head[$h][1] = $langs->trans("Resources");
@ -398,7 +398,7 @@ function show_stats_for_company($product, $socid)
print '</tr>'; print '</tr>';
} }
// Supplier proposals // Supplier proposals
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$nblines++; $nblines++;
$ret = $product->load_stats_proposal_supplier($socid); $ret = $product->load_stats_proposal_supplier($socid);
if ($ret < 0) { if ($ret < 0) {
@ -417,7 +417,7 @@ function show_stats_for_company($product, $socid)
print '</tr>'; print '</tr>';
} }
// Customer orders // Customer orders
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->rights->commande->lire) {
$nblines++; $nblines++;
$ret = $product->load_stats_commande($socid); $ret = $product->load_stats_commande($socid);
if ($ret < 0) { if ($ret < 0) {
@ -513,7 +513,7 @@ function show_stats_for_company($product, $socid)
} }
// Contracts // Contracts
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$nblines++; $nblines++;
$ret = $product->load_stats_contrat($socid); $ret = $product->load_stats_contrat($socid);
if ($ret < 0) { if ($ret < 0) {

View File

@ -125,9 +125,9 @@ function project_prepare_head(Project $project, $moreparam = '')
} }
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
|| isModEnabled("propal") || !empty($conf->commande->enabled) || isModEnabled("propal") || isModEnabled('commande')
|| isModEnabled('facture') || !empty($conf->contrat->enabled) || isModEnabled('facture') || isModEnabled('contrat')
|| !empty($conf->ficheinter->enabled) || !empty($conf->agenda->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->stock->enabled)) { || !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) {
$nbElements = 0; $nbElements = 0;
// Enable caching of thirdrparty count Contacts // Enable caching of thirdrparty count Contacts
$cachekey = 'count_elements_project_'.$project->id; $cachekey = 'count_elements_project_'.$project->id;
@ -141,7 +141,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
$nbElements += $project->getElementCount('propal', 'propal'); $nbElements += $project->getElementCount('propal', 'propal');
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$nbElements += $project->getElementCount('order', 'commande'); $nbElements += $project->getElementCount('order', 'commande');
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
@ -150,7 +150,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec');
} }
if (!empty($conf->supplier_proposal->enabled)) { if (isModEnabled('supplier_proposal')) {
$nbElements += $project->getElementCount('proposal_supplier', 'supplier_proposal'); $nbElements += $project->getElementCount('proposal_supplier', 'supplier_proposal');
} }
if (isModEnabled("supplier_order")) { if (isModEnabled("supplier_order")) {
@ -159,7 +159,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled("supplier_invoice")) { if (isModEnabled("supplier_invoice")) {
$nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn'); $nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn');
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$nbElements += $project->getElementCount('contract', 'contrat'); $nbElements += $project->getElementCount('contract', 'contrat');
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
@ -171,10 +171,10 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->mrp->enabled)) { if (!empty($conf->mrp->enabled)) {
$nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project'); $nbElements += $project->getElementCount('mrp', 'mrp_mo', 'fk_project');
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
$nbElements += $project->getElementCount('trip', 'deplacement'); $nbElements += $project->getElementCount('trip', 'deplacement');
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$nbElements += $project->getElementCount('expensereport', 'expensereport'); $nbElements += $project->getElementCount('expensereport', 'expensereport');
} }
if (!empty($conf->don->enabled)) { if (!empty($conf->don->enabled)) {
@ -183,7 +183,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->loan->enabled)) { if (!empty($conf->loan->enabled)) {
$nbElements += $project->getElementCount('loan', 'loan'); $nbElements += $project->getElementCount('loan', 'loan');
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$nbElements += $project->getElementCount('chargesociales', 'chargesociales'); $nbElements += $project->getElementCount('chargesociales', 'chargesociales');
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -209,7 +209,7 @@ function project_prepare_head(Project $project, $moreparam = '')
$h++; $h++;
} }
if (!empty($conf->eventorganization->enabled) && !empty($project->usage_organize_event)) { if (isModEnabled('eventorganization') && !empty($project->usage_organize_event)) {
$langs->load('eventorganization'); $langs->load('eventorganization');
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id; $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
$head[$h][1] = $langs->trans("EventOrganization"); $head[$h][1] = $langs->trans("EventOrganization");

View File

@ -142,9 +142,9 @@ function user_prepare_head(User $object)
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read)) || (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) || (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall)) || (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
) { ) {
// Bank // Bank
$head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id;

View File

@ -119,7 +119,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=product&amp;action=create&amp;type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&amp;leftmenu=product&amp;action=create&amp;type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&amp;leftmenu=product&amp;type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&amp;leftmenu=product&amp;type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&amp;type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->product->enabled', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&amp;type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&amp;type=0', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&amp;type=0&amp;search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__);

View File

@ -1812,11 +1812,11 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
if (isModEnabled('comptabilite')) { if (isModEnabled('comptabilite')) {
// Files // Files
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files'); $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'files', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
} }
// Bilan, resultats // Bilan, resultats
$newmenu->add("/compta/resultat/index.php?leftmenu=report&amp;mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca'); $newmenu->add("/compta/resultat/index.php?leftmenu=report&mainmenu=accountancy", $langs->trans("Reportings"), 0, $user->rights->compta->resultat->lire, '', $mainmenu, 'ca', 0, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) { if ($usemenuhider || empty($leftmenu) || preg_match('/report/', $leftmenu)) {
$newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire); $newmenu->add("/compta/resultat/index.php?leftmenu=report", $langs->trans("MenuReportInOut"), 1, $user->rights->compta->resultat->lire);
@ -1998,7 +1998,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
} }
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
$langs->load("stocks"); $langs->load("stocks");
$newmenu->add("/product/reassortlot.php?type=0", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
$newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire); $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
} }
if (isModEnabled('variants')) { if (isModEnabled('variants')) {

View File

@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules
if (isModEnabled("societe")) { if (isModEnabled("societe")) {
$typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect";
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$typeexample .= ($typeexample ? " / " : "")."3=Member"; $typeexample .= ($typeexample ? " / " : "")."3=Member";
} }
if (isModEnabled("societe")) { if (isModEnabled("societe")) {
@ -160,7 +160,7 @@ class modCategorie extends DolibarrModules
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {
$typeexample .= ($typeexample ? " / " : "")."10=Agenda event"; $typeexample .= ($typeexample ? " / " : "")."10=Agenda event";
} }
if (!empty($conf->website->enabled)) { if (isModEnabled('website')) {
$typeexample .= ($typeexample ? " / " : "")."11=Website page"; $typeexample .= ($typeexample ? " / " : "")."11=Website page";
} }
@ -297,7 +297,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3];
$this->export_label[$r] = 'CatMemberList'; $this->export_label[$r] = 'CatMemberList';
$this->export_icon[$r] = $this->picto; $this->export_icon[$r] = $this->picto;
$this->export_enabled[$r] = '!empty($conf->adherent->enabled)'; $this->export_enabled[$r] = 'isModEnabled("adherent")';
$this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname');
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.lastname'=>'Text', 'p.firstname'=>'Text');
@ -527,7 +527,7 @@ class modCategorie extends DolibarrModules
} }
// 3 Members // 3 Members
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$r++; $r++;
$this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3];
$this->import_label[$r] = "CatMembersLinks"; // Translation key $this->import_label[$r] = "CatMembersLinks"; // Translation key

View File

@ -520,7 +520,7 @@ class modSociete extends DolibarrModules
$this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode'); $this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode');
} }
// Add social networks fields // Add social networks fields
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
@ -693,7 +693,7 @@ class modSociete extends DolibarrModules
's.code_compta' => 'CustomerAccountancyCode', 's.code_compta' => 'CustomerAccountancyCode',
's.code_compta_fournisseur' => 'SupplierAccountancyCode' 's.code_compta_fournisseur' => 'SupplierAccountancyCode'
); );
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
@ -757,7 +757,7 @@ class modSociete extends DolibarrModules
's.note_public' => "NotePublic" 's.note_public' => "NotePublic"
); );
// Add social networks fields // Add social networks fields
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
@ -835,7 +835,7 @@ class modSociete extends DolibarrModules
's.rowid' => 'Id', 's.rowid' => 'Id',
's.lastname' => "Lastname", 's.lastname' => "Lastname",
); );
if (!empty($conf->socialnetworks->enabled)) { if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1"; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {

View File

@ -266,7 +266,7 @@ class modStock extends DolibarrModules
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')'; $this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
// Export stock including batch number // Export stock including batch number
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load("productbatch"); $langs->load("productbatch");
// This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch // This request is same than previous but without field ps.stock (real stock in warehouse) and with link to subtable productbatch
@ -340,7 +340,7 @@ class modStock extends DolibarrModules
'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product", 'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product' 'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product'
); // We define here only fields that use another icon that the one defined into export_icon ); // We define here only fields that use another icon that the one defined into export_icon
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$this->export_fields_array[$r]['sm.batch'] = 'Batch'; $this->export_fields_array[$r]['sm.batch'] = 'Batch';
$this->export_TypeFields_array[$r]['sm.batch'] = 'Text'; $this->export_TypeFields_array[$r]['sm.batch'] = 'Text';
$this->export_entities_array[$r]['sm.batch'] = 'movement'; $this->export_entities_array[$r]['sm.batch'] = 'movement';

View File

@ -141,7 +141,7 @@ class modWebhook extends DolibarrModules
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
// The language file dedicated to your module // The language file dedicated to your module
$this->langfiles = array("webhook"); $this->langfiles = array();
// Prerequisites // Prerequisites
$this->phpmin = array(5, 6); // Minimum version of PHP required by module $this->phpmin = array(5, 6); // Minimum version of PHP required by module

View File

@ -46,7 +46,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
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->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
@ -55,13 +55,13 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -47,7 +47,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
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->commande->enabled)) { if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
@ -56,13 +56,13 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
} }
if (!empty($conf->deplacement->enabled)) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
} }
if (isModEnabled('agenda')) { if (isModEnabled('agenda')) {

View File

@ -531,7 +531,7 @@ class pdf_eagle extends ModelePdfStockTransfer
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
// Lot / série // Lot / série
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$pdf->SetXY($this->posxlot, $curY); $pdf->SetXY($this->posxlot, $curY);
$pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C'); $pdf->MultiCell(($this->posxweightvol - $this->posxlot), 3, $object->lines[$i]->batch, '', 'C');
} }
@ -813,7 +813,7 @@ class pdf_eagle extends ModelePdfStockTransfer
$pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L'); $pdf->MultiCell($this->posxlot - $this->posxdesc, 2, $outputlangs->transnoentities("Description"), '', 'L');
} }
if (!empty($conf->productbatch->enabled) && $this->atLeastOneBatch) { if (isModEnabled('productbatch') && $this->atLeastOneBatch) {
$pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height); $pdf->line($this->posxlot - 1, $tab_top, $this->posxlot - 1, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxlot, $tab_top + 1); $pdf->SetXY($this->posxlot, $tab_top + 1);

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
} }
@ -254,7 +254,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) {
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
// Customer Categories // Customer Categories
print '<tr><td>'.$langs->trans("CustomersCategoryShort"); print '<tr><td>'.$langs->trans("CustomersCategoryShort");
if (!empty($array_query['cust_categ'])) { if (!empty($array_query['cust_categ'])) {
@ -451,7 +451,7 @@ print '</td></tr></table>';
print '</td><td>'."\n"; print '</td><td>'."\n";
print '</td></tr>'."\n"; print '</td></tr>'."\n";
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
// Customer Categories // Customer Categories
print '<tr><td>'.$langs->trans("ContactCategoriesShort"); print '<tr><td>'.$langs->trans("ContactCategoriesShort");
if (!empty($array_query['contact_categ'])) { if (!empty($array_query['contact_categ'])) {

View File

@ -94,17 +94,17 @@ if ($module == 'propal') {
} }
//else dol_print_error('','Bad value '.$module.' for param module'); //else dol_print_error('','Bad value '.$module.' for param module');
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
$typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else { } else {
$typeofdata = 'textarea:12:95%'; $typeofdata = 'textarea:12:95%';
} }
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) {
$typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else { } else {
$typeofdatapub = 'textarea:12:95%'; $typeofdatapub = 'textarea:12:95%';
} }
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) { if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) {
$typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. $typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else { } else {
$typeofdatapriv = 'textarea:12:95%'; $typeofdatapriv = 'textarea:12:95%';

View File

@ -30,7 +30,7 @@ print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br><b
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'free')."</strong><br><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'free')."</strong><br><br>\n";
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
print '<div id="order"></div>'; print '<div id="order"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'order')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'order')."</strong><br>\n";
@ -74,7 +74,7 @@ if (isModEnabled('facture')) {
} }
print '<br>'; print '<br>';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
print '<div id="contractline"></div>'; print '<div id="contractline"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'contractline')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'contractline')."</strong><br>\n";
@ -96,7 +96,7 @@ if (!empty($conf->contrat->enabled)) {
} }
print '<br>'; print '<br>';
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
print '<div id="membersubscription"></div>'; print '<div id="membersubscription"></div>';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':</span><br>'; print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':</span><br>';
print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'membersubscription')."</strong><br>\n"; print '<strong class="wordbreak">'.getOnlinePaymentUrl(1, 'membersubscription')."</strong><br>\n";

View File

@ -71,7 +71,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
// Proposals to order // Proposals to order
if ($action == 'PROPAL_CLOSE_SIGNED') { if ($action == 'PROPAL_CLOSE_SIGNED') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) { if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER)) {
$object->fetchObjectLinked(); $object->fetchObjectLinked();
if (!empty($object->linkedObjectsIds['commande'])) { if (!empty($object->linkedObjectsIds['commande'])) {
setEventMessages($langs->trans("OrderExists"), null, 'warnings'); setEventMessages($langs->trans("OrderExists"), null, 'warnings');
@ -142,7 +142,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// First classify billed the order to allow the proposal classify process // First classify billed the order to allow the proposal classify process
if (!empty($conf->commande->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) { if (isModEnabled('commande') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) {
$object->fetchObjectLinked('', 'commande', $object->id, $object->element); $object->fetchObjectLinked('', 'commande', $object->id, $object->element);
if (!empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0; $totalonlinkedelements = 0;
@ -222,7 +222,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
} }
// Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set. // Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set.
if (!empty($conf->supplier_proposal->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) { if (isModEnabled('supplier_proposal') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) {
$object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element); $object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element);
if (!empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0; $totalonlinkedelements = 0;
@ -272,7 +272,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'BILL_PAYED') { if ($action == 'BILL_PAYED') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->commande->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) { if (isModEnabled('commande') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER)) {
$object->fetchObjectLinked('', 'commande', $object->id, $object->element); $object->fetchObjectLinked('', 'commande', $object->id, $object->element);
if (!empty($object->linkedObjects)) { if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0; $totalonlinkedelements = 0;
@ -296,7 +296,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (!empty($conf->commande->enabled) && isModEnabled("expedition") && !empty($conf->workflow->enabled) && if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) &&
( (
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) || (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING) && ($action == 'SHIPPING_VALIDATE')) ||
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED')) (!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED) && ($action == 'SHIPPING_CLOSED'))

View File

@ -133,7 +133,7 @@ class Cronjob extends CommonObject
public $status; public $status;
/** /**
* @var int Is job processing * @var int Is job running ?
*/ */
public $processing; public $processing;
@ -143,12 +143,12 @@ class Cronjob extends CommonObject
public $pid; public $pid;
/** /**
* @var int ID * @var int User ID of creation
*/ */
public $fk_user_author; public $fk_user_author;
/** /**
* @var int ID * @var int User ID of last modification
*/ */
public $fk_user_mod; public $fk_user_mod;
@ -1513,10 +1513,12 @@ class Cronjobline
public $datenextrun = ''; public $datenextrun = '';
public $dateend = ''; public $dateend = '';
public $datestart = ''; public $datestart = '';
public $datelastresult = '';
public $lastresult = ''; public $lastresult = '';
public $lastoutput; public $lastoutput;
public $unitfrequency; public $unitfrequency;
public $frequency; public $frequency;
public $processing;
/** /**
* @var int Status * @var int Status
@ -1534,8 +1536,10 @@ class Cronjobline
public $fk_user_mod; public $fk_user_mod;
public $note; public $note;
public $note_private;
public $nbrun; public $nbrun;
public $libname; public $libname;
public $test;
/** /**
* Constructor * Constructor

View File

@ -50,7 +50,7 @@ if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) {
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
); );
} }
if (!empty($conf->adherent->enabled)) { if (isModEnabled('adherent')) {
$arrayofparameters['Member'] = array( $arrayofparameters['Member'] = array(
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')),
); );

View File

@ -308,7 +308,7 @@ if ($action == 'create') { // Create. Seems to no be used
* Delivery * Delivery
*/ */
if ($typeobject == 'commande' && $expedition->origin_id > 0 && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($expedition->origin_id); $objectsrc->fetch($expedition->origin_id);
} }
@ -400,7 +400,7 @@ if ($action == 'create') { // Create. Seems to no be used
*/ */
// Document origine // Document origine
if ($typeobject == 'commande' && $expedition->origin_id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) {
print '<tr><td class="titlefield">'.$langs->trans("RefOrder").'</td>'; print '<tr><td class="titlefield">'.$langs->trans("RefOrder").'</td>';
$order = new Commande($db); $order = new Commande($db);
$order->fetch($expedition->origin_id); $order->fetch($expedition->origin_id);

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
if (isModEnabled("propal")) { 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 (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }

View File

@ -319,16 +319,16 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); $rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); $rowspan++; $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); $rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
} }
if (!empty($conf->supplier_proposal->enabled)) { if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
$rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); $rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
} }
@ -338,7 +338,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) { if (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")) {
$rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); $rowspan++; $sectionauto[] = array('position'=>90, 'level'=>1, 'module'=>'invoice_supplier', 'test'=>(isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$langs->load("compta"); $langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
$rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT"))); $rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
@ -355,11 +355,11 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$langs->load("interventions"); $langs->load("interventions");
$rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); $rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$langs->load("trips"); $langs->load("trips");
$rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); $rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
} }
if (!empty($conf->holiday->enabled)) { if (isModEnabled('holiday')) {
$langs->load("holiday"); $langs->load("holiday");
$rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
} }
@ -372,7 +372,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$langs->load("mrp"); $langs->load("mrp");
$rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); $rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
} }
if (!empty($conf->recruitment->enabled)) { if (isModEnabled('recruitment')) {
$langs->load("recruitment"); $langs->load("recruitment");
$rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); $rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
} }

View File

@ -122,16 +122,16 @@ if (isModEnabled("societe")) {
if (isModEnabled("propal")) { if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
} }
if (!empty($conf->commande->enabled)) { if (isModEnabled('commande')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders")));
} }
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
} }
if (!empty($conf->supplier_proposal->enabled)) { if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals"))); $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
} }
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
@ -140,7 +140,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices"))); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")), 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierInvoices")));
} }
if (!empty($conf->tax->enabled)) { if (isModEnabled('tax')) {
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -149,10 +149,10 @@ if (isModEnabled('project')) {
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
} }
if (!empty($conf->expensereport->enabled)) { if (isModEnabled('expensereport')) {
$langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports"))); $langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
} }
if (!empty($conf->holiday->enabled)) { if (isModEnabled('holiday')) {
$langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); $langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
} }
if (isModEnabled("banque")) { if (isModEnabled("banque")) {
@ -161,7 +161,7 @@ if (isModEnabled("banque")) {
if (!empty($conf->mrp->enabled)) { if (!empty($conf->mrp->enabled)) {
$langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
} }
if (!empty($conf->recruitment->enabled)) { if (isModEnabled('recruitment')) {
$langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications")));
} }

View File

@ -220,7 +220,7 @@ if (!empty($withproject)) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -243,7 +243,7 @@ if (!empty($withproject)) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -205,7 +205,7 @@ if (!empty($withproject)) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -228,7 +228,7 @@ if (!empty($withproject)) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -176,7 +176,7 @@ if (!empty($withproject)) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -199,7 +199,7 @@ if (!empty($withproject)) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -300,7 +300,7 @@ if ($projectid > 0) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -323,7 +323,7 @@ if ($projectid > 0) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.($project->usage_organize_event ? ' checked="checked"' : '').'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.($project->usage_organize_event ? ' checked="checked"' : '').'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -249,7 +249,7 @@ if (!empty($withproject)) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -272,7 +272,7 @@ if (!empty($withproject)) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -427,7 +427,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print '<table class="border tableforfield centpercent">'; print '<table class="border tableforfield centpercent">';
// Usage // Usage
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || isModEnabled('eventorganization')) {
print '<tr><td class="tdtop">'; print '<tr><td class="tdtop">';
print $langs->trans("Usage"); print $langs->trans("Usage");
print '</td>'; print '</td>';
@ -450,7 +450,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
print '<br>'; print '<br>';
} }
if (!empty($conf->eventorganization->enabled)) { if (isModEnabled('eventorganization')) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong"); $htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);

View File

@ -71,7 +71,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
/* BEGIN MODULEBUILDER DRAFT MYOBJECT /* BEGIN MODULEBUILDER DRAFT MYOBJECT
// Draft MyObject // Draft MyObject
if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) if (isModEnabled('eventorganization') && $user->rights->eventorganization->read)
{ {
$langs->load("orders"); $langs->load("orders");
@ -152,7 +152,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
/* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT
// Last modified myobject // Last modified myobject
if (! empty($conf->eventorganization->enabled) && $user->rights->eventorganization->read) if (isModEnabled('eventorganization') && $user->rights->eventorganization->read)
{ {
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."eventorganization_myobject as s"; $sql.= " FROM ".MAIN_DB_PREFIX."eventorganization_myobject as s";

View File

@ -53,7 +53,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
if (isModEnabled("propal")) { 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->productbatch->enabled)) { if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -67,7 +67,7 @@ $langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders'
if (!empty($conf->incoterm->enabled)) { if (!empty($conf->incoterm->enabled)) {
$langs->load('incoterm'); $langs->load('incoterm');
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$langs->load('productbatch'); $langs->load('productbatch');
} }
@ -258,7 +258,7 @@ if (empty($reshook)) {
$stockLocation = "ent1".$i."_0"; $stockLocation = "ent1".$i."_0";
$qty = "qtyl".$i; $qty = "qtyl".$i;
if (!empty($conf->productbatch->enabled) && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number
if (GETPOSTISSET($batch)) { if (GETPOSTISSET($batch)) {
//shipment line with batch-enable product //shipment line with batch-enable product
$qty .= '_'.$j; $qty .= '_'.$j;
@ -875,7 +875,7 @@ if ($action == 'create') {
// Ref // Ref
print '<tr><td class="titlefieldcreate fieldrequired">'; print '<tr><td class="titlefieldcreate fieldrequired">';
if ($origin == 'commande' && !empty($conf->commande->enabled)) { if ($origin == 'commande' && isModEnabled('commande')) {
print $langs->trans("RefOrder"); print $langs->trans("RefOrder");
} }
if ($origin == 'propal' && isModEnabled("propal")) { if ($origin == 'propal' && isModEnabled("propal")) {
@ -1033,7 +1033,7 @@ if ($action == 'create') {
$i = 0; $i = 0;
while ($i < $numAsked) { while ($i < $numAsked) {
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; print 'jQuery("#qtyl'.$i.'_'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
} }
$i++; $i++;
@ -1552,7 +1552,7 @@ if ($action == 'create') {
if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$disabled = ''; $disabled = '';
if (!empty($conf->productbatch->enabled) && $product->hasbatch()) { if (isModEnabled('productbatch') && $product->hasbatch()) {
$disabled = 'disabled="disabled"'; $disabled = 'disabled="disabled"';
} }
if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty. if ($warehouse_selected_id <= 0) { // We did not force a given warehouse, so we won't have no warehouse to change qty.
@ -1714,7 +1714,7 @@ if ($action == 'create') {
$totalVolume = $tmparray['volume']; $totalVolume = $tmparray['volume'];
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
@ -1779,7 +1779,7 @@ if ($action == 'create') {
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
print '<tr><td>'; print '<tr><td>';
print $langs->trans("RefOrder").'</td>'; print $langs->trans("RefOrder").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
@ -2048,7 +2048,7 @@ if ($action == 'create') {
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {
print $langs->trans("WarehouseSource").' - '; print $langs->trans("WarehouseSource").' - ';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print $langs->trans("Batch"); print $langs->trans("Batch");
} }
print '</td>'; print '</td>';
@ -2062,7 +2062,7 @@ if ($action == 'create') {
print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>'; print '<td class="left linecolwarehousesource">'.$langs->trans("WarehouseSource").'</td>';
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>'; print '<td class="left linecolbatch">'.$langs->trans("Batch").'</td>';
} }
} }
@ -2358,7 +2358,7 @@ if ($action == 'create') {
} }
// Batch number managment // Batch number managment
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
if (isset($lines[$i]->detail_batch)) { if (isset($lines[$i]->detail_batch)) {
print '<!-- Detail of lot -->'; print '<!-- Detail of lot -->';
print '<td class="linecolbatch">'; print '<td class="linecolbatch">';
@ -2437,7 +2437,7 @@ if ($action == 'create') {
if ($origin && $origin_id > 0) { if ($origin && $origin_id > 0) {
$colspan++; $colspan++;
} }
if (!empty($conf->productbatch->enabled)) { if (isModEnabled('productbatch')) {
$colspan++; $colspan++;
} }
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
if (isModEnabled("propal")) { 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 (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
} }
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php';
@ -625,7 +625,7 @@ class Expedition extends CommonObject
$this->fetch_optionals(); $this->fetch_optionals();
// Fix Get multicurrency param for transmited // Fix Get multicurrency param for transmited
if (!empty($conf->multicurrency->enabled)) { if (isModEnabled('multicurrency')) {
if (!empty($this->multicurrency_code)) { if (!empty($this->multicurrency_code)) {
$this->multicurrency_code = $this->thirdparty->multicurrency_code; $this->multicurrency_code = $this->thirdparty->multicurrency_code;
} }
@ -965,7 +965,7 @@ class Expedition extends CommonObject
} }
// If product need a batch number, we should not have called this function but addline_batch instead. // If product need a batch number, we should not have called this function but addline_batch instead.
if (!empty($conf->productbatch->enabled) && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) { if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) {
$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH'; $this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH';
return -4; return -4;
} }
@ -1291,7 +1291,7 @@ class Expedition extends CommonObject
} }
// delete batch expedition line // delete batch expedition line
if (!$error && $conf->productbatch->enabled) { if (!$error && isModEnabled('productbatch')) {
$shipmentlinebatch = new ExpeditionLineBatch($this->db); $shipmentlinebatch = new ExpeditionLineBatch($this->db);
if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) { if ($shipmentlinebatch->deleteFromShipment($this->id) < 0) {
$error++; $this->errors[] = "Error ".$this->db->lasterror(); $error++; $this->errors[] = "Error ".$this->db->lasterror();
@ -1716,7 +1716,7 @@ class Expedition extends CommonObject
} }
// Detail of batch // Detail of batch
if (!empty($conf->productbatch->enabled) && $obj->line_id > 0 && $obj->product_tobatch > 0) { if (isModEnabled('productbatch') && $obj->line_id > 0 && $obj->product_tobatch > 0) {
$newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product); $newdetailbatch = $shipmentlinebatch->fetchAll($obj->line_id, $obj->fk_product);
if (is_array($newdetailbatch)) { if (is_array($newdetailbatch)) {
@ -2901,7 +2901,7 @@ class ExpeditionLigne extends CommonObjectLine
// update lot // update lot
if (!empty($batch) && $conf->productbatch->enabled) { if (!empty($batch) && isModEnabled('productbatch')) {
dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch"); dol_syslog(get_class($this)."::update expedition batch id=$expedition_batch_id, batch_id=$batch_id, batch=$batch");
if (empty($batch_id) || empty($this->fk_product)) { if (empty($batch_id) || empty($this->fk_product)) {

View File

@ -53,7 +53,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }
@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) {
print '<table class="border centpercent tableforfield">'; print '<table class="border centpercent tableforfield">';
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
print '<tr><td class="titlefield">'; print '<tr><td class="titlefield">';
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);

View File

@ -577,7 +577,7 @@ if ($user->rights->user->user->lire) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
@ -588,7 +588,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');

View File

@ -51,7 +51,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Linked documents // Linked documents
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) { if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) {
$objectsrc = new Commande($db); $objectsrc = new Commande($db);
$objectsrc->fetch($object->$typeobject->id); $objectsrc->fetch($object->$typeobject->id);
} }

View File

@ -451,7 +451,7 @@ if ($step == 1 || !$datatoexport) {
print $label; print $label;
print '</td><td class="right">'; print '</td><td class="right">';
if ($objexport->array_export_perms[$key]) { if ($objexport->array_export_perms[$key]) {
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').'</a>'; print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.'&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15"').'</a>';
} else { } else {
print '<span class="opacitymedium">'.$langs->trans("NotEnoughPermissions").'</span>'; print '<span class="opacitymedium">'.$langs->trans("NotEnoughPermissions").'</span>';
} }

View File

@ -41,7 +41,7 @@ if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php';
} }
@ -241,7 +241,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url);
$form = new Form($db); $form = new Form($db);
$companystatic = new Societe($db); $companystatic = new Societe($db);
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$contratstatic = new Contrat($db); $contratstatic = new Contrat($db);
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -275,7 +275,7 @@ if ($action == 'create') {
if (isModEnabled('project') && $object->fk_project > 0) { if (isModEnabled('project') && $object->fk_project > 0) {
$rowspan++; $rowspan++;
} }
if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { if (isModEnabled('contrat') && $object->fk_contrat > 0) {
$rowspan++; $rowspan++;
} }
@ -328,7 +328,7 @@ if ($action == 'create') {
} }
// Contrat // Contrat
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$formcontract = new FormContract($db); $formcontract = new FormContract($db);
print "<tr><td>".$langs->trans("Contract")."</td><td>"; print "<tr><td>".$langs->trans("Contract")."</td><td>";
$contractid = GETPOST('contractid') ?GETPOST('contractid') : $object->fk_contract; $contractid = GETPOST('contractid') ?GETPOST('contractid') : $object->fk_contract;
@ -539,7 +539,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($object->description)."</td></tr>"; print '<tr><td>'.$langs->trans("Description").'</td><td colspan="3">'.nl2br($object->description)."</td></tr>";
// Contract // Contract
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$langs->load('contracts'); $langs->load('contracts');
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
@ -800,7 +800,7 @@ if ($action == 'create') {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -834,7 +834,7 @@ if ($action == 'create') {
print '<td>'.$langs->trans("None").'</td>'; print '<td>'.$langs->trans("None").'</td>';
} }
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
print '<td>'; print '<td>';
if ($objp->fk_contrat > 0) { if ($objp->fk_contrat > 0) {
$contratstatic->fetch($objp->fk_contrat); $contratstatic->fetch($objp->fk_contrat);

View File

@ -784,7 +784,7 @@ if (empty($reshook)) {
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$formcontract = new FormContract($db); $formcontract = new FormContract($db);
} }
if (isModEnabled('project')) { if (isModEnabled('project')) {
@ -1233,7 +1233,7 @@ if ($action == 'create') {
print '</tr>'; print '</tr>';
// Contract // Contract
if (!empty($conf->contrat->enabled)) { if (isModEnabled('contrat')) {
$langs->load('contracts'); $langs->load('contracts');
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';

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