Merge branch 'develop' into develop#3

This commit is contained in:
Hystepik 2022-09-07 14:39:00 +02:00 committed by GitHub
commit ca78b4bc50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
659 changed files with 6540 additions and 5067 deletions

View File

@ -20,6 +20,7 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
***** ChangeLog for 16.0.0 compared to 15.0.0 ***** ***** ChangeLog for 16.0.0 compared to 15.0.0 *****
@ -27,7 +28,7 @@ Following changes may create regressions for some external modules, but were nec
For users: For users:
--------------- ---------------
NEW: PHP 8.1 compatibility. NEW: PHP 8.1 compatibility:
Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending
on the PHP setup). Removal of all PHP warnings on server side is planned for v17. on the PHP setup). Removal of all PHP warnings on server side is planned for v17.
NEW: Support for recurring purchase invoices. NEW: Support for recurring purchase invoices.
@ -41,6 +42,7 @@ NEW: Accept 'auto' for ref of object on import of purchase order/proposal
NEW: Accountancy - Add more filters and info on page to bind accounting accounts NEW: Accountancy - Add more filters and info on page to bind accounting accounts
NEW: Accountancy - Add subledger account when generate a transaction with a deposit invoice NEW: Accountancy - Add subledger account when generate a transaction with a deposit invoice
NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list) NEW: Accountancy - Add a massaction to preselect an account (customer and supplier list)
NEW: Accountancy - Add hidden feature for accounting reconciliation
NEW: ACE Editor is restored at same cursor position after a save. NEW: ACE Editor is restored at same cursor position after a save.
NEW: Add "addMoreActionsButtons" hook to subscription form NEW: Add "addMoreActionsButtons" hook to subscription form
NEW: Add an option in GUI to show a Quick add button into top menu bar NEW: Add an option in GUI to show a Quick add button into top menu bar
@ -49,9 +51,6 @@ NEW: Add column date of Signature on proposal list
NEW: Add column template invoice in invoice list NEW: Add column template invoice in invoice list
NEW: Add column "Total HT" to products array on document creation card NEW: Add column "Total HT" to products array on document creation card
NEW: Add configuration for text color of button action NEW: Add configuration for text color of button action
NEW: Add constant to hide categories in TakePos
NEW: Add constant to show category description in TakePos
NEW: Add constant to show only the products in stock in TakePos
NEW: Add entity filter in exports NEW: Add entity filter in exports
NEW: Show the event block on recurring invoices #20870 NEW: Show the event block on recurring invoices #20870
NEW: Add filter "opportunity status" on statistics of projects. NEW: Add filter "opportunity status" on statistics of projects.
@ -104,29 +103,33 @@ NEW: Module BOM - Add tabs for nets Bom
NEW: Module BOM - Add the possibility to add sub-BOMs to BOM NEW: Module BOM - Add the possibility to add sub-BOMs to BOM
NEW: Module Recruitment - Add a public page with all list of open job positions. NEW: Module Recruitment - Add a public page with all list of open job positions.
NEW: Module Recruitment - Add a tab with list of application on the jobposition file. NEW: Module Recruitment - Add a tab with list of application on the jobposition file.
NEW: Module website now supports the multicompany module NEW: Module Website - supports now the multicompany module
NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...) NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens) NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens)
NEW: on redirect of page in website module, GET parameters are kept. NEW: on redirect of page in website module, GET parameters are kept.
NEW: optional display warning icons on ticket list NEW: optional display warning icons on ticket list
NEW: option to default check "notify tier at creation" in ticket module
NEW: option update prices on proposal cloning
NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439) NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439)
NEW: possibility to consume multiple batch NEW: possibility to consume multiple batch
NEW: Reverse movement product consumption NEW: Reverse movement product consumption
NEW: Send email to the supplier order contact NEW: Send email to the supplier order contact
NEW: New permission to report time on timesheet. NEW: add permission to report time on timesheet
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
NEW: Show number of votes into the label of tab "Results" of a survey
NEW: Some core tables are created only at module activation NEW: Some core tables are created only at module activation
NEW: split consumption line on MO NEW: MRP - split consumption line on MO
NEW: Proposals - option update prices on proposal cloning
NEW: stock filter in reassort lists NEW: stock filter in reassort lists
NEW: stock limit in stock export CSV NEW: stock limit in stock export CSV
NEW: Supplier order - Show ref supplier of reception in linked object block NEW: Supplier order - Show ref supplier of reception in linked object block
NEW: support user_modif in order NEW: support user_modif in order
NEW: Surveys - Show number of votes into the label of tab "Results" of a survey
NEW: TakePOS - barcode rule to insert product in TakePOS NEW: TakePOS - barcode rule to insert product in TakePOS
NEW: TakePOS - pagination on search results NEW: TakePOS - pagination on search results
NEW: TakePOS - show product reference NEW: TakePOS - show product reference
NEW: TakePOS - add constant to hide categories
NEW: TakePOS - add constant to show category description
NEW: TakePOS - add constant to show only the products in stock
NEW: Tickets - option to default check "notify tier at creation"
NEW: Tickets - Trigger: allow to automatically send messages on new tickets
NEW: The backup tools has an "lowmemory" option for mysqldump on large database NEW: The backup tools has an "lowmemory" option for mysqldump on large database
NEW: The 'reposition' class works on ajax constantonoff that make redirects NEW: The 'reposition' class works on ajax constantonoff that make redirects
NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice
@ -134,10 +137,9 @@ NEW: thumbnail field in product list
NEW: total mark rate in list NEW: total mark rate in list
NEW: uncheck "send message" by default on a ticket when private messages has been checked NEW: uncheck "send message" by default on a ticket when private messages has been checked
NEW: VAT Report by month - Show detail by rate and also by code NEW: VAT Report by month - Show detail by rate and also by code
NEW: Ticket triggers: allow to automatically send messages on new tickets
NEW: Accountancy - Add hidden feature for accounting reconciliation
NEW: Can store the session into database (instead of beeing managed by PHP) NEW: Can store the session into database (instead of beeing managed by PHP)
NEW: Added MMK currency (Myanmar Kyat) NEW: Added MMK currency (Myanmar Kyat)
NEW: On a form to send an email, we show all emails of contacts of object
Modules Modules
NEW: Module Partnership Management NEW: Module Partnership Management
@ -159,20 +161,17 @@ NEW: Identification of tr is possible with by attribute data-id on some pages
NEW: Import with select boxes V2 NEW: Import with select boxes V2
NEW: Can use current entity filter on 'chkbxlst' NEW: Can use current entity filter on 'chkbxlst'
NEW: Creation of the function select_bom() used to display bom select list NEW: Creation of the function select_bom() used to display bom select list
NEW: add printFieldListWhere hook in product reassort card
NEW: Add trigger and event on completely received status change NEW: Add trigger and event on completely received status change
NEW: Add utility function send backup by mail NEW: Add utility function send backup by mail
NEW: add WordPress OAuth to save a token (not SSO) NEW: add WordPress OAuth to save a token (not SSO)
NEW: A module can embed a sql script run at each Dolibarr upgrade NEW: A module can embed a sql script run at each Dolibarr upgrade
NEW: Add option INVOICEREC_SET_AUTOFILL_DATE_START/END
NEW: Add param to keep the robot=index meta tag on public pages NEW: Add param to keep the robot=index meta tag on public pages
NEW: Add method hintindex() in database handlers. NEW: Add method hintindex() in database handlers.
NEW: add modifications for new function "$db->prefix()" NEW: add modifications for new function "$db->prefix()"
NEW: addMoreActionsButtonsList hook for button in list NEW: addMoreActionsButtonsList hook for button in list
NEW: Standardize a lot of code. NEW: Standardize a lot of code.
NEW: Add a protection into PHPunit to avoid to forget a var_dump NEW: Add a protection into PHPunit to avoid to forget a var_dump
NEW: Add hidden option on contract PDF line to hide qty and price
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
API: API:
NEW: API Proposals - Add POST lines NEW: API Proposals - Add POST lines
@ -189,9 +188,9 @@ Hooks:
NEW: Hook getNomUrl available everywhere in tooltip of ref links NEW: Hook getNomUrl available everywhere in tooltip of ref links
NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook NEW: Add hooks: selectContactListWhere hook, selectThirdpartyListWhere hook
NEW: Add hook before the public ticket list NEW: Add hook before the public ticket list
NEW: Add hook doaction in takepos invoice
NEW: Add hook for Notif NEW: Add hook for Notif
NEW: Add hook for more buttons NEW: Add hook for more buttons
NEW: add hook printFieldListWhere in product ressort card
NEW: Add hook printFieldListWhere in "show_contacts" function NEW: Add hook printFieldListWhere in "show_contacts" function
NEW: Add hook printFieldWhere in load_state_board function NEW: Add hook printFieldWhere in load_state_board function
NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts NEW: Add hooks contact tab badge and hooks parameter for avoid conflicts
@ -206,6 +205,12 @@ NEW: Add hook to getSellPrice function
NEW: TakePos - add hooks complete product display NEW: TakePos - add hooks complete product display
NEW: TakePos - add hooks for cart display NEW: TakePos - add hooks for cart display
NEW: TakePos - add hooks to complete ajax return array NEW: TakePos - add hooks to complete ajax return array
NEW: TakePOS - add hook doaction in TakePOS invoice
Config Options:
NEW: Add hidden option on contract PDF line to hide qty and price
NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
WARNING: WARNING:

View File

@ -56,7 +56,7 @@ if (empty($argv[1])) {
$i=0; $i=0;
while ($i < $argc) { while ($i < $argc) {
if (! empty($argv[$i])) { if (!empty($argv[$i])) {
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ... parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
} }
if (preg_match('/includeconstant=/', $argv[$i])) { if (preg_match('/includeconstant=/', $argv[$i])) {

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

@ -152,7 +152,7 @@ $user->rights->propal->creer=1;
$user->rights->propal->propal_advance->validate=1; $user->rights->propal->propal_advance->validate=1;
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { if (!empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php")) {
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"; require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
} }

View File

@ -218,7 +218,7 @@ if ($date == 'all') {
} }
// Replace database handler // Replace database handler
if (! empty($argv[4])) { if (!empty($argv[4])) {
$db->close(); $db->close();
unset($db); unset($db);
$db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); $db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]);

View File

@ -487,7 +487,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$pkey = $line; $pkey = $line;
$linenumber ++; $linenumber ++;
if (! empty($lines[$linenumber])) { if (!empty($lines[$linenumber])) {
$line = $lines[$linenumber]; $line = $lines[$linenumber];
} else { } else {
$line = ''; $line = '';
@ -517,7 +517,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
if (substr($line, 0, 12) == "CREATE INDEX") { if (substr($line, 0, 12) == "CREATE INDEX") {
$matches = array(); $matches = array();
preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); preg_match('/CREATE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches);
if (! empty($matches[3])) { if (!empty($matches[3])) {
$indexname = $matches[1]; $indexname = $matches[1];
$tablename = str_replace('public.', '', $matches[2]); $tablename = str_replace('public.', '', $matches[2]);
$columns = $matches[3]; $columns = $matches[3];
@ -529,7 +529,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") { if (substr($line, 0, 19) == "CREATE UNIQUE INDEX") {
$matches = array(); $matches = array();
preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches); preg_match('/CREATE UNIQUE INDEX "?([a-zA-Z0-9_]*)"? ON "?([a-zA-Z0-9_\.]*)"? USING btree \((.*)\);/', $line, $matches);
if (! empty($matches[3])) { if (!empty($matches[3])) {
$indexname = $matches[1]; $indexname = $matches[1];
$tablename = str_replace('public.', '', $matches[2]); $tablename = str_replace('public.', '', $matches[2]);
$columns = str_replace('"', '', $matches[3]); $columns = str_replace('"', '', $matches[3]);

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

@ -309,11 +309,11 @@ class autoTranslator
{ {
// We want to be sure that src_lang and dest_lang are using 2 chars only // We want to be sure that src_lang and dest_lang are using 2 chars only
$tmp=explode('_', $src_lang); $tmp=explode('_', $src_lang);
if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) {
$src_lang=$tmp[0]; $src_lang=$tmp[0];
} }
$tmp=explode('_', $dest_lang); $tmp=explode('_', $dest_lang);
if (! empty($tmp[1]) && $tmp[0] == $tmp[1]) { if (!empty($tmp[1]) && $tmp[0] == $tmp[1]) {
$dest_lang=$tmp[0]; $dest_lang=$tmp[0];
} }
@ -349,7 +349,7 @@ class autoTranslator
// now, process the JSON string // now, process the JSON string
$json = json_decode($body, true); $json = json_decode($body, true);
if ((! empty($json['responseStatus']) && $json['responseStatus'] != 200) if ((!empty($json['responseStatus']) && $json['responseStatus'] != 200)
|| count($json['data']['translations']) == 0) { || count($json['data']['translations']) == 0) {
print "Error: ".$json['responseStatus']." ".$url."\n"; print "Error: ".$json['responseStatus']." ".$url."\n";
return false; return false;

View File

@ -221,7 +221,7 @@ foreach ($dups as $string => $pages) {
// Loop on each line keword was found into file. // Loop on each line keword was found into file.
$listoffilesforthisentry=array(); $listoffilesforthisentry=array();
foreach ($lines as $line => $translatedvalue) { foreach ($lines as $line => $translatedvalue) {
if (! empty($listoffilesforthisentry[$file])) { if (!empty($listoffilesforthisentry[$file])) {
$duplicateinsamefile=1; $duplicateinsamefile=1;
} }
$listoffilesforthisentry[$file]=1; $listoffilesforthisentry[$file]=1;
@ -300,7 +300,7 @@ if ($web) {
// STEP 2 - Search key not used // STEP 2 - Search key not used
if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) { if ((!empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($argv[1]) && $argv[1]=='unused=true')) {
print "***** Strings in en_US that are never used:\n"; print "***** Strings in en_US that are never used:\n";
$unused=array(); $unused=array();

View File

@ -303,8 +303,8 @@ foreach ($filesToProcess as $fileToProcess) {
// String exists in both files and value into alternative language differs from main language but also from english files // String exists in both files and value into alternative language differs from main language but also from english files
// so we keep it. // so we keep it.
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] if ((!empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) && !empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)
) { ) {
//print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n"; //print "Key $key differs (aSecondary=".$aSecondary[$key].", aPrimary=".$aPrimary[$key].", aEnglish=".$aEnglish[$key].") so we add it into new secondary language (line: $cnt).\n";

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

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro> /* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -124,7 +124,8 @@ if (!empty($cat_id)) {
$arraykeyvalue = array(); $arraykeyvalue = array();
foreach ($accountingcategory->lines_cptbk as $key => $val) { foreach ($accountingcategory->lines_cptbk as $key => $val) {
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')'; $doc_ref = !empty($val->doc_ref) ? $val->doc_ref : '';
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : '');
} }
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
@ -332,7 +332,9 @@ if ($action == 'valid') {
$html = new Form($db); $html = new Form($db);
$formaccounting = new FormAccounting($db); $formaccounting = new FormAccounting($db);
llxHeader('', $langs->trans("CreateMvts")); $title = $langs->trans("CreateMvts");
llxHeader('', $title);
// Confirmation to delete the command // Confirmation to delete the command
if ($action == 'delete') { if ($action == 'delete') {
@ -341,7 +343,7 @@ if ($action == 'delete') {
} }
if ($action == 'create') { if ($action == 'create') {
print load_fiche_titre($langs->trans("CreateMvts")); print load_fiche_titre($title);
$object = new BookKeeping($db); $object = new BookKeeping($db);
$next_num_mvt = $object->getNextNumMvt('_tmp'); $next_num_mvt = $object->getNextNumMvt('_tmp');
@ -540,21 +542,24 @@ if ($action == 'create') {
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Date document export // Don't show in tmp mode, inevitably empty
print '<tr>'; if ($mode != "_tmp") {
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>'; // Date document export
print '<td>'; print '<tr>';
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;'; print '<td class="titlefield">' . $langs->trans("DateExport") . '</td>';
print '</td>'; print '<td>';
print '</tr>'; print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : '&nbsp;';
print '</td>';
print '</tr>';
// Date document validation // Date document validation
print '<tr>'; print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>'; print '<td class="titlefield">' . $langs->trans("DateValidation") . '</td>';
print '<td>'; print '<td>';
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;'; print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : '&nbsp;';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
}
// Validate // Validate
/* /*

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* *
@ -1136,6 +1136,9 @@ $totalarray = array();
$totalarray['nbfield'] = 0; $totalarray['nbfield'] = 0;
$total_debit = 0; $total_debit = 0;
$total_credit = 0; $total_credit = 0;
$totalarray['val'] = array ();
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);

View File

@ -824,17 +824,22 @@ print $hookmanager->resPrint;
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
$total_debit = 0;
$total_credit = 0;
$sous_total_debit = 0;
$sous_total_credit = 0;
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty $displayed_account_number = null; // Start with undefined to be able to distinguish with empty
// Loop on record // Loop on record
// -------------------------------------------------------------------- // --------------------------------------------------------------------
$i = 0; $i = 0;
$totalarray = array(); $totalarray = array();
$totalarray['val'] = array ();
$totalarray['nbfield'] = 0;
$total_debit = 0;
$total_credit = 0;
$sous_total_debit = 0;
$sous_total_credit = 0;
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$line = $object->lines[$i]; $line = $object->lines[$i];

View File

@ -1347,7 +1347,7 @@ class AccountancyExport
} }
print $nature_piece.$separator; print $nature_piece.$separator;
// RACI // RACI
// if (! empty($line->subledger_account)) { // if (!empty($line->subledger_account)) {
// if ($line->doc_type == 'supplier_invoice') { // if ($line->doc_type == 'supplier_invoice') {
// $racine_subledger_account = '40'; // $racine_subledger_account = '40';
// } elseif ($line->doc_type == 'customer_invoice') { // } elseif ($line->doc_type == 'customer_invoice') {
@ -1610,7 +1610,7 @@ class AccountancyExport
} }
print $nature_piece.$separator; print $nature_piece.$separator;
// RACI // RACI
// if (! empty($line->subledger_account)) { // if (!empty($line->subledger_account)) {
// if ($line->doc_type == 'supplier_invoice') { // if ($line->doc_type == 'supplier_invoice') {
// $racine_subledger_account = '40'; // $racine_subledger_account = '40';
// } elseif ($line->doc_type == 'customer_invoice') { // } elseif ($line->doc_type == 'customer_invoice') {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* *
@ -1667,7 +1667,9 @@ class BookKeeping extends CommonObject
$this->doc_type = $obj->doc_type; $this->doc_type = $obj->doc_type;
$this->date_creation = $this->db->jdate($obj->date_creation); $this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_modification = $this->db->jdate($obj->date_modification); $this->date_modification = $this->db->jdate($obj->date_modification);
$this->date_export = $this->db->jdate($obj->date_export); if ($mode != "_tmp") {
$this->date_export = $this->db->jdate($obj->date_export);
}
$this->date_validation = $this->db->jdate($obj->date_validation); $this->date_validation = $this->db->jdate($obj->date_validation);
} else { } else {
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
@ -1764,7 +1766,9 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$line->date_creation = $obj->date_creation; $line->date_creation = $obj->date_creation;
$line->date_modification = $obj->date_modification; $line->date_modification = $obj->date_modification;
$line->date_export = $obj->date_export; if ($mode != "_tmp") {
$line->date_export = $obj->date_export;
}
$line->date_validation = $obj->date_validation; $line->date_validation = $obj->date_validation;
$this->linesmvt[] = $line; $this->linesmvt[] = $line;

View File

@ -23,6 +23,8 @@
* \brief Home accounting module * \brief Home accounting module
*/ */
// 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/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2015-2018 Alexandre Spangaro <aspangaro@open-dsi.fr> /* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -16,7 +16,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/>.
*/ */
// $formatexportset ùust be defined // $formatexportset must be defined
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) { if (empty($conf) || !is_object($conf)) {
@ -24,11 +24,11 @@ if (empty($conf) || !is_object($conf)) {
exit; exit;
} }
$code = $conf->global->MAIN_INFO_ACCOUNTANT_CODE; $code = getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE');
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC; $prefix = getDolGlobalString('ACCOUNTING_EXPORT_PREFIX_SPEC');
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT; $format = getDolGlobalString('ACCOUNTING_EXPORT_FORMAT');
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME; $nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
$siren = $conf->global->MAIN_INFO_SIREN; $siren = getDolGlobalString('MAIN_INFO_SIREN');
$date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S'); $date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S');
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d'); $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');

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

@ -65,7 +65,7 @@ abstract class ActionsAdherentCardCommon
/*if (is_object($this->object) && method_exists($this->object,'fetch')) /*if (is_object($this->object) && method_exists($this->object,'fetch'))
{ {
if (! empty($id)) $this->object->fetch($id); if (!empty($id)) $this->object->fetch($id);
} }
else else
{*/ {*/

View File

@ -29,6 +29,8 @@
* \brief Page of a member * \brief Page of a member
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@ -44,9 +46,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal")); $langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal"));
// Get parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');

View File

@ -663,6 +663,8 @@ class Adherent extends CommonObject
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$nbrowsaffected = 0; $nbrowsaffected = 0;
$error = 0; $error = 0;
@ -1104,7 +1106,7 @@ class Adherent extends CommonObject
// Mise a jour // Mise a jour
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."'"; $sql .= " SET pass_crypted = '".$this->db->escape($password_crypted)."'";
//if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) //if (!empty($conf->global->DATABASE_PWD_ENCRYPTED))
if ($isencrypted) { if ($isencrypted) {
$sql .= ", pass = null"; $sql .= ", pass = null";
} else { } else {
@ -2057,7 +2059,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) {
@ -2077,7 +2079,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;
@ -2128,7 +2130,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

@ -27,19 +27,24 @@
* \brief Home page of membership module * \brief Home page of membership module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "members"));
$hookmanager = new HookManager($db); $hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('membersindex')); $hookmanager->initHooks(array('membersindex'));
// Load translation files required by the page
$langs->loadLangs(array("companies", "members"));
// Security check // Security check
$result = restrictedArea($user, 'adherent'); $result = restrictedArea($user, 'adherent');

View File

@ -27,14 +27,20 @@
* \brief Page to list all members of foundation * \brief Page to list all members of foundation
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("members", "companies")); $langs->loadLangs(array("members", "companies"));
// 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');
@ -42,6 +48,8 @@ $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array'); $toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
// Search fields
$search = GETPOST("search", 'alpha'); $search = GETPOST("search", 'alpha');
$search_ref = GETPOST("search_ref", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha');
$search_lastname = GETPOST("search_lastname", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha');
@ -1122,9 +1130,9 @@ while ($i < min($num, $limit)) {
} }
// Country // Country
if (!empty($arrayfields['country.code_iso']['checked'])) { if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="center">';
$tmparray = getCountry($obj->country, 'all'); $tmparray = getCountry($obj->country, 'all');
print $tmparray['label']; print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($tmparray['label']).'">';
print dol_escape_htmltag($tmparray['label']);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;

View File

@ -23,25 +23,34 @@
* \brief Tab for note of a member * \brief Tab for note of a member
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("companies", "members", "bills")); $langs->loadLangs(array("companies", "members", "bills"));
// Get parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alphanohtml'); $ref = GETPOST('ref', 'alphanohtml');
// Initialize objects
$object = new Adherent($db); $object = new Adherent($db);
$result = $object->fetch($id); $result = $object->fetch($id);
if ($result > 0) { if ($result > 0) {
$adht = new AdherentType($db); $adht = new AdherentType($db);
$result = $adht->fetch($object->typeid); $result = $adht->fetch($object->typeid);
} }
$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php $permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
// Fetch object // Fetch object
@ -120,7 +129,7 @@ if ($id) {
// Login // Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.dol_escape_htmltag($object->login).'</td></tr>';
} }
// Type // Type
@ -134,10 +143,10 @@ if ($id) {
print '</tr>'; print '</tr>';
// Company // Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>'; print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
// Civility // Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'&nbsp;</td>'; print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'</td>';
print '</tr>'; print '</tr>';
print "</table>"; print "</table>";

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

@ -107,7 +107,7 @@ print '* https://myphoneserver/phoneurl?login=__LOGIN__&password=__PASS__&caller
print '* sip:__PHONETO__@my.sip.server'; print '* sip:__PHONETO__@my.sip.server';
print '</span>'; print '</span>';
//if (! empty($user->clicktodial_url)) //if (!empty($user->clicktodial_url))
//{ //{
print '<br>'; print '<br>';
print info_admin($langs->trans("ValueOverwrittenByUserSetup")); print info_admin($langs->trans("ValueOverwrittenByUserSetup"));

View File

@ -644,7 +644,7 @@ if ($conf->banque->enabled) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
} else { } else {
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) {
@ -664,7 +664,7 @@ if ($conf->banque->enabled) {
if (isModEnabled('stock')) { if (isModEnabled('stock')) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">';
if (! empty($conf->use_javascript_ajax)) { if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
} else { } else {
if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {

View File

@ -146,7 +146,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; print '<tr class="oddeven"><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT // Write info on way to count VAT
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) //if (!empty($conf->global->MAIN_MODULE_COMPTABILITE))
//{ //{
// // print "<br>\n"; // // print "<br>\n";
// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); // // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));

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">';
@ -317,18 +318,22 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE
$offset = 0; $offset = 0;
$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,46 +487,46 @@ $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] = !empty($conf->project->enabled); $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] = !empty($conf->asset->enabled); $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)
$tabhelp = array(); $tabhelp = array();
@ -1028,10 +1028,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1048,10 +1051,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET active = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1068,10 +1074,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1088,10 +1097,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET favorite = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1108,10 +1120,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 1 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1128,10 +1143,13 @@ if (empty($reshook)) {
$rowidcol = "rowid"; $rowidcol = "rowid";
} }
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
if ($rowid) { if ($rowid) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) { } elseif ($code) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : ''); $sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET eec = 0 WHERE code = '".$db->escape(dol_escape_htmltag($code))."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} }
$result = $db->query($sql); $result = $db->query($sql);
@ -1140,6 +1158,8 @@ if (empty($reshook)) {
} }
} }
} }
/* /*
* View * View
*/ */

View File

@ -27,14 +27,17 @@ if (!defined('NOTOKENRENEWAL')) {
* \ingroup admin * \ingroup admin
* \brief Page des informations dolistore * \brief Page des informations dolistore
*/ */
require "../../../main.inc.php"; require "../../../main.inc.php";
// CORE
global $lang, $user, $conf;
require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
/*
* View
*/
top_httphead('image');
$dolistore = new Dolistore(); $dolistore = new Dolistore();
$id_product = GETPOST('id_product', 'int'); $id_product = GETPOST('id_product', 'int');
@ -51,7 +54,7 @@ try {
); );
//echo $url; //echo $url;
$request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
header('Content-type:image');
print $request['response']; print $request['response'];
} catch (PrestaShopWebserviceException $e) { } catch (PrestaShopWebserviceException $e) {
// Here we are dealing with errors // Here we are dealing with errors

View File

@ -22,6 +22,8 @@
* \brief Page to setup ECM (GED) module * \brief Page to setup ECM (GED) module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
@ -37,6 +39,8 @@ if (!$user->admin) {
/* /*
* Action * Action
*/ */
// set
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1]; $code = $reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
@ -47,6 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
} }
} }
// delete
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1]; $code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) { if (dolibarr_del_const($db, $code, $conf->entity) > 0) {

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,50 +387,142 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$connectstringserver = $object->getConnectStringIMAP($usessl); $connectstringserver = $object->getConnectStringIMAP($usessl);
if ($action == 'scan') { if ($action == 'scan') {
try { if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
if ($sourcedir) { if ($object->acces_type == 1) {
//$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); // Mode OAUth2 with PHP-IMAP
$connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir); 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",
]);
} }
if ($targetdir) { try {
//$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); $client->connect();
$connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir); } catch (ConnectionFailedException $e) {
print $e->getMessage();
} }
$timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT; $f = $client->getFolders(false, $object->source_directory);
$timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT; $nbemail = $f[0]->examine()["exists"];
$morehtml .= $nbemail;
dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread);
$result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect
$result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread);
$result3 = imap_timeout(IMAP_WRITETIMEOUT, 5);
$result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5);
dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4);
$connection = imap_open($connectstringsource, $object->login, $object->password);
//dol_syslog("end imap_open connection=".var_export($connection, true));
} catch (Exception $e) {
print $e->getMessage();
}
if (!$connection) {
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
if (function_exists('imap_last_error')) {
$morehtml .= '<br>'.imap_last_error();
}
dol_syslog("Error ".$morehtml, LOG_WARNING);
//var_dump(imap_errors())
} else { } else {
dol_syslog("Imap connected. Now we call imap_num_msg()"); try {
$morehtml .= imap_num_msg($connection); if ($sourcedir) {
} //$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
$connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir);
}
if ($targetdir) {
//$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
$connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir);
}
if ($connection) { $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT;
dol_syslog("Imap close"); $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT;
imap_close($connection);
dol_syslog("imap_open connectstring=".$connectstringsource." login=".$object->login." password=".$object->password." timeoutconnect=".$timeoutconnect." timeoutread=".$timeoutread);
$result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect); // timeout seems ignored with ssl connect
$result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread);
$result3 = imap_timeout(IMAP_WRITETIMEOUT, 5);
$result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5);
dol_syslog("result1=".$result1." result2=".$result2." result3=".$result3." result4=".$result4);
$connection = imap_open($connectstringsource, $object->login, $object->password);
//dol_syslog("end imap_open connection=".var_export($connection, true));
} catch (Exception $e) {
print $e->getMessage();
}
if (!$connection) {
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
if (function_exists('imap_last_error')) {
$morehtml .= '<br>'.imap_last_error();
}
dol_syslog("Error ".$morehtml, LOG_WARNING);
//var_dump(imap_errors())
} else {
dol_syslog("Imap connected. Now we call imap_num_msg()");
$morehtml .= imap_num_msg($connection);
}
if ($connection) {
dol_syslog("Imap close");
imap_close($connection);
}
} }
} else { } 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

@ -111,7 +111,7 @@ print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("TrackableSecurityEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print "</tr>\n"; print "</tr>\n";
// Loop on each event type // Loop on each event type

View File

@ -130,12 +130,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader( $help_yrl = 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura';
"",
$langs->trans("BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'
);
llxHeader("", $langs->trans("BillsSetup"), $help_url);
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';

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

@ -285,7 +285,7 @@ foreach($object->fields as $key => $val)
$sql .= "t.".$key.", "; $sql .= "t.".$key.", ";
} }
// 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) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
} }
// Add where from hooks // Add where from hooks

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,22 +179,22 @@ $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)) {
$elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty')); $elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty'));
} }
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject')); $elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
} }
if (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)) {
@ -823,7 +823,7 @@ if ($action == 'add') {
} elseif ($tmpfieldlist == 'joinfiles') { } elseif ($tmpfieldlist == 'joinfiles') {
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">'; print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="'.(isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1').'">';
} else { } else {
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>'; // print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(!empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
$okforextended = true; $okforextended = true;
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
$okforextended = false; $okforextended = false;
@ -1074,7 +1074,7 @@ if ($num) {
$okforextended = true; $okforextended = true;
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
$okforextended = false; $okforextended = false;
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%'); $doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
print $doleditor->Create(1); print $doleditor->Create(1);
} }
print '</td>'; print '</td>';

View File

@ -219,29 +219,6 @@ if ($action == 'add') {
} }
} }
// delete
if ($action == 'confirm_delete' && $confirm == 'yes') {
$db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."menu WHERE rowid = ".GETPOST('menuId', 'int');
$result = $db->query($sql);
if ($result == 0) {
$db->commit();
llxHeader();
setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs');
llxFooter();
exit;
} else {
$db->rollback();
$reload = 0;
$_GET["action"] = '';
$action = '';
}
}
/* /*

View File

@ -137,7 +137,7 @@ foreach ($modulesdir as $dir) {
} }
// We discard modules according to property disabled // We discard modules according to property disabled
//if (! empty($objMod->hidden)) $modulequalified=0; //if (!empty($objMod->hidden)) $modulequalified=0;
if ($modulequalified > 0) { if ($modulequalified > 0) {
$publisher = dol_escape_htmltag($objMod->getPublisher()); $publisher = dol_escape_htmltag($objMod->getPublisher());

View File

@ -378,7 +378,7 @@ print '<br>';
*/ */
/* Disable this, there is no trigger with elementtype 'withdraw' /* Disable this, there is no trigger with elementtype 'withdraw'
if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) if (!empty($conf->global->MAIN_MODULE_NOTIFICATION))
{ {
$langs->load("mails"); $langs->load("mails");
print load_fiche_titre($langs->trans("Notifications")); print load_fiche_titre($langs->trans("Notifications"));

View File

@ -471,7 +471,7 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width=
// Use 2 languages into PDF // Use 2 languages into PDF
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
//if (! empty($conf->global->MAIN_MULTILANGS)) //if (!empty($conf->global->MAIN_MULTILANGS))
//{ //{
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);

View File

@ -392,7 +392,7 @@ print '<br>';
*/ */
/* Disable this, there is no trigger with elementtype 'withdraw' /* Disable this, there is no trigger with elementtype 'withdraw'
if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) if (!empty($conf->global->MAIN_MODULE_NOTIFICATION))
{ {
$langs->load("mails"); $langs->load("mails");
print load_fiche_titre($langs->trans("Notifications")); print load_fiche_titre($langs->trans("Notifications"));

View File

@ -705,7 +705,7 @@ if (isModEnabled('facture'))
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp;</td><td class="right">'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp;</td><td class="right">';
if (! empty($conf->use_javascript_ajax)) if (!empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');
} }

View File

@ -180,13 +180,13 @@ $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"));
} }
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //if (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
//{ //{
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
print '<br>'; print '<br>';
@ -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 {
@ -239,7 +239,7 @@ if (!empty($conf->commande->enabled)) {
print "</td>\n</tr>\n"; print "</td>\n</tr>\n";
$found++; $found++;
//if (! empty($conf->expedition->enabled)) //if (!empty($conf->expedition->enabled))
//{ //{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -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

@ -468,7 +468,7 @@ if (isModEnabled('banque')) {
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">';
if (! empty($conf->use_javascript_ajax)) if (!empty($conf->use_javascript_ajax))
{ {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER'); print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER');
} }

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

@ -56,21 +56,23 @@ if (!$user->admin) {
accessforbidden(); accessforbidden();
} }
if ($file && !$what) {
//print DOL_URL_ROOT.'/dolibarr_export.php';
header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
exit;
}
$errormsg = ''; $errormsg = '';
$utils = new Utils($db);
/* /*
* Actions * Actions
*/ */
if ($file && !$what) {
//print DOL_URL_ROOT.'/dolibarr_export.php';
header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
exit;
}
if ($action == 'delete') { if ($action == 'delete') {
$file = $conf->admin->dir_output.'/'.GETPOST('urlfile'); $file = $conf->admin->dir_output.'/'.dol_sanitizeFileName(GETPOST('urlfile'));
$ret = dol_delete_file($file, 1); $ret = dol_delete_file($file, 1);
if ($ret) { if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
@ -80,11 +82,6 @@ if ($action == 'delete') {
$action = ''; $action = '';
} }
/*
* View
*/
$_SESSION["commandbackuplastdone"] = ''; $_SESSION["commandbackuplastdone"] = '';
$_SESSION["commandbackuptorun"] = ''; $_SESSION["commandbackuptorun"] = '';
$_SESSION["commandbackupresult"] = ''; $_SESSION["commandbackupresult"] = '';
@ -103,13 +100,6 @@ if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit); @ini_set('memory_limit', $MemoryLimit);
} }
//$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
//llxHeader('','',$help_url);
//print load_fiche_titre($langs->trans("Backup"),'','title_setup');
// Start with empty buffer // Start with empty buffer
$dump_buffer = ''; $dump_buffer = '';
$dump_buffer_len = 0; $dump_buffer_len = 0;
@ -122,9 +112,6 @@ $outputdir = $conf->admin->dir_output.'/backup';
$result = dol_mkdir($outputdir); $result = dol_mkdir($outputdir);
$utils = new Utils($db);
// MYSQL // MYSQL
if ($what == 'mysql') { if ($what == 'mysql') {
$cmddump = GETPOST("mysqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg $cmddump = GETPOST("mysqldump", 'none'); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
@ -166,7 +153,7 @@ if ($what == 'postgresql') {
$cmddump = dol_sanitizePathName($cmddump); $cmddump = dol_sanitizePathName($cmddump);
/* Not required, the command is output on screen but not ran for pgsql /* Not required, the command is output on screen but not ran for pgsql
if (! empty($dolibarr_main_restrict_os_commands)) if (!empty($dolibarr_main_restrict_os_commands))
{ {
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump); dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump);
@ -216,7 +203,16 @@ if ($errormsg) {
}*/ }*/
} }
/*
* View
*/
top_httphead();
$db->close(); $db->close();
// Redirect to backup page // Redirect to backup page
header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : '')); header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : ''));
exit();

View File

@ -127,7 +127,7 @@ $result = dol_mkdir($outputdir);
$utils = new Utils($db); $utils = new Utils($db);
if ($export_type == 'externalmodule' && ! empty($what)) { if ($export_type == 'externalmodule' && !empty($what)) {
$fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what); $fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what);
} else { } else {
$fulldirtocompress = DOL_DATA_ROOT; $fulldirtocompress = DOL_DATA_ROOT;
@ -205,7 +205,12 @@ if ($compression == 'zip') {
print $errormsg; print $errormsg;
} }
// Output export
if ($export_type != 'externalmodule' || empty($what)) { if ($export_type != 'externalmodule' || empty($what)) {
top_httphead();
if ($errormsg) { if ($errormsg) {
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors'); setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
} else { } else {
@ -218,12 +223,15 @@ if ($export_type != 'externalmodule' || empty($what)) {
$returnto = 'dolibarr_export.php'; $returnto = 'dolibarr_export.php';
header("Location: ".$returnto); header("Location: ".$returnto);
exit(); exit();
} else { } else {
top_httphead('application/zip');
$zipname = $outputdir."/".$file; $zipname = $outputdir."/".$file;
// Then download the zipped file. // Then download the zipped file.
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname)); header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname)); header('Content-Length: '.filesize($zipname));
readfile($zipname); readfile($zipname);

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

@ -88,7 +88,7 @@ class Login
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
// Is the login API disabled ? The token must be generated from backoffice only. // Is the login API disabled ? The token must be generated from backoffice only.
if (! empty($conf->global->API_DISABLE_LOGIN_API)) { if (!empty($conf->global->API_DISABLE_LOGIN_API)) {
dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING); dol_syslog("Warning: A try to use the login API has been done while the login API is disabled. You must generate or get the token from the backoffice.", LOG_WARNING);
throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice."); throw new RestException(403, "Error, the login API has been disabled for security purpose. You must generate or get the token from the backoffice.");
} }

View File

@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
$result = $assetaccountancycodes->fetchAccountancyCodes($object->id); $result = $assetaccountancycodes->fetchAccountancyCodes($object->id);
if ($result < 0) { if ($result < 0) {

View File

@ -86,7 +86,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
/* /*
@ -123,7 +123,7 @@ $form = new Form($db);
if ($object->id > 0) { if ($object->id > 0) {
$title = $langs->trans("Agenda"); $title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En'; $help_url = 'EN:Module_Agenda_En';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);

View File

@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid; if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();

View File

@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) {
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!empty($object->not_depreciated)) accessforbidden(); if (!empty($object->not_depreciated)) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions; $object->asset_depreciation_options = &$assetdepreciationoptions;

View File

@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!empty($object->not_depreciated)) accessforbidden(); if (!empty($object->not_depreciated)) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions; $object->asset_depreciation_options = &$assetdepreciationoptions;

View File

@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!isset($object->disposal_date) || $object->disposal_date === "") accessforbidden(); if (!isset($object->disposal_date) || $object->disposal_date === "") accessforbidden();

View File

@ -78,7 +78,7 @@ $permissiontoadd = $user->rights->asset->asset->write; // Used by the include of
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
/* /*

View File

@ -125,7 +125,7 @@ $permissiontoadd = $user->rights->asset->write;
$permissiontodelete = $user->rights->asset->delete; $permissiontodelete = $user->rights->asset->delete;
// Security check // Security check
if (empty($conf->asset->enabled)) { if (!isModEnabled('asset')) {
accessforbidden('Module not enabled'); accessforbidden('Module not enabled');
} }
@ -134,7 +134,7 @@ if ($user->socid > 0) accessforbidden();
$socid = 0; if ($user->socid > 0) $socid = $user->socid; $socid = 0; if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();

View File

@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();
$result = $assetaccountancycodes->fetchAccountancyCodes(0, $object->id); $result = $assetaccountancycodes->fetchAccountancyCodes(0, $object->id);

View File

@ -88,7 +88,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid; if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();
@ -125,7 +125,7 @@ $form = new Form($db);
if ($object->id > 0) { if ($object->id > 0) {
$title = $langs->trans("Agenda"); $title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En'; $help_url = 'EN:Module_Agenda_En';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);

View File

@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid; if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();

View File

@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions; $object->asset_depreciation_options = &$assetdepreciationoptions;

View File

@ -126,7 +126,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete))); $permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete)));
// Security check // Security check
if (empty($conf->asset->enabled)) { if (!isModEnabled('asset')) {
accessforbidden('Module not enabled'); accessforbidden('Module not enabled');
} }
@ -140,7 +140,7 @@ if ($user->socid > 0) {
} }
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden(); if (!$permissiontoread) accessforbidden();
/* /*

View File

@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->asset->enabled)) accessforbidden(); if (!isModEnabled('asset')) accessforbidden();
/* /*

View File

@ -22,22 +22,25 @@
* \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();
} }
$action = GETPOST('action', 'aZ09'); // Get Parameters
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$withtab = GETPOST('withtab', 'int');
$withtab = GETPOST('withtab', 'int');
/* /*

View File

@ -18,11 +18,13 @@
*/ */
/** /**
* \file htdocs/blockedlog/admin/blockedlog_list.php * \file htdocs/blockedlog/admin/blockedlog_list.php
* \ingroup blockedlog * \ingroup blockedlog
* \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,16 +33,18 @@ 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();
} }
$action = GETPOST('action', 'aZ09'); // Get Parameters
$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
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); $search_showonlyerrors = GETPOST('search_showonlyerrors', 'int');
if ($search_showonlyerrors < 0) { if ($search_showonlyerrors < 0) {
@ -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) {
@ -523,7 +527,7 @@ if (is_array($blocks)) {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// ID // ID
print '<td>'.$block->id.'</td>'; print '<td>'.dol_escape_htmltag($block->id).'</td>';
// Date // Date
print '<td>'.dol_print_date($block->date_creation, 'dayhour').'</td>'; print '<td>'.dol_print_date($block->date_creation, 'dayhour').'</td>';
@ -531,11 +535,11 @@ if (is_array($blocks)) {
// User // User
print '<td>'; print '<td>';
//print $block->getUser() //print $block->getUser()
print $block->user_fullname; print dol_escape_htmltag($block->user_fullname);
print '</td>'; print '</td>';
// Action // Action
print '<td>'.$langs->trans('log'.$block->action).'</td>'; print '<td class="tdoverflowmax250" title="'.dol_escape_htmltag($langs->trans('log'.$block->action)).'">'.$langs->trans('log'.$block->action).'</td>';
// Ref // Ref
print '<td class="nowraponall">'; print '<td class="nowraponall">';

View File

@ -44,6 +44,13 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
$user = new User($db); $user = new User($db);
$user->fetch(1); //TODO conf user authority $user->fetch(1); //TODO conf user authority
/*
* View
*/
top_httphead();
$auth = new BlockedLogAuthority($db); $auth = new BlockedLogAuthority($db);
$signature = GETPOST('s'); $signature = GETPOST('s');

View File

@ -42,6 +42,13 @@ $id = GETPOST('id', 'int');
$element = GETPOST('element', 'alpha'); $element = GETPOST('element', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
/*
* View
*/
top_httphead();
if ($element === 'facture') { if ($element === 'facture') {
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.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';

View File

@ -54,6 +54,8 @@ $langs->loadLangs(array("admin"));
* View * View
*/ */
top_httphead();
print '<div id="pop-info"><table width="100%" height="80%" class="border"><thead><th width="50%" class="left">'.$langs->trans('Field').'</th><th class="left">'.$langs->trans('Value').'</th></thead>'; print '<div id="pop-info"><table width="100%" height="80%" class="border"><thead><th width="50%" class="left">'.$langs->trans('Field').'</th><th class="left">'.$langs->trans('Value').'</th></thead>';
print '<tbody>'; print '<tbody>';

View File

@ -48,6 +48,12 @@ if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
} }
/*
* View
*/
top_httphead();
$auth = new BlockedLogAuthority($db); $auth = new BlockedLogAuthority($db);
$auth->syncSignatureWithAuthority(); $auth->syncSignatureWithAuthority();

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,23 +174,29 @@ 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';
$this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate'; $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate';
} }
*/ */
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

@ -16,9 +16,9 @@
*/ */
/** /**
* \file htdocs/blockedlog/lib/blockedlog.lib.php * \file htdocs/blockedlog/lib/blockedlog.lib.php
* \ingroup system * \ingroup system
* \brief Library for common blockedlog functions * \brief Library for common blockedlog functions
*/ */
/** /**

View File

@ -17,9 +17,9 @@
*/ */
/** /**
* \file htdocs/modulebuilder/template/myobject_agenda.php * \file htdocs/bom/bom_agenda.php
* \ingroup bom * \ingroup bom
* \brief Page of MyObject events * \brief Page of BOM events
*/ */
// Load Dolibarr environment // Load Dolibarr environment
@ -126,7 +126,7 @@ $form = new Form($db);
if ($object->id > 0) { if ($object->id > 0) {
$title = $langs->trans("Agenda"); $title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
llxHeader('', $title, $help_url); llxHeader('', $title, $help_url);
@ -150,7 +150,7 @@ if ($object->id > 0) {
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (! empty($conf->project->enabled)) if (isModEnabled('project'))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
@ -171,7 +171,7 @@ if ($object->id > 0) {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
} }
} else { } else {
if (! empty($object->fk_project)) { if (!empty($object->fk_project)) {
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($object->fk_project); $proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">'; $morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';

View File

@ -335,7 +335,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
} }
$text = $langs->trans('ConfirmValidateBom', $numref); $text = $langs->trans('ConfirmValidateBom', $numref);
/*if (! empty($conf->notification->enabled)) /*if (!empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -363,7 +363,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Confirmation of closing // Confirmation of closing
if ($action == 'close') { if ($action == 'close') {
$text = $langs->trans('ConfirmCloseBom', $object->ref); $text = $langs->trans('ConfirmCloseBom', $object->ref);
/*if (! empty($conf->notification->enabled)) /*if (!empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -391,7 +391,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Confirmation of reopen // Confirmation of reopen
if ($action == 'reopen') { if ($action == 'reopen') {
$text = $langs->trans('ConfirmReopenBom', $object->ref); $text = $langs->trans('ConfirmReopenBom', $object->ref);
/*if (! empty($conf->notification->enabled)) /*if (!empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project // Project
if (! empty($conf->project->enabled)) if (isModEnabled('project'))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
@ -477,7 +477,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
} }
} else { } else {
if (! empty($object->fk_project)) { if (!empty($object->fk_project)) {
$proj = new Project($db); $proj = new Project($db);
$proj->fetch($object->fk_project); $proj->fetch($object->fk_project);
$morehtmlref.=$proj->getNomUrl(); $morehtmlref.=$proj->getNomUrl();

View File

@ -366,7 +366,7 @@ foreach($object->fields as $key => $val)
$sql .= "t.".$key.", "; $sql .= "t.".$key.", ";
} }
// 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.', ' : ''); $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
} }

View File

@ -195,19 +195,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/ */
$text_stock_options = $langs->trans("RealStockDesc").'<br>'; $text_stock_options = $langs->trans("RealStockDesc").'<br>';
$text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>'; $text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : ''); $text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
print '<table id="tablelines" class="noborder noshadow" width="100%">'; print '<table id="tablelines" class="noborder noshadow" width="100%">';
print "<thead>\n"; print "<thead>\n";
print '<tr class="liste_titre nodrag nodrop">'; print '<tr class="liste_titre nodrag nodrop">';
print '<td class="linecoldescription">'.$langs->trans('Product'); print '<td class="linecoldescription">'.$langs->trans('Product');
if (! empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') { if (!empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') {
print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;'; print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;'; print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
} }
@ -216,11 +216,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="linecolstock right">'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).'</td>'; print '<td class="linecolstock right">'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).'</td>';
print '<td class="linecoltheoricalstock right">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>'; print '<td class="linecoltheoricalstock right">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>';
print '</tr>'; print '</tr>';
if (! empty($TChildBom)) { if (!empty($TChildBom)) {
if ($action == 'treeview') { if ($action == 'treeview') {
foreach ($TChildBom as $fk_bom => $TProduct) { foreach ($TChildBom as $fk_bom => $TProduct) {
$repeatChar = '&emsp;'; $repeatChar = '&emsp;';
if (! empty($TProduct['bom'])) { if (!empty($TProduct['bom'])) {
if ($TProduct['parentid'] != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">'; if ($TProduct['parentid'] != $object->id) print '<tr class="sub_bom_lines oddeven" parentid="'.$TProduct['parentid'].'">';
else print '<tr class="oddeven">'; else print '<tr class="oddeven">';
print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1); print '<td class="linecoldescription">'.str_repeat($repeatChar, $TProduct['level']).$TProduct['bom']->getNomUrl(1);
@ -233,7 +233,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="linecoltheoricalstock right"></td>'; print '<td class="linecoltheoricalstock right"></td>';
print '</tr>'; print '</tr>';
} }
if (! empty($TProduct['product'])) { if (!empty($TProduct['product'])) {
foreach ($TProduct['product'] as $fk_product => $TInfos) { foreach ($TProduct['product'] as $fk_product => $TInfos) {
$prod = new Product($db); $prod = new Product($db);
$prod->fetch($fk_product); $prod->fetch($fk_product);

View File

@ -821,8 +821,8 @@ class BOM extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->create)) /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->create))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate))))
{ {
$this->error='NotEnoughPermissions'; $this->error='NotEnoughPermissions';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
@ -933,8 +933,8 @@ class BOM extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@ -957,8 +957,8 @@ class BOM extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@ -981,8 +981,8 @@ class BOM extends CommonObject
return 0; return 0;
} }
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->write)) /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->write))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->bom->bom_advance->validate)))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->bom->bom_advance->validate))))
{ {
$this->error='Permission denied'; $this->error='Permission denied';
return -1; return -1;
@ -1338,9 +1338,9 @@ class BOM extends CommonObject
*/ */
public function getNetNeeds(&$TNetNeeds = array(), $qty = 0) public function getNetNeeds(&$TNetNeeds = array(), $qty = 0)
{ {
if (! empty($this->lines)) { if (!empty($this->lines)) {
foreach ($this->lines as $line) { foreach ($this->lines as $line) {
if (! empty($line->childBom)) { if (!empty($line->childBom)) {
foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty); foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
} else { } else {
if (empty($TNetNeeds[$line->fk_product])) { if (empty($TNetNeeds[$line->fk_product])) {
@ -1362,9 +1362,9 @@ class BOM extends CommonObject
*/ */
public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0) public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0)
{ {
if (! empty($this->lines)) { if (!empty($this->lines)) {
foreach ($this->lines as $line) { foreach ($this->lines as $line) {
if (! empty($line->childBom)) { if (!empty($line->childBom)) {
foreach ($line->childBom as $childBom) { foreach ($line->childBom as $childBom) {
$TNetNeeds[$childBom->id]['bom'] = $childBom; $TNetNeeds[$childBom->id]['bom'] = $childBom;
$TNetNeeds[$childBom->id]['parentid'] = $this->id; $TNetNeeds[$childBom->id]['parentid'] = $this->id;
@ -1572,7 +1572,7 @@ class BOMLine extends CommonObjectLine
public function fetch($id, $ref = null) public function fetch($id, $ref = null)
{ {
$result = $this->fetchCommon($id, $ref); $result = $this->fetchCommon($id, $ref);
//if ($result > 0 && ! empty($this->table_element_line)) $this->fetchLines(); //if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines();
return $result; return $result;
} }

View File

@ -36,39 +36,45 @@ function printDropdownBookmarksList()
$langs->load("bookmarks"); $langs->load("bookmarks");
$authorized_var=array('limit','optioncss','contextpage');
$url = $_SERVER["PHP_SELF"]; $url = $_SERVER["PHP_SELF"];
$url_param=array();
if (!empty($_SERVER["QUERY_STRING"])) { if (!empty($_SERVER["QUERY_STRING"])) {
$url .= (dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''); if (is_array($_GET)) {
} else { foreach ($_GET as $key => $val) {
global $sortfield, $sortorder; if ($val != '') {
$tmpurl = ''; $url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
// No urlencode, all param $url will be urlencoded later
if ($sortfield) {
$tmpurl .= ($tmpurl ? '&' : '').'sortfield='.urlencode($sortfield);
}
if ($sortorder) {
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
}
if (is_array($_POST)) {
foreach ($_POST as $key => $val) {
if (preg_match('/^search_/', $key) && $val != '') {
$tmpurl .= ($tmpurl ? '&' : '').http_build_query(array($key => $val));
} }
} }
} }
$url .= ($tmpurl ? '?'.$tmpurl : ''); }
global $sortfield, $sortorder;
$tmpurl = '';
// No urlencode, all param $url will be urlencoded later
if ($sortfield) {
$tmpurl .= ($tmpurl ? '&' : '').'sortfield='.urlencode($sortfield);
}
if ($sortorder) {
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
}
if (is_array($_POST)) {
foreach ($_POST as $key => $val) {
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
&& $val != ''
&& !array_key_exists($key, $url_param)) {
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
}
}
}
$url .= ($tmpurl ? '?'.$tmpurl : '');
if (!empty($url_param)) {
$url .= '&'.implode('&', $url_param);
} }
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n"; $searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>'; $searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>';
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">'; $searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
// Url to list bookmark
$listbtn = '<a class="top-menu-dropdown-link" title="'.dol_escape_htmltag($langs->trans('Bookmarks')).'" href="'.DOL_URL_ROOT.'/bookmarks/list.php">';
$listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').'</a>';
// Url to go on create new bookmark page // Url to go on create new bookmark page
$newbtn = ''; $newbtn = '';
if (!empty($user->rights->bookmark->creer)) { if (!empty($user->rights->bookmark->creer)) {
@ -80,6 +86,10 @@ function printDropdownBookmarksList()
} }
} }
// Url to list/edit bookmark
$listbtn = '<a class="top-menu-dropdown-link" title="'.dol_escape_htmltag($langs->trans('Bookmarks')).'" href="'.DOL_URL_ROOT.'/bookmarks/list.php">';
$listbtn .= img_picto('', 'edit', 'class="paddingright opacitymedium"').$langs->trans('EditBookmarks').'</a>';
// Menu with list of bookmarks // Menu with list of bookmarks
$sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark";
$sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)";
@ -171,27 +181,28 @@ function printDropdownBookmarksList()
'; ';
$html .= ' $html .= '
<!-- Menu Body --> <!-- Menu bookmark tools-->
<div class="bookmark-body dropdown-body">
'.$bookmarkList.'
</div>
';
$html .= '
<!-- Menu Footer-->
<div class="bookmark-footer"> <div class="bookmark-footer">
'.$newbtn.$listbtn.' '.$newbtn.$listbtn.'
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
'; ';
$html .= '
<!-- Menu Body -->
<div class="bookmark-body dropdown-body">
'.$bookmarkList.'
<span id="top-bookmark-search-nothing-found" class="hidden-search-result opacitymedium">'.dol_escape_htmltag($langs->trans("NoBookmarkFound")).'</span>
</div>
';
$html .= '<!-- script to open/close the popup --> $html .= '<!-- script to open/close the popup -->
<script> <script>
$( document ).on("keyup", "#top-bookmark-search-input", function () { $( document ).on("keyup", "#top-bookmark-search-input", function () {
console.log("keyup in bookmark search input");
var filter = $(this).val(), count = 0; var filter = $(this).val(), count = 0;
$("#dropdown-bookmarks-list .bookmark-item").each(function () { $("#dropdown-bookmarks-list .bookmark-item").each(function () {
if ($(this).text().search(new RegExp(filter, "i")) < 0) { if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).addClass("hidden-search-result"); $(this).addClass("hidden-search-result");
} else { } else {
@ -200,6 +211,11 @@ function printDropdownBookmarksList()
} }
}); });
$("#top-bookmark-search-filter-count").text(count); $("#top-bookmark-search-filter-count").text(count);
if (count == 0) {
jQuery("#top-bookmark-search-nothing-found").removeClass("hidden-search-result");
} else {
jQuery("#top-bookmark-search-nothing-found").addClass("hidden-search-result");
}
}); });
</script>'; </script>';
} }

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);

File diff suppressed because it is too large Load Diff

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);
@ -1411,7 +1411,7 @@ if ($action == 'create') {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$projectid = GETPOST('projectid', 'int'); $projectid = GETPOST('projectid', 'int');
@ -1496,7 +1496,7 @@ if ($action == 'create') {
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor = new DolEditor('note', (GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $object->note_private), '', 120, 'dolibarr_notes', 'In', true, true, isModEnabled('fckeditor'), ROWS_4, '90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
@ -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);
@ -1914,7 +1914,7 @@ if ($id > 0) {
} }
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>'; print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>';
@ -1939,7 +1939,7 @@ if ($id > 0) {
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("LinkedObject").'</td>'; print '<td>'.$langs->trans("LinkedObject").'</td>';
if ($object->elementtype == 'task' && !empty($conf->project->enabled)) { if ($object->elementtype == 'task' && isModEnabled('project')) {
print '<td id="project-task-input-container" >'; print '<td id="project-task-input-container" >';
$urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility
@ -2132,7 +2132,7 @@ if ($id > 0) {
// Thirdparty // Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); //$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' '; //$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').' '; $morehtmlref .= $langs->trans('Project').' ';
@ -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

@ -457,11 +457,11 @@ class ActionComm extends CommonObject
if (!empty($this->datep) && !empty($this->datef)) { if (!empty($this->datep) && !empty($this->datef)) {
$this->durationp = ($this->datef - $this->datep); // deprecated $this->durationp = ($this->datef - $this->datep); // deprecated
} }
//if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); //if (!empty($this->date) && !empty($this->dateend)) $this->durationa=($this->dateend - $this->date);
if (!empty($this->datep) && !empty($this->datef) && $this->datep > $this->datef) { if (!empty($this->datep) && !empty($this->datef) && $this->datep > $this->datef) {
$this->datef = $this->datep; $this->datef = $this->datep;
} }
//if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; //if (!empty($this->date) && !empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date;
if (!isset($this->fk_project) || $this->fk_project < 0) { if (!isset($this->fk_project) || $this->fk_project < 0) {
$this->fk_project = 0; $this->fk_project = 0;
} }

View File

@ -124,7 +124,7 @@ class AgendaEvents extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) { if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
$search_sale = DolibarrApiAccess::$user->id; $search_sale = DolibarrApiAccess::$user->id;
} }
if (empty($conf->societe->enabled)) { if (!isModEnabled('societe')) {
$search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists $search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
} }

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

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }
@ -159,7 +159,7 @@ if ($object->id > 0) {
// Thirdparty // Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); //$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' '; //$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': '; $morehtmlref .= $langs->trans('Project').': ';

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.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/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
@ -1911,7 +1911,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
} }
//print 'background: #'.$colortouse.';'; //print 'background: #'.$colortouse.';';
//print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));'; //print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));';
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //if (!empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
//print ' -moz-border-radius:4px;"'; //print ' -moz-border-radius:4px;"';
//print 'border: 1px solid #ccc" width="100%"'; //print 'border: 1px solid #ccc" width="100%"';

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
if (!empty($conf->project->enabled)) { 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';
} }
@ -86,7 +86,7 @@ $morehtmlref = '<div class="refidno">';
// Thirdparty // Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); //$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' '; //$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': '; $morehtmlref .= $langs->trans('Project').': ';

View File

@ -830,7 +830,7 @@ if (!empty($arrayfields['a.note']['checked'])) {
print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder);
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) //if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
if (!empty($arrayfields['a.datep']['checked'])) { if (!empty($arrayfields['a.datep']['checked'])) {
print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder); print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
$totalarray['nbfield']++; $totalarray['nbfield']++;

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("agenda", "commercial")); $langs->loadLangs(array("agenda", "commercial"));

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")) {
@ -78,7 +78,7 @@ if (isModEnabled("expedition")) {
if (isModEnabled('facture')) { if (isModEnabled('facture')) {
$langs->load("bills"); $langs->load("bills");
} }
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
} }
if (!empty($conf->ficheinter->enabled)) { if (!empty($conf->ficheinter->enabled)) {
@ -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")) {
@ -194,7 +194,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>'; print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
print '</tr>'; print '</tr>';
@ -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";
@ -291,7 +291,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -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";
@ -389,7 +389,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -487,7 +487,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>'; print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
print '</tr>'; print '</tr>';
@ -573,8 +573,9 @@ if (!empty($conf->ficheinter->enabled)) {
$companystatic->email = $obj->email; $companystatic->email = $obj->email;
$companystatic->entity = $obj->entity; $companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas; $companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'; print '<td class="nowraponall tdoverflowmax100">';
print $fichinterstatic->getNomUrl(1); print $fichinterstatic->getNomUrl(1);
print "</td>"; print "</td>";
print '<td class="nowrap tdoverflowmax100">'; print '<td class="nowrap tdoverflowmax100">';
@ -654,7 +655,7 @@ if (isModEnabled("societe") && $user->rights->societe->lire) {
$companystatic->canvas = $objp->canvas; $companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
//print $companystatic->getLibCustProspStatut(); //print $companystatic->getLibCustProspStatut();
@ -751,7 +752,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
$companystatic->canvas = $objp->canvas; $companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>'; print '<td class="nowraponall tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
print '<td>'; print '<td>';
$obj = $companystatic; $obj = $companystatic;
@ -809,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";
@ -865,8 +866,8 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
$staticcontrat->ref = $obj->ref; $staticcontrat->ref = $obj->ref;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$staticcontrat->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$staticcontrat->getNomUrl(1).'</td>';
print '<td>'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'; print '<td class="tdoverflowmax150">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>'; print '<td class="right">'.$staticcontrat->LibStatut($obj->statut, 3).'</td>';
print '</tr>'; print '</tr>';
@ -962,7 +963,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
print '<td class="nowrap" width="140">'; print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$propalstatic->getNomUrl(1).'</td>'; print '<td class="nobordernopadding nowraponall">'.$propalstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>'; print '<td width="18" class="nobordernopadding nowrap">'.$warning.'</td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>'; print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($propalstatic->element, $filename, $filedir).'</td>';
print '</tr>'; print '</tr>';
@ -1006,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";
@ -1082,7 +1083,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
print '<td class="nowrap" width="140">'; print '<td class="nowrap" width="140">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'.$orderstatic->getNomUrl(1).'</td>'; print '<td class="nobordernopadding nowraponall">'.$orderstatic->getNomUrl(1).'</td>';
print '<td width="18" class="nobordernopadding nowrap"></td>'; print '<td width="18" class="nobordernopadding nowrap"></td>';
print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>'; print '<td width="16" align="center" class="nobordernopadding">'.$formfile->getDocumentsLink($orderstatic->element, $filename, $filedir).'</td>';
print '</tr>'; print '</tr>';

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

@ -515,7 +515,7 @@ if ($object->fetch($id) >= 0) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$param = "&id=".$object->id; $param = "&id=".$object->id;
//if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) { if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }

View File

@ -58,7 +58,7 @@ print load_fiche_titre($title);
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
//{ //{
// Search into emailings // Search into emailings
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';

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