diff --git a/ChangeLog b/ChangeLog index 1c1e0095264..b67064c7fc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,54 @@ Following changes may create regressions for some external modules, but were nec * If your database is MySql or MariaDB, you need at least version 5.1 + +***** ChangeLog for 13.0.2 compared to 13.0.1 ***** + +FIX: 11.0 - $this->socid injected in query without checking for empty value +FIX: #16096 #16085 Any call of ajax pages must provide the token +FIX: #16296 +FIX: #16325 +FIX: #16341 : Fetch the Product ExtraFields in Shippment lines +FIX: #16366 +FIX: #16393 Do not sanitize +FIX: #16420 #16423 #16488 #16477 +FIX: #16431 +FIX: #16465 +FIX: #16480 +FIX: #16485 +FIX: #16487 +FIX: #16503 +FIX: #16530 +FIX: #16533 +FIX: #16629 +FIX: #16671 Can not generate zip file of documents in backup tool +FIX: Add "Now" link on social charges creation card +FIX: avoid undefined url and missing token +FIX: Bad project filter in ticket list +FIX: Buttons to disable bindings not working +FIX: class not found when creating recuring invoice from invoice+discount +FIX: File attachment on lots +FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice +FIX: hourglass and hide button to pay +FIX: massaction validate invoice do not regenerate pdf +FIX: missing mp4 video mime +FIX: picto on shipment to reset qty to 0. Some quantities were not reset. +FIX: Protection to avoid #16504 +FIX: rounding amount on card updating +FIX: Rounding amount on social charges card updating +FIX: select list dependencies now work for ModuleBuilder sellist field +FIX: Status in popup of member in widget +FIX: status on tooltip on widgets +FIX: Timezone management for datetime on list of events +FIX: Timezone management for datetime with modulebuilder and extrafields +FIX: Total_ht not show in contract link element +FIX: use post instead get +FIX: use var "saved_url" instead global var "$url" +FIX: Various payment - Missing fields for check transmitter & bank name +FIX: warning if setup of chart of account is not yet done. +FIX: wrong extension + + ***** ChangeLog for 13.0.1 compared to 13.0.0 ***** FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already. diff --git a/build/debian/control b/build/debian/control index eed54669555..059325eecb9 100755 --- a/build/debian/control +++ b/build/debian/control @@ -33,7 +33,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | Recommends: apache2 | lighttpd | httpd, mariadb-server | virtual-mysql-server, # Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8 - php-xml, php-mbstring + php-xml, php-mbstring, php-intl Suggests: www-browser, php5-geoip Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software package for diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index 235797bb6c9..f60f4829d76 100644 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -2,7 +2,7 @@ -$title +Dolibarr source code documentation '; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } @@ -548,11 +548,11 @@ if ($resql) { if (!empty($arrayfields['aa.active']['checked'])) { print ''; if (empty($obj->active)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 253c320bde0..caf98c7d91c 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -212,8 +212,10 @@ $accountsystem = new AccountancySystem($db); $accountsystem->fetch($conf->global->CHARTOFACCOUNTS); $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card'); -$helpurl = ''; -llxheader('', $title, $helpurl); + +$help_url = 'EN:Category:Accounting'; + +llxheader('', $title, $help_url); // Create mode diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index ac8a8c6354d..4338d7ad803 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -91,8 +91,10 @@ $form = new Form($db); $fiscalyearstatic = new Fiscalyear($db); $title = $langs->trans('AccountingPeriods'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f"; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index aef52a91236..410807144f5 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -149,8 +149,10 @@ if ($action == 'confirm_delete' && $confirm == "yes") { $form = new Form($db); $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Card"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($action == 'create') { print load_fiche_titre($langs->trans("NewFiscalYear")); @@ -298,10 +300,10 @@ if ($action == 'create') { print dol_get_fiche_end(); + /* + * Action bar + */ if (!empty($user->rights->accounting->fiscalyear->write)) { - /* - * Barre d'actions - */ print '
'; print ''.$langs->trans('Modify').''; diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 6fc5ac3cad8..d472350fab7 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -39,10 +39,14 @@ if (!$user->rights->accounting->fiscalyear->write) { $id = GETPOST('id', 'int'); + // View + $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info"); -$helpurl = ""; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Double_Entry_Accounting"; + +llxHeader('', $title, $help_url); if ($id) { $object = new Fiscalyear($db); diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 21ee5ce20e9..b5443486648 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -7,6 +7,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Ferran Marcet * * 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 @@ -383,11 +384,11 @@ foreach ($list_binding as $key) { print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -396,11 +397,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -409,11 +410,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 341fddf113c..ad1804048c3 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -419,11 +419,11 @@ if ($resql) { if (!empty($arrayfields['reconcilable']['checked'])) { print ''; if (empty($obj->reconcilable)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 35473c6329e..e03790a8995 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -135,6 +135,18 @@ if (!empty($search_accountancy_code_end)) { $param .= '&search_accountancy_code_end='.$search_accountancy_code_end; } +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + + + /* * Action */ diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 3ab9ed0a702..e3cac139c08 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -44,13 +44,6 @@ $id = GETPOST('id', 'int'); // id of record $mode = GETPOST('mode', 'aZ09'); // '' or '_tmp' $piece_num = GETPOST("piece_num", 'int'); // id of transaction (several lines share the same transaction id) -// Security check -if ($user->socid > 0) { - accessforbidden(); -} - -$mesg = ''; - $accountingaccount = new AccountingAccount($db); $accountingjournal = new AccountingJournal($db); @@ -83,6 +76,17 @@ if (!empty($update)) { $object = new BookKeeping($db); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions @@ -539,11 +543,11 @@ if ($action == 'create') { print '' . $langs->trans("Status") . ''; print ''; if (empty($object->validated)) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 8ca4175f87f..40a8284adc4 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2020 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,6 +171,16 @@ if (empty($listofformat[$formatexportset])) { $error = 0; +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions @@ -471,7 +481,7 @@ if (count($filter) > 0) { } } $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; -if ($conf->global->ACCOUNTING_REEXPORT == 0) { +if (empty($conf->global->ACCOUNTING_REEXPORT)) { $sql .= " AND t.date_export IS NULL"; } if (count($sqlwhere) > 0) { @@ -487,7 +497,7 @@ if (!empty($sortfield)) { // Must be after definition of $sql if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) { // TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them. - $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT); + $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 99b644d1e0a..24bcc4706c1 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -163,6 +163,16 @@ if ($search_date_end && empty($search_date_endyear)) { $search_date_endday = $tmparray['mday']; } +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Action diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 72b6574bea5..129e695de3c 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -163,10 +163,21 @@ if ($search_date_end && empty($search_date_endyear)) { $search_date_endday = $tmparray['mday']; } +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Action */ + if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index fa5302919d5..0064e8c4715 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -94,6 +94,16 @@ if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Action diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index e31479f10cd..a73f711e15a 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -94,10 +94,21 @@ if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Action */ + if ($action == 'lettering') { $result = $lettering->updateLettering($toselect); diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 94e59de1812..3ba552cdfa4 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -35,17 +35,6 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -// Security check -if (empty($conf->accounting->enabled)) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->rights->accounting->fiscalyear->write) { - accessforbidden(); -} - $object = new BookKeeping($db); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); @@ -67,10 +56,23 @@ $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start); $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (!$user->rights->accounting->fiscalyear->write) { + accessforbidden(); +} + + /* * Actions */ -if ($action == 'validate_movements_confirm' && $user->rights->accounting->fiscalyear->write) { + +if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting->fiscalyear->write)) { $result = $object->fetchAll(); if ($result < 0) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 1209576ddba..98e9151877e 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -38,9 +38,16 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 983e7957583..3b14450fab1 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -80,13 +80,17 @@ if (!$sortorder) { } // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } + $formaccounting = new FormAccounting($db); @@ -112,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_tvaintra = ''; } -if (is_array($changeaccount) && count($changeaccount) > 0) { +if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) { $error = 0; if (!(GETPOST('account_parent', 'int') >= 0)) { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 8d5c2788425..7014474ce4f 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -88,10 +88,13 @@ if (!$sortorder) { } // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } @@ -148,7 +151,7 @@ if (empty($reshook)) { } -if ($massaction == 'ventil') { +if ($massaction == 'ventil' && $user->rights->accounting->bind->write) { $msg = ''; //print '
' . $langs->trans("Processing") . '...
'; diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index f997f666e6e..200a493cfed 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -42,9 +42,15 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} /* diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index ffa0bfcc07d..38f7f596932 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -32,17 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); -// Security check -if (empty($conf->accounting->enabled)) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->rights->accounting->bind->write) { - accessforbidden(); -} - $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { $year_start = GETPOST("year", 'int'); @@ -65,13 +54,23 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} /* * Actions */ -if ($action == 'clean' || $action == 'validatehistory') { +if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) { // Clean database $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 3c4760b3730..d29e39d7f37 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -74,13 +74,17 @@ if (!$sortorder) { } // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } + $formaccounting = new FormAccounting($db); @@ -102,7 +106,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_year = ''; } -if (is_array($changeaccount) && count($changeaccount) > 0) { +if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) { $error = 0; if (!(GETPOST('account_parent', 'int') >= 0)) { diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 05476756531..84cd64bb44f 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -83,19 +83,22 @@ if (!$sortorder) { } } -// Security check -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->rights->accounting->bind->write) { - accessforbidden(); -} - $formaccounting = new FormAccounting($db); $accounting = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Action @@ -130,7 +133,7 @@ $permissiontodelete = $user->rights->expensereport->delete; $uploaddir = $conf->expensereport->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -if ($massaction == 'ventil') { +if ($massaction == 'ventil' && $user->rights->accounting->bind->write) { $msg = ''; //print '
' . $langs->trans("Processing") . '...
'; if (!empty($mesCasesCochees)) { diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 242fc71d80c..94dc6aa05c9 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -31,13 +31,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "banks", "admin", "dict")); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks +$hookmanager->initHooks(array('accountancyindex')); + // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} -// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks -$hookmanager->initHooks(array('accountancyindex')); /* diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index b79b8433c03..9093721bff6 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -7,7 +7,7 @@ * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy - * Copyright (C) 2017-2020 Frédéric France + * Copyright (C) 2017-2021 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Eric Seigne * Copyright (C) 2021 Gauthier VERDOL @@ -83,7 +83,13 @@ $now = dol_now(); $action = GETPOST('action', 'aZ09'); // Security check -if ($user->socid > 0 && empty($id_journal)) { +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } @@ -954,13 +960,18 @@ if (empty($action) || $action == 'view') { $nom = $langs->trans("FinanceJournal").' | '.$accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); $builddate = dol_now(); //$description = $langs->trans("DescFinanceJournal") . '
'; - $description .= $langs->trans("DescJournalOnlyBindedVisible").'
'; + $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; - $listofchoices = array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger")); + $listofchoices = array( + 'notyet'=>$langs->trans("NotYetInGeneralLedger"), + 'already'=>$langs->trans("AlreadyInGeneralLedger") + ); $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); $period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); $varlink = 'id_journal='.$id_journal; + $periodlink = ''; + $exportlink = ''; journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 9010261dbe0..2f7569ab152 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -58,13 +58,21 @@ if ($in_bookkeeping == '') { $now = dol_now(); // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions */ + $accountingaccount = new AccountingAccount($db); // Get informations of journal diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 46363fb3a09..f6fa5c4b76a 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -57,17 +57,25 @@ if ($in_bookkeeping == '') { $now = dol_now(); +$hookmanager->initHooks(array('purchasesjournal')); +$parameters = array(); + // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} -$hookmanager->initHooks(array('purchasesjournal')); -$parameters = array(); /* * Actions */ + $reshook = $hookmanager->executeHooks('doActions', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks $accountingaccount = new AccountingAccount($db); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 16209e1a241..bdf525d2827 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2014 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,13 +59,20 @@ if ($in_bookkeeping == '') { $now = dol_now(); +$hookmanager->initHooks(array('sellsjournal')); +$parameters = array(); + // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} -$hookmanager->initHooks(array('sellsjournal')); -$parameters = array(); /* * Actions @@ -656,7 +663,7 @@ if (empty($action) || $action == 'view') { $periodlink = ''; $exportlink = ''; $builddate = dol_now(); - $description .= $langs->trans("DescJournalOnlyBindedVisible").'
'; + $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 0d86b928a26..eee2059c660 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -42,9 +42,15 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} /* diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 937173fc1e6..7ef09acf91a 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -69,12 +69,23 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions */ -if ($action == 'clean' || $action == 'validatehistory') { +if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) { // Clean database $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as fd"; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 6bdc714ec4c..f661ba42ce9 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -80,16 +80,19 @@ if (!$sortorder) { } } +$formaccounting = new FormAccounting($db); + // Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} if ($user->socid > 0) { accessforbidden(); } -if (!$user->rights->accounting->bind->write) { +if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } -$formaccounting = new FormAccounting($db); - /* * Actions diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index d49effd791d..ea61a686883 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -88,14 +88,6 @@ if (!$sortorder) { } } -// Security check -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->rights->accounting->bind->write) { - accessforbidden(); -} - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('accountancysupplierlist')); @@ -107,6 +99,17 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +// Security check +if (empty($conf->accounting->enabled)) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (empty($user->rights->accounting->mouvements->lire)) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 092d9b0de38..3d40f8d758b 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -8,7 +8,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -254,7 +254,8 @@ if ($conf->facture->enabled) { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; print ''; - $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0); + $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); + $form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0); print ''; } print "\n"; diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 0465b7eee4f..ec3b3824db7 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -89,12 +89,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index c33ee5a4739..34175da465f 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -92,12 +92,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -105,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index edb2e9ba4dc..3f7114380f3 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -122,8 +122,10 @@ if ($object->id > 0) { $langs->load("companies"); $title = $langs->trans("Member")." - ".$langs->trans("Agenda"); - $helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; - llxHeader("", $title, $helpurl); + + $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + + llxHeader("", $title, $help_url); if (!empty($conf->notification->enabled)) { $langs->load("mails"); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7e72058092a..b34e39872ac 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1691,6 +1691,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ print '
'; + $isinspip = 0; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been if (empty($reshook)) { @@ -1818,7 +1819,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print ''; // ancre - // Documents generes + // Generated documents $filename = dol_sanitizeFileName($object->ref); //$filename = 'tmp_cards.php'; //$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref); @@ -1827,7 +1828,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $genallowed = $user->rights->adherent->lire; $delallowed = $user->rights->adherent->creer; - print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object); + print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object); $somethingshown = $formfile->numoffiles; // Show links to link elements diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 9d403d88320..8d9ed70a925 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -50,6 +50,9 @@ $extrafields = new ExtraFields($db); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions @@ -259,7 +262,7 @@ dol_htmloutput_errors($mesg); print '
'; -print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -272,13 +275,13 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", (!empty($conf->global->ADHERENT_CARD_TYPE) ? $conf->global->ADHERENT_CARD_TYPE : $langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; print ''; @@ -290,14 +293,14 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : $conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'.$langs->trans("Login").': '; print '
'; print '
'; print '

'; -print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; +print img_picto('', 'puce').' '.$langs->trans("DocForLabels", (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)).' '; print '
'; print ''; print ''; @@ -309,7 +312,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } asort($arrayoflabels); -print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ?GETPOST('modellabel') : $conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); +print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : (empty($conf->global->ADHERENT_ETIQUETTE_TYPE) ? '' : $conf->global->ADHERENT_ETIQUETTE_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 9acecaab1ce..5932bf58e6d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -479,6 +479,9 @@ class AdherentType extends CommonObject if (!empty($conf->global->MAIN_MULTILANGS)) { $this->getMultiLangs(); } + + // fetch optionals attributes and labels + $this->fetch_optionals(); } return 1; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 349cf5e7b75..88e31ebffb6 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -89,8 +89,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); if ($id > 0) { $result = $membert->fetch($object->typeid); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 4a4724593e4..33afa113078 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -193,11 +193,11 @@ if ($conf->use_javascript_ajax) { $boxgraph .=''.$langs->trans("Statistics").''; $boxgraph .=''; - $SommeA = 0; - $SommeB = 0; + $SumToValidate = 0; + $SumValidated = 0; - $SommeC = 0; - $SommeD = 0; + $SumUpToDate = 0; + $SumResiliated = 0; $total = 0; $dataval = array(); $i = 0; @@ -206,18 +206,18 @@ if ($conf->use_javascript_ajax) { $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0); $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); - $SommeA += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; - $SommeC += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; - $SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; + $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } - $total = $SommeA + $SommeB + $SommeC + $SommeD; + $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; $dataseries = array(); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SommeB)); - $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SommeC)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SommeD)); - $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SommeA)); + $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); + $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; @@ -234,7 +234,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .= ''; $boxgraph .= ''.$langs->trans("Total").''; - $boxgraph .= $SommeA + $SommeB + $SommeC + $SommeD; + $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; $boxgraph .= ''; $boxgraph .= ''; $boxgraph .= '
'; @@ -484,10 +484,10 @@ foreach ($AdherentType as $key => $adhtype) { } print ''; print ''.$langs->trans("Total").''; -print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; -print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; -print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; -print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; +print ''.$SumToValidate.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; +print ''.$SumValidated.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; +print ''.$SumUpToDate.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; +print ''.$SumResiliated.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; print ''; print "\n"; diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 843ca08a5df..89baf2f5ec5 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -131,9 +131,8 @@ print '
'; print dol_get_fiche_end(); /* - * Barre d'actions + * Action bar */ - print '
'; if (!empty($conf->global->LDAP_MEMBER_ACTIVE) && $conf->global->LDAP_MEMBER_ACTIVE != 'ldap2dolibarr') { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index c37e9e325cf..cebd634fa56 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -41,9 +41,6 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search -// Security check -$result = restrictedArea($user, 'adherent'); - $search = GETPOST("search", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); @@ -162,6 +159,9 @@ $arrayfields = array( // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; +// Security check +$result = restrictedArea($user, 'adherent'); + /* * Actions diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 437a8c0c577..26fec04a5e6 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -57,9 +57,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* * View */ + $title = $langs->trans("Member")." - ".$langs->trans("Note"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $form = new Form($db); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 9f8691a69a6..1238fd0fe15 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -59,7 +59,7 @@ $title = $langs->trans("MembersStatisticsByProperties"); print load_fiche_titre($title, '', $memberstatic->picto); -dol_mkdir($dir); +//dol_mkdir($dir); $data = array(); @@ -134,7 +134,7 @@ if ($resql) { } -$head = member_stats_prepare_head($adh); +$head = member_stats_prepare_head($memberstatic); print dol_get_fiche_head($head, 'statsbyproperties', '', -1, ''); @@ -169,7 +169,7 @@ if (!$foundmor) { foreach ($data as $val) { $nb = $val['nb']; - $nbsubscriptions = $val['nbsubscriptions']; + $nbsubscriptions = isset($val['nbsubscriptions']) ? $val['nbsubscriptions'] : 0; $nbactive = $val['nbactive']; print ''; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 6107669c967..2d1450b8ae5 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -78,7 +78,7 @@ llxHeader('', $title, '', '', 0, 0, $arrayjs); print load_fiche_titre($title, '', $memberstatic->picto); -dol_mkdir($dir); +//dol_mkdir($dir); if ($mode) { // Define sql @@ -87,7 +87,7 @@ if ($mode) { $tab = 'statscountry'; $data = array(); - $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label"; + $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid"; @@ -103,7 +103,7 @@ if ($mode) { $tab = 'statsstate'; $data = array(); - $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; // + $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; // $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; @@ -120,7 +120,7 @@ if ($mode) { $tab = 'statsregion'; //onglet $data = array(); //tableau de donnée - $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2"; + $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; @@ -137,7 +137,7 @@ if ($mode) { $tab = 'statstown'; $data = array(); - $sql .= "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2"; + $sql = "SELECT COUNT(DISTINCT d.rowid) as nb, COUNT(s.rowid) as nbsubscriptions, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid"; @@ -207,7 +207,7 @@ if ($mode) { } -$head = member_stats_prepare_head($adh); +$head = member_stats_prepare_head($memberstatic); print dol_get_fiche_head($head, $tab, '', -1, ''); @@ -299,7 +299,7 @@ if ($mode) { print ''; print ''; print ''; - if ($label2) { + if (isset($label2)) { print ''; } print ''; @@ -308,10 +308,10 @@ if ($mode) { print ''; foreach ($data as $val) { - $year = $val['year']; + $year = isset($val['year']) ? $val['year'] : '';; print ''; print ''; - if ($label2) { + if (isset($label2)) { print ''; } print ''; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index b092c7bcf20..11c0025dcc5 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -137,7 +137,7 @@ if (!$mesg) { } -$head = member_stats_prepare_head($adh); +$head = member_stats_prepare_head($memberstatic); print dol_get_fiche_head($head, 'statssubscription', '', -1, ''); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index b48328a17e8..f9dd77debac 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -121,6 +121,7 @@ $paymentdate = -1; * Actions */ +$parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -428,8 +429,10 @@ $form = new Form($db); $now = dol_now(); $title = $langs->trans("Member")." - ".$langs->trans("Subscriptions"); -$helpurl = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; -llxHeader("", $title, $helpurl); + +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader("", $title, $help_url); $param = ''; @@ -639,7 +642,7 @@ if ($rowid > 0) { /* - * Action buttons + * Action bar */ // Button to create a new subscription if member no draft neither resiliated diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 4b2b4861c1c..575d6d2301b 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -349,8 +349,7 @@ if ($rowid && $action != 'edit') { print dol_get_fiche_end(); /* - * Barre d'actions - * + * Action bar */ print '
'; @@ -373,7 +372,7 @@ if ($rowid && $action != 'edit') { print '
'; print ''; // ancre - // Documents generes + // Generated documents /* $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index d2b46e96610..25ee4a8e39f 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -43,12 +43,13 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); -$search_login = GETPOST('search_login', 'alpha'); -$search_email = GETPOST('search_email', 'alpha'); +$search_login = GETPOST('search_login', 'alpha'); +$search_email = GETPOST('search_email', 'alpha'); $type = GETPOST('type', 'intcomma'); -$status = GETPOST('status', 'alpha'); +$status = GETPOST('status', 'alpha'); +$optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -213,7 +214,8 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) { $form = new Form($db); $formproduct = new FormProduct($db); -$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + llxHeader('', $langs->trans("MembersTypeSetup"), $help_url); // List of members type diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 56dfc05e895..a99f1f990ad 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -142,13 +142,16 @@ $result = $object->fetch($id); */ $title = $langs->trans('MemberTypeCard'); -$helpurl = ''; + +$help_url = ''; + $shortlabel = dol_trunc($object->label, 16); $title = $langs->trans('MemberType')." ".$shortlabel." - ".$langs->trans('Translation'); -$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url); $form = new Form($db); $formadmin = new FormAdmin($db); @@ -175,12 +178,9 @@ print dol_get_fiche_end(); -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - +/* + * Action bar + */ print "\n
\n"; if ($action == '') { diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index dbdbbc687ea..a53cacd2212 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,9 +20,9 @@ */ /** - * \file htdocs/adherent/vcard.php + * \file htdocs/adherents/vcard.php * \ingroup societe - * \brief Onglet vcard d'un adherent + * \brief Vcard tab of a member */ require '../main.inc.php'; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index f140b207aaf..50e4a3e92c7 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -94,12 +94,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +103,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index d23bd42848a..54d5158b4ed 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -330,16 +330,6 @@ if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { } print '
'."\n"; -// AGENDA_DEFAULT_VIEW -print ''."\n"; -$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); -print ''."\n"; -print ''."\n"; -print ''."\n"; - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; print ''."\n"; @@ -350,6 +340,16 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''."\n"; } +// AGENDA_DEFAULT_VIEW +print ''."\n"; +$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); +print ''."\n"; +print ''."\n"; +print ''."\n"; + // AGENDA_EVENT_DEFAULT_STATUS print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 6fb4430d88e..89363a9027b 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -9,6 +9,7 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2016 Philippe Grand * Copyright (C) 2013 Florian Henry + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -642,7 +643,7 @@ print ''; // Shippable Icon in List /* Kept as hidden feature for the moment, result seems bugged. -Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ? +Where is definition of "shippable" according to all different STOCK_CALCULATE_... options ? print ''; print ''; @@ -657,65 +658,46 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { } print ''; print ''; +*/ /* // Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation. // Ask for payment bank during order -if ($conf->banque->enabled) -{ +if ($conf->banque->enabled) { print ''; -} -else -{ +} else { print ''; } // Ask for warehouse during order -if ($conf->stock->enabled) -{ - +if ($conf->stock->enabled) { print ''; -} -else -{ - +} else { print ''; } diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 1acad0506c0..d0c7c85463e 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index fbf347a45a9..b218a245c99 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -110,11 +110,11 @@ print '"; print ''; @@ -130,9 +130,9 @@ print ''; print '"; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 3d159801173..32b91ed7cea 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -58,8 +58,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; * View */ +$help_url = 'EN:Module_DAV'; -llxHeader('', $langs->trans("DAVSetup"), $wikihelp); +llxHeader('', $langs->trans("DAVSetup"), $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/delivery_extrafields.php b/htdocs/admin/delivery_extrafields.php index 7222880ae47..cf712bc6ecf 100644 --- a/htdocs/admin/delivery_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -96,12 +96,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +104,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/deliverydet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php index 45068a252b3..c74f5235d42 100644 --- a/htdocs/admin/deliverydet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 99cedac9f3f..d913826b245 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index d7d9f809534..b260eff55fa 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -96,23 +96,14 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 70a9629e1d6..b76ee35b76c 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 7df27d0d84b..4f807ee9da3 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -97,12 +97,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -110,11 +105,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 716ba5d1a03..25771ef63d0 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -90,12 +90,8 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +99,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 0671783615c..65029a9246a 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -89,7 +89,7 @@ $picto = array( */ foreach ($modules as $const => $desc) { - if ($action == 'activate_'.strtolower($const)) { + if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { @@ -166,9 +166,9 @@ if (empty($conf->use_javascript_ajax)) { $constante = 'FCKEDITOR_ENABLE_'.$const; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } elseif ($value == 1) { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print ""; diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index 732eb0997d7..609187058e3 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -90,12 +90,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +98,8 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ + +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1c59d1bb26d..72d16569b25 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -562,9 +562,9 @@ if ($action == 'edit') { if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { // Force e-mail recipient - print ''; - print ''; // Selector print ''; - print ''; // PRIVATE KEY print ''; - print ''; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 34da40010b5..cb5df373645 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -446,12 +446,12 @@ if ($action == 'edit') { // SMTPS ID if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -484,7 +484,7 @@ if ($action == 'edit') { print '"; @@ -455,12 +455,12 @@ if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print ''; if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print '"; } if (!empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { print '"; } print ""; diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 59e0e857161..4121073dec2 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 61a14a34844..0156eed5072 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -95,13 +95,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -109,11 +103,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 5e0cfb38d4c..5a49c8f5bfd 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -93,13 +93,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 25689c7b9f5..07f223d59c8 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 92b60cce4e2..cfdc196d79d 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -442,7 +442,7 @@ foreach ($configfileparameters as $key => $value) { print img_warning($langs->trans('SwitchThisForABetterSecurity', 0)); } } else { - print ${$newkey}; + print (empty(${$newkey}) ? '' : ${$newkey}); } if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) { print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 745b732b6e1..e05fc01fd82 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -25,6 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; // Load translation files required by the page @@ -54,7 +55,12 @@ print load_fiche_titre($langs->trans("PHPSetup"), '', 'folder'); // Get version of PHP $phpversion = version_php(); -print "PHP - ".$langs->trans("Version").": ".$phpversion."
\n"; +print "PHP: ".$langs->trans("Version").": ".$phpversion; +if (function_exists('php_ini_loaded_file')) { + $inipath = php_ini_loaded_file(); + print " - INI: ".$inipath; +} +print "
\n"; // Get versionof web server print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; @@ -62,6 +68,35 @@ print '
'; print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."
\n"; print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."
\n"; +print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0))."
\n"; +print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0))."
\n"; +print "PHP disable_functions = "; +$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); +$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); +$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open,popen'); +print join(', ', $arrayoffunctionsdisabled); +print "
\n"; +$todisabletext = ''; +foreach ($arrayoffunctionstodisable as $functiontodisable) { + if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) { + $todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.$functiontodisable; + } +} +if ($todisabletext) { + print $langs->trans("YouShouldDisablePHPFunctions").': '.$todisabletext; + print '
'; +} +$todisabletext = ''; +foreach ($arrayoffunctionstodisable2 as $functiontodisable) { + if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) { + $todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.$functiontodisable; + } +} +if ($todisabletext) { + print $langs->trans("IfCLINotRequiredYouShouldDisablePHPFunctions").': '.$todisabletext; + print '
'; +} + print '
'; // XDebug @@ -110,6 +145,14 @@ $perms = fileperms($dolibarr_main_document_root.'/'.$conffile); if ($perms) { if (($perms & 0x0004) || ($perms & 0x0002)) { print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers"); + // Web user group by default + $labeluser = dol_getwebuser('user'); + $labelgroup = dol_getwebuser('group'); + print ' '.$langs->trans("User").': '.$labeluser.':'.$labelgroup; + if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { + $arrayofinfoofuser = posix_getpwuid(posix_geteuid()); + print ' (POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')'; + } } else { print img_picto('', 'tick'); } diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index 9c54b60f900..93af0097087 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -59,13 +59,20 @@ print '\n"; + print '\n"; } // Web user group real (detected by 'id' external command) -$arrayout = array(); $varout = 0; -exec('id', $arrayout, $varout); -if (empty($varout)) { // Test command is ok. Work only on Linux OS. - print '\n"; +if (function_exists('exec')) { + $arrayout = array(); $varout = 0; + exec('id', $arrayout, $varout); + if (empty($varout)) { // Test command is ok. Work only on Linux OS. + print '\n"; + } } print '
'.$label.''.$label2.''.$langs->trans("NbOfMembers").' ('.$langs->trans("AllTime").')
'.$val['label'].''.$val['label2'].''.$val['nb'].'
'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).' '."\n"; -$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); -print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); -print '
'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).' '."\n"; +$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); +print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); +print '
'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'
'.$langs->trans("ShippableOrderIconInList").'
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); - } - else - { - if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) - { + } else { + if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '; - if (! empty($conf->use_javascript_ajax)) - { + if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); - } - else - { - if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) - { + } else { + if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - else - { + } else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print '
'; print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").' '.$langs->trans('NotAvailable').'
'; print $langs->trans("Required"); /*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; }*/ print "
'; if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; - if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) { - if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) { + print '
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); + if (!empty(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { + if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { print img_warning($langs->trans("ErrorBadEMail")); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); @@ -677,17 +677,17 @@ if ($action == 'edit') { // Domain print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_DOMAIN'); print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_SELECTOR'); print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY; + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY'); print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID_EMAILING.'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.getDolGlobalString('MAIN_MAIL_SMTPS_ID_EMAILING').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', getDolGlobalString('MAIN_MAIL_SMTPS_PW_EMAILING')).'
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING); + print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING')); } else { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -503,11 +503,9 @@ if ($action == 'edit') { print '
'; /* // Warning 1 - if ($linuxlike) - { + if ($linuxlike) { $sendmailoption=ini_get('mail.force_extra_parameters'); - if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) - { + if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption)) { print info_admin($langs->trans("SendmailOptionNotComplete")); } }*/ diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 9f766d76266..8f781318995 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -76,14 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'mymodule', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +125,19 @@ if ($id > 0) { $object->fetch($id); } +// Security check +$socid = 0; +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +// A non admin user can see profiles but limited to its own user +if (!$user->admin) { + if ($object->id > 0 && $object->private != $user->id) { + accessforbidden(); + } +} + /* * Actions @@ -261,6 +266,10 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// If non admin, restrict list to itself +if (empty($user->admin)) { + $sql .= " AND private = ".((int) $user->id); +} //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -315,32 +324,10 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit $num = $db->num_rows($resql); } -// Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id); - exit; -} // Output page // -------------------------------------------------------------------- -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 1d3faf71f1b..14960db11d7 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -32,10 +32,6 @@ $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'err $action = GETPOST('action', 'aZ09'); -if (!$user->admin) { - accessforbidden(); -} - $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. if ($action == 'test' || $action == 'send') { @@ -53,6 +49,10 @@ $substitutionarrayfortest = array( ); complete_substitutions_array($substitutionarrayfortest, $langs); +// Security check +if (!$user->admin) { + accessforbidden(); +} /* diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 701156303bb..e11ac077cc6 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -93,12 +93,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +101,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 6869d7897b3..c89ff3e3655 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -94,12 +94,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -107,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 9dea1bf8fd7..ab7d18b1331 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -99,12 +99,7 @@ if ($action != 'create' && $action != 'edit') { } -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -112,11 +107,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index ff13b5f4573..c4967f75313 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -92,13 +92,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -106,11 +100,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 011b28e7421..98b6c996181 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -406,7 +406,7 @@ if (!empty($conf->global->DATABASE_PWD_ENCRYPTED)) { if ($allow_disable_encryption) { //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes //Do not allow "disable encryption" as passwords cannot be decrypted - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } else { print '-'; } @@ -432,10 +432,10 @@ if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { print img_warning($langs->trans("WarningPassIsEmpty")); } else { if (empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } if (!empty($dolibarr_main_db_encrypted_pass)) { - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } } print "
'; - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; print "'; - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; print "
'.$langs->trans("DataRootServer")."".DOL_DATA_ROOT."'.$langs->trans("WebUserGroup")." (env vars)".$labeluser.'/'.$labelgroup."
'.$langs->trans("WebUserGroup")." (env vars)".$labeluser.':'.$labelgroup; + if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { + $arrayofinfoofuser = posix_getpwuid(posix_geteuid()); + print ' (POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')'; + } + print "
'.$langs->trans("WebUserGroup")." (real, 'id' command)".join(',', $arrayout)."
'.$langs->trans("WebUserGroup")." (real, 'id' command)".join(',', $arrayout)."
'; print '
'; diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 4a50beaa32e..0a4a851dae2 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -84,12 +84,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -97,11 +92,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index f68bc7382b5..34685676320 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -122,7 +122,8 @@ $utils = new Utils($db); if ($compression == 'zip') { $file .= '.zip'; - $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.back|\.old|\.log|[\\\/]temp[\\\/]|documents[\\\/]admin[\\\/]documents[\\\/])/i'); + $excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; + $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles); if ($ret < 0) { if ($ret == -2) { $langs->load("errors"); diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index 6d2799e0228..165361f7f57 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index e4bf739515f..3d722bca400 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -79,7 +79,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action $permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php -$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1]; +$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1]; /* diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index e5db1465fb6..ce8adad8e34 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -82,8 +82,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('Assets')." - ".$langs->trans('Documents'); -$helpurl = ''; -llxHeader('', $title, $helpurl); + +$help_url = ''; + +llxHeader('', $title, $help_url); $form = new Form($db); diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index f6d34454ad4..7a8f4c20ce2 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -57,8 +57,10 @@ $object->fetch($id); $form = new Form($db); $title = $langs->trans('Asset')." - ".$langs->trans('Info'); -$helpurl = ""; -llxHeader('', $title, $helpurl); + +$help_url = ""; + +llxHeader('', $title, $help_url); $object->info($id); diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 9d7e848b6d3..6103b963e21 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -196,8 +196,9 @@ if ($action == 'confirm_delete' && $user->rights->asset->write) { $form = new Form($db); -$helpurl = ''; -llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl); +$help_url = ''; + +llxHeader('', $langs->trans("AssetsTypeSetup"), $help_url); // List of asset type diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index a8033cf1c7a..ff57587d1b4 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -286,7 +286,7 @@ print '
'; // Sheet format print '
'; -print '
'; +print '
'; print $langs->trans("DescADHERENT_ETIQUETTE_TYPE").'   '; print '
'; // List of possible labels (defined into $_Avery_Labels variable set into core/lib/format_cards.lib.php) @@ -302,7 +302,7 @@ print '
'; // Number of stickers to print print '
'; -print '
'; +print '
'; print $langs->trans("NumberOfStickers").'   '; print '
'; print ''; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 2cf66d9c3f5..6a86f1c2258 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -51,11 +51,6 @@ if (GETPOST('actioncode', 'array')) { } $search_agenda_label = GETPOST('search_agenda_label'); -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'bom', $id); - $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -87,6 +82,11 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; } +// Security check - Protection if external user +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); /* diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 5547c21faab..fa2ef014d17 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -75,8 +75,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php @@ -656,11 +656,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($object->status == 1) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } } */ diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 92babe87003..520dd8bb9d7 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -79,6 +79,12 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object); } +// Security check - Protection if external user +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); + /* * Actions diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index eb1852699c0..62fb6002760 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -76,18 +76,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -if (empty($conf->bom->enabled)) { - accessforbidden('Module not enabled'); -} -$socid = 0; -if ($user->socid > 0) { - // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'bom', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +121,13 @@ $permissiontoread = $user->rights->bom->read; $permissiontoadd = $user->rights->bom->write; $permissiontodelete = $user->rights->bom->delete; +// Security check +if ($user->socid > 0) { + // Protection if external user + accessforbidden(); +} +$result = restrictedArea($user, 'bom'); + /* * Actions diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index cd288a3be3c..244bcfd7a49 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -57,9 +57,13 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->bom->multidir_output[$object->entity]."/".$object->id; } -$permissionnote = 1; -//$permissionnote=$user->rights->bom->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php +// Security check - Protection if external user +//if ($user->socid > 0) accessforbidden(); +//if ($user->socid > 0) $socid = $user->socid; +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); +restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); /* diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 0d691995c29..02cd6e2a784 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 5b54666b674..734f2e89506 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -97,7 +97,7 @@ $error = 0; // Add action if ($action == 'add' && $user->rights->categorie->creer) { - // Action ajout d'une categorie + // Action add a category if ($cancel) { if ($urlfrom) { header("Location: ".$urlfrom); @@ -167,7 +167,7 @@ if ($action == 'add' && $user->rights->categorie->creer) { // Confirm action if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->creer) { - // Action confirmation de creation categorie + // Action confirmation of creation category if ($action == 'confirmed') { if ($urlfrom) { header("Location: ".$urlfrom); @@ -208,8 +208,9 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr $form = new Form($db); $formother = new FormOther($db); -$helpurl = ''; -llxHeader("", $langs->trans("Categories"), $helpurl); +$help_url = 'EN:Module_Categories|FR:Module_Catégories|DE:Modul_Kategorien'; + +llxHeader("", $langs->trans("Categories"), $help_url); if ($user->rights->categorie->creer) { // Create or add diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index c7e574939ff..e30067e8815 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -153,12 +153,9 @@ if ($object->id) { - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - + /* + * Action bar + */ print '
'."\n"; if ($action != 'ajout_photo' && $user->rights->categorie->creer) { diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index de59aca376d..cd5d7ad8214 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -224,12 +224,9 @@ print dol_get_fiche_end(); -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - +/* + * Action bar + */ print "\n
\n"; if ($action == '') { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index dedb368202d..817c750a571 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -207,8 +207,10 @@ $formother = new FormOther($db); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); -$helpurl = ''; -llxHeader("", $langs->trans("Categories"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss); + +$help_url = ''; + +llxHeader("", $langs->trans("Categories"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss); $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 066001f6aa7..391b418f5b8 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2121,9 +2121,8 @@ if ($id > 0) { /* - * Barre d'actions + * Action bar */ - print '
'; $parameters = array(); @@ -2161,7 +2160,7 @@ if ($id > 0) { print ''; // ancre /* - * Documents generes + * Generated documents */ $filedir = $conf->agenda->multidir_output[$conf->entity].'/'.$object->id; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ab6de76f340..21c130cafac 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -743,7 +743,7 @@ class ActionComm extends CommonObject $sql .= " a.fk_element as elementid, a.elementtype,"; $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,"; $sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,"; - $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; + $sql .= " c.id as type_id, c.type as type_type, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql .= " s.nom as socname,"; $sql .= " u.firstname, u.lastname as lastname,"; $sql .= " num_vote, event_paid, a.status"; @@ -779,8 +779,9 @@ class ActionComm extends CommonObject $this->type_code = $obj->type_code; $this->type_color = $obj->type_color; $this->type_picto = $obj->type_picto; - $transcode = $langs->trans("Action".$obj->type_code); - $this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label); + $this->type = $obj->type_type; + /*$transcode = $langs->trans("Action".$obj->type_code); + $this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label); */ $transcode = $langs->trans("Action".$obj->type_code.'Short'); $this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : ''); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 3616de126be..6c92f07085b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1138,7 +1138,11 @@ if (count($listofextcals)) { if (isset($icalevent['DTSTART;VALUE=DATE'])) { // fullday event // For full day events, date are also GMT but they wont but converted using tz during output $datestart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1); - $dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day + if (empty($icalevent['DTEND;VALUE=DATE'])) { + $dateend = $datestart + 86400 - 1; + } else { + $dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day + } //print 'x'.$datestart.'-'.$dateend;exit; //print dol_print_date($dateend,'dayhour','gmt'); $event->fulldayevent = 1; @@ -1212,7 +1216,7 @@ if (count($listofextcals)) { // LOW = 0 to 4 // MEDIUM = 5 // HIGH = 6 to 9 - if ($icalevent['PRIORITY']) { + if (!empty($icalevent['PRIORITY'])) { $event->priority = $icalevent['PRIORITY']; } @@ -1233,7 +1237,7 @@ if (count($listofextcals)) { // X-MICROSOFT-CDO-BUSYSTATUS:OOF + TRANSP:OPAQUE => Away from the office / off-site } - if ($icalevent['LOCATION']) { + if (!empty($icalevent['LOCATION'])) { $event->location = $icalevent['LOCATION']; } diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index e314d0b3e66..bfa62eba7fc 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -86,13 +86,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -100,11 +94,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 4cbe35b31c5..834722f2afd 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -94,13 +94,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -108,11 +102,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 21cc9b0f5e2..8019dae6acb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -305,7 +305,9 @@ $title = $langs->trans("CustomerCard"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name; } -$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Geschäftspartner'; + llxHeader('', $title, $help_url); @@ -1334,9 +1336,8 @@ if ($object->id > 0) { /* - * Barre d'actions + * Action bar */ - print '
'; $parameters = array(); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 87345bb905e..b720ff638c9 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -441,7 +441,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { * Draft purchase orders */ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status"; + $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur"; @@ -485,7 +485,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $supplierorderstatic->id = $obj->rowid; $supplierorderstatic->ref = $obj->ref; - $supplierorderstatic->ref_supplier = $obj->ref_suppliert; + $supplierorderstatic->ref_supplier = $obj->ref_supplier; $supplierorderstatic->total_ht = $obj->total_ht; $supplierorderstatic->total_tva = $obj->total_tva; $supplierorderstatic->total_ttc = $obj->total_ttc; @@ -882,7 +882,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid; + //$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid; $warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : ''; print ''; @@ -998,7 +998,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid; + //$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid; //$warning = ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) ? img_warning($langs->trans("Late")) : ''; print ''; @@ -1013,7 +1013,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; - print ''.dol_print_date($db->jdate($obj->dp), 'day').''; + print ''.dol_print_date($db->jdate($obj->dv), 'day').''; print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a206e61064f..c8c94e7e95a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -300,6 +300,7 @@ if (empty($reshook)) { } } elseif ($action == 'setecheance' && $usercancreate) { $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) { dol_print_error($db, $object->error); } @@ -1425,7 +1426,7 @@ if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } -$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; +$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos|DE:Modul_Angebote'; llxHeader('', $langs->trans('Proposal'), $help_url); $now = dol_now(); @@ -2602,7 +2603,7 @@ if ($action == 'create') { print '
'; print ''; // ancre /* - * Documents generes + * Generated documents */ $objref = dol_sanitizeFileName($object->ref); $filedir = $conf->propal->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index e18891f3c60..3cb6de90a8d 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -81,7 +81,7 @@ $langs->loadLangs(array('propal', 'other', 'companies')); if ($mode == 'customer') { $picto = 'propal'; $title = $langs->trans("ProposalsStatistics"); - $dir = $conf->propale->dir_temp; + $dir = $conf->propal->dir_temp; $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 74de84b861a..a46e7df6b75 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1393,7 +1393,7 @@ if (empty($reshook)) { * View */ -llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'); +llxHeader('', $langs->trans('Order'), 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge'); $form = new Form($db); $formfile = new FormFile($db); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0975bfbd7ef..b29b594f8f2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2265,6 +2265,7 @@ class Commande extends CommonOrder $sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e'; $sql .= ', '.MAIN_DB_PREFIX.'element_element as el'; $sql .= ' WHERE el.fk_source = '.$this->id; + $sql .= " AND el.sourcetype = 'commande'"; $sql .= " AND el.fk_target = e.rowid"; $sql .= " AND el.targettype = 'shipping'"; @@ -3686,7 +3687,7 @@ class Commande extends CommonOrder $label .= ' '.$this->getLibStatut(5); } $label .= '
'.$langs->trans('Ref').': '.$this->ref; - $label .= '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this-ref_client) : $this->ref_customer); + $label .= '
'.$langs->trans('RefCustomer').': '.(empty($this->ref_customer) ? (empty($this->ref_client) ? '' : $this->ref_client) : $this->ref_customer); if (!empty($this->total_ht)) { $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 600c27b609e..d795a65802a 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -34,6 +34,7 @@ if ((array_key_exists('action', $_GET) && $_GET['action'] == 'dl') || (array_key require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; @@ -56,13 +57,12 @@ $date_start = GETPOST('date_start', 'alpha'); $date_startDay = GETPOST('date_startday', 'int'); $date_startMonth = GETPOST('date_startmonth', 'int'); $date_startYear = GETPOST('date_startyear', 'int'); -$date_start = ($date_startDay) ?dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear) : strtotime($date_start); +$date_start = ($date_startDay ? dol_mktime(0, 0, 0, $date_startMonth, $date_startDay, $date_startYear, 'tzuserrel') : dol_stringtotime($date_start)); $date_stop = GETPOST('date_stop', 'alpha'); $date_stopDay = GETPOST('date_stopday', 'int'); $date_stopMonth = GETPOST('date_stopmonth', 'int'); $date_stopYear = GETPOST('date_stopyear', 'int'); -//FIXME doldate -$date_stop = ($date_stopDay) ?dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear) : strtotime($date_stop); +$date_stop = ($date_stopDay ? dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear, 'tzuserrel') : dol_stringtotime($date_stop)); $action = GETPOST('action', 'aZ09'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -126,6 +126,17 @@ if (empty($entity)) { $error = 0; +$listofchoices = array( + 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled), 'perms' => !empty($user->rights->facture->lire)), + 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled), 'perms' => !empty($user->rights->fournisseur->facture->lire)), + 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled), 'perms' => !empty($user->rights->expensereport->lire)), + 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled), 'perms' => !empty($user->rights->don->lire)), + 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled), 'perms' => !empty($user->rights->tax->charges->lire)), + 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled), 'perms' => !empty($user->rights->salaries->read)), + 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled), 'perms' => !empty($user->rights->banque->lire)), + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled), 'perms' => !empty($user->rights->loan->read)), +); + /* @@ -155,7 +166,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $wheretail = " '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'"; // Customer invoices - if (GETPOST('selectinvoices')) { + if (GETPOST('selectinvoices') && !empty($listofchoices['selectinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -166,7 +177,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT; } // Vendor invoices - if (GETPOST('selectsupplierinvoices')) { + if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -177,7 +188,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT; } // Expense reports - if (GETPOST('selectexpensereports')) { + if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -188,7 +199,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".ExpenseReport::STATUS_DRAFT; } // Donations - if (GETPOST('selectdonations')) { + if (GETPOST('selectdonations') && !empty($listofchoices['selectdonations']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -199,7 +210,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; } // Payments of salaries - if (GETPOST('selectpaymentsofsalaries')) { + if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -210,7 +221,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT; } // Social contributions - if (GETPOST('selectsocialcontributions')) { + if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -221,7 +232,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; } // Various payments - if (GETPOST('selectvariouspayment')) { + if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -231,7 +242,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; } // Loan payments - if (GETPOST('selectloanspayment')) { + if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms'])) { if (!empty($sql)) { $sql .= " UNION ALL"; } @@ -539,8 +550,11 @@ print ''; print ''.$langs->trans("ExportAccountingSourceDocHelp", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals")).'
'; print '
'; -print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0); -print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n"; +print $langs->trans("ReportPeriod").': '; +print $form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print ' - '; +print $form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0, '', '', '', '', 1, '', '', 'tzuserrel'); +print "\n"; // Export is for current company only if (!empty($conf->multicompany->enabled) && is_object($mc)) { @@ -558,22 +572,16 @@ if (!empty($conf->multicompany->enabled) && is_object($mc)) { print '
'; -$listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'lang'=>'bills', 'enabled' => !empty($conf->facture->enabled)), - 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'lang'=>'bills', 'enabled' => !empty($conf->supplier_invoice->enabled)), - 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips', 'enabled' => !empty($conf->expensereport->enabled)), - 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation', 'enabled' => !empty($conf->don->enabled)), - 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'enabled' => !empty($conf->tax->enabled)), - 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries', 'enabled' => !empty($conf->salaries->enabled)), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'enabled' => !empty($conf->banque->enabled)), - 'selectloanspayment'=>array('label'=>'PaymentLoan', 'enabled' => !empty($conf->loan->enabled)), -); foreach ($listofchoices as $choice => $val) { if (empty($val['enabled'])) { continue; // list not qualified } + $disabled = ''; + if (empty($val['perms'])) { + $disabled = ' disabled'; + } $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); - print '
'; + print '
'; } print ''; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 217b735a299..37ef8a5da76 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -10,7 +10,6 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * * 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 @@ -644,20 +643,21 @@ if ($search_description) { } $sql .= natural_search("b.label", $search_description_to_use); // Warning some text are just translation keys, not translated strings } + if ($search_bid > 0) { - $sql .= " AND b.rowid=l.lineid AND l.fk_categ=".$search_bid; + $sql .= " AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid); } if (!empty($search_type)) { - $sql .= " AND b.fk_type = '".$db->escape($search_type)."' "; + $sql .= " AND b.fk_type = '".$db->escape($search_type)."'"; } // Search criteria amount -$search_debit = price2num(str_replace('-', '', $search_debit)); -$search_credit = price2num(str_replace('-', '', $search_credit)); if ($search_debit) { - $sql .= natural_search('- b.amount', $search_debit, 1); + $sql .= natural_search('ABS(b.amount)', $search_debit, 1); + $sql .= ' AND b.amount <= 0'; } if ($search_credit) { $sql .= natural_search('b.amount', $search_credit, 1); + $sql .= ' AND b.amount >= 0'; } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -898,18 +898,21 @@ if ($resql) { print '
'; } - /// ajax to adjust value date with plus and less picto + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); print ' + '; + */ print '
'; print dol_get_fiche_end(); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 53d43583a9c..be91d475d4d 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -454,11 +454,14 @@ if (empty($numref)) { // Date de valeur print ''; - print dol_print_date($db->jdate($objp->dv), "day").' '; - print ''; + print ''.dol_print_date($db->jdate($objp->dv), "day").''; + print ' '; + print ''; + print ''; print img_edit_remove()." "; - print ''; + print ''; print img_edit_add().""; + print ''; print "\n"; // Type and num @@ -656,6 +659,29 @@ if (empty($numref)) { print "\n"; print ""; + // Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page + $urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken(); + print ' + + '; + print "
"; print "\n"; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 1d0613ead0a..c94f8810cd8 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "categories", "multicurrency")); - +$socid = 0; +if ($user->socid > 0) { + $socid = $user->socid; +} if (!$user->rights->banque->transfer) { accessforbidden(); } @@ -230,6 +233,7 @@ $account_from = ''; $account_to = ''; $label = ''; $amount = ''; +$amountto = ''; if ($error) { $account_from = GETPOST('account_from', 'int'); diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index b1dac2858b0..6ccd953a68b 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -37,22 +37,23 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array('banks', 'categories', 'bills', 'companies')); // Security check -if (isset($_GET["account"]) || isset($_GET["ref"])) { - $id = isset($_GET["account"]) ? $_GET["account"] : (isset($_GET["ref"]) ? $_GET["ref"] : ''); +if (GETPOSTISSET("account") || GETPOSTISSET("ref")) { + $id = GETPOSTISSET("account") ? GETPOST("account") : (GETPOSTISSET("ref") ? GETPOST("ref") : ''); } -$fieldid = isset($_GET["ref"]) ? 'ref' : 'rowid'; +$fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid'; if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid); -$vline = isset($_GET["vline"]) ? $_GET["vline"] : $_POST["vline"]; -$page = isset($_GET["page"]) ? $_GET["page"] : 0; +$vline = GETPOST('vline'); +$page = GETPOSTISSET("page") ? GETPOST("page") : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('banktreso', 'globalcard')); + /* * View */ @@ -68,7 +69,7 @@ $socialcontribstatic = new ChargeSociales($db); $form = new Form($db); -if ($_REQUEST["account"] || $_REQUEST["ref"]) { +if (GETPOST("account") || GETPOST("ref")) { if ($vline) { $viewline = $vline; } else { @@ -76,11 +77,11 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) { } $object = new Account($db); - if ($_GET["account"]) { - $result = $object->fetch($_GET["account"]); + if (GETPOST("account", 'int')) { + $result = $object->fetch(GETPOST("account", 'int')); } - if ($_GET["ref"]) { - $result = $object->fetch(0, $_GET["ref"]); + if (GETPOST("ref")) { + $result = $object->fetch(0, GETPOST("ref")); $_GET["account"] = $object->id; } @@ -91,6 +92,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) { $linkback = ''.$langs->trans("BackToList").''; + $morehtmlref = ''; + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); print dol_get_fiche_end(); diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index d19ccbed908..2b4a68bec90 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -665,7 +665,7 @@ if ($id) { /* - * Action buttons + * Action bar */ print '
'."\n"; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index da018dd1f06..ccaa0158af2 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -67,11 +67,6 @@ if ($contextpage == 'takepos') { $_GET['optioncss'] = 'print'; } -// Security check -if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { - accessforbidden(); -} - $arrayofpaymentmode = array('cash'=>'Cash', 'cheque'=>'Cheque', 'card'=>'CreditCard'); $arrayofposavailable = array(); @@ -95,6 +90,15 @@ $hookmanager->initHooks(array('cashcontrolcard', 'globalcard')); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +// Security check +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { + accessforbidden(); +} + /* * Actions diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 6c4141e4b6a..3b97b967208 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -94,14 +94,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -$socid = 0; -if ($user->socid > 0) { // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'monmodule', $id, ''); - // Initialize array of search criterias $search_all = GETPOST("search_all", 'alpha'); $search = array(); @@ -133,6 +125,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +// Security check +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { + accessforbidden(); +} /* diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index f6c58aa858c..95c18dbf261 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -72,6 +72,15 @@ $sday = $cashcontrol->day_close; $posmodule = $cashcontrol->posmodule; $terminalid = $cashcontrol->posnumber; +// Security check +if ($user->socid > 0) { // Protection if external user + //$socid = $user->socid; + accessforbidden(); +} +if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { + accessforbidden(); +} + /* * View diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 1d294df8cff..3d4693f8c7b 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -463,9 +463,8 @@ if ($action == 'create') { print '
'; /* - * Barre d'actions + * Action bar */ - print '
'; if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index 82520c02fac..05aa47737be 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index 5264ee5472c..6ebdfae6277 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -91,7 +91,7 @@ if ($action != 'create' && $action != 'edit') { /* * - * Creation d'un champ optionnel + * Creation of an optional field * */ @@ -104,7 +104,7 @@ if ($action == 'create') { /* * - * Edition d'un champ optionnel + * Edition of an optional field * */ if ($action == 'edit' && !empty($attrname)) { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 1978a6115b5..4f0148a05a1 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -65,7 +65,6 @@ $objecttype = 'facture_rec'; if ($action == "create" || $action == "add") { $objecttype = ''; } -$result = restrictedArea($user, 'facture', $id, $objecttype); $projectid = GETPOST('projectid', 'int'); $year_date_when = GETPOST('year_date_when'); @@ -127,6 +126,8 @@ $now = dol_now(); $error = 0; +$result = restrictedArea($user, 'facture', $object->id, $objecttype); + /* * Actions @@ -1634,8 +1635,8 @@ if ($action == 'create') { print dol_get_fiche_end(); - /** - * Barre d'actions + /* + * Action bar */ print '
'; @@ -1657,15 +1658,15 @@ if ($action == 'create') { if ($user->rights->facture->creer) { if (empty($object->suspended)) { - print ''; + print ''; } else { - print ''; + print ''; } } //if ($object->statut == Facture::STATUS_DRAFT && $user->rights->facture->supprimer) if ($user->rights->facture->supprimer) { - print ''; + print ''; } print '
'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8c291a0839b..925885e4e7a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -138,19 +138,19 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdonw.inc.php $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php +// retained warranty invoice available type +$retainedWarrantyInvoiceAvailableType = array(); +if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { + $retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY); +} + // Security check $fieldid = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); -$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); - -// retained warranty invoice available type -$retainedWarrantyInvoiceAvailableType = array(); -if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { - $retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY); -} +$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft); /* @@ -2815,9 +2815,10 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Card'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); // Mode creation @@ -5459,7 +5460,7 @@ if ($action == 'create') { print '
'; print ''; // ancre - // Documents generes + // Generated documents $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $urlsource = $_SERVER['PHP_SELF'].'?facid='.$object->id; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index c16d79d2574..ad44dbe6637 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * 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 diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 16880cd2369..1605ecb8207 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1543,6 +1543,13 @@ class Facture extends CommonInvoice } } + global $action, $hookmanager; + $hookmanager->initHooks(array('invoicedao')); + $parameters = array('id'=>$this->id, 'getnomurl'=>$result, 'notooltip' => $notooltip, 'addlinktonotes' => $addlinktonotes, 'save_lastsearch_value'=> $save_lastsearch_value, 'target' => $target); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) $result = $hookmanager->resPrint; + else $result .= $hookmanager->resPrint; + return $result; } @@ -1553,7 +1560,7 @@ class Facture extends CommonInvoice * @param string $ref Reference of invoice * @param string $ref_ext External reference of invoice * @param int $notused Not used - * @param bool $fetch_situation Fetch the previous and next situation in $tab_previous_situation_invoice and $tab_next_situation_invoice + * @param bool $fetch_situation Load also the previous and next situation invoice into $tab_previous_situation_invoice and $tab_next_situation_invoice * @return int >0 if OK, <0 if KO, 0 if not found */ public function fetch($rowid, $ref = '', $ref_ext = '', $notused = '', $fetch_situation = false) diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index dc1fe1e7c45..19e76b15c5c 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -48,9 +48,14 @@ $action = GETPOST('action', 'aZ09'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'facture', $id); $object = new Facture($db); +// Load object +if ($id > 0 || !empty($ref)) { + $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); +} + +$result = restrictedArea($user, 'facture', $object->id); /* @@ -58,8 +63,6 @@ $object = new Facture($db); */ if ($action == 'addcontact' && $user->rights->facture->creer) { - $result = $object->fetch($id); - if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); @@ -79,14 +82,9 @@ if ($action == 'addcontact' && $user->rights->facture->creer) { } } elseif ($action == 'swapstatut' && $user->rights->facture->creer) { // Toggle the status of a contact - if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne')); - } else { - dol_print_error($db); - } + $result = $object->swapContactStatus(GETPOST('ligne')); } elseif ($action == 'deletecontact' && $user->rights->facture->creer) { // Deletes a contact - $object->fetch($id); $result = $object->delete_contact($lineid); if ($result >= 0) { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index c44aeae67ca..f4937679504 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -48,12 +48,6 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'facture', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -73,11 +67,17 @@ if (!$sortfield) { } $object = new Facture($db); -if ($object->fetch($id)) { +if ($object->fetch($id, $ref)) { $object->fetch_thirdparty(); $upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref); } +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'facture', $object->id, ''); + /* * Actions @@ -91,8 +91,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; */ $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); + +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); $form = new Form($db); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 97646d56103..5b9b7fc4316 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -38,6 +38,25 @@ $langs->loadLangs(array('companies', 'bills')); $id = GETPOST("facid", "int"); $ref = GETPOST("ref", 'alpha'); +$object = new Facture($db); +$extrafields = new ExtraFields($db); + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +if ($id > 0 || !empty($ref)) { + $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); +} + +// Security check +$fieldid = (!empty($ref) ? 'ref' : 'rowid'); +if ($user->socid) { + $socid = $user->socid; +} +$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); +$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $fieldid, $isdraft); + /* * View @@ -46,11 +65,10 @@ $ref = GETPOST("ref", 'alpha'); $form = new Form($db); $title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info'); -$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; -llxHeader('', $title, $helpurl); +$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $help_url); -$object = new Facture($db); -$object->fetch($id, $ref); $object->fetch_thirdparty(); $object->info($object->id); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index b271ea2e876..be552601f5e 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -165,6 +165,11 @@ if ($socid > 0) { } } +$objecttype = 'facture_rec'; + +$result = restrictedArea($user, 'facture', $object->id, $objecttype); + + /* * Actions */ diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index abbb116da60..a1d5af27979 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -187,7 +187,7 @@ if (empty($user->socid)) { $checkedtypetiers = 0; $arrayfields = array( 'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), - 'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1, 'position'=>10), + 'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>-1, 'position'=>10), 'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15), 'f.date'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20), 'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22), @@ -204,8 +204,8 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75), 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80), 'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85), - 'f.module_source'=>array('label'=>"Module", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>90), - 'f.pos_source'=>array('label'=>"Terminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>91), + 'f.module_source'=>array('label'=>"Module", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>90), + 'f.pos_source'=>array('label'=>"Terminal", 'checked'=>($contextpage == 'poslist' ? 1 : 0), 'enabled'=>((empty($conf->cashdesk->enabled) && empty($conf->takepos->enabled) && empty($conf->global->INVOICE_SHOW_POS)) ? 0 : 1), 'position'=>91), 'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95), 'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100), 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj == "1"), 'position'=>110), @@ -493,6 +493,10 @@ if ($search_user > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; @@ -689,10 +693,19 @@ if (!$sall) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } } + // Add GroupBy from hooks + $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); + $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook + $sql .= $hookmanager->resPrint; } else { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= ' ORDER BY '; $listfield = explode(',', $sortfield); $listorder = explode(',', $sortorder); @@ -865,6 +878,10 @@ if ($resql) { // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + // Add $param from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook + $param .= $hookmanager->resPrint; $arrayofmassactions = array( 'validate'=>$langs->trans("Validate"), diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 23d4afb0417..f019d822529 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -41,6 +41,14 @@ $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); +$object = new Facture($db); +// Load object +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); +} + +$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php + // Security check $socid = 0; if ($user->socid) { @@ -48,11 +56,6 @@ if ($user->socid) { } $result = restrictedArea($user, 'facture', $id, ''); -$object = new Facture($db); -$object->fetch($id); - -$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php - /* * Actions diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index ee7dbb5e3f4..d4091a6df90 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -266,7 +266,7 @@ if ($id) { /* - * Action buttons + * Action bar */ print "
\n"; if ($object->rappro == 0) { diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 675f8d64bcc..bc79ff07d47 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -227,7 +227,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; print ''; @@ -279,7 +279,7 @@ if ($action == 'create') { } $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { print '-'; } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 4e55a78314f..68ca3795fe3 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -225,12 +225,9 @@ if ($id) { print ''; } - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - + /* + * Action bar + */ print "
"; if ($action == '') { diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index b30ab96f7e6..3528b668027 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -49,18 +49,6 @@ $date_endday = GETPOST('date_endday', 'int'); $date_endyear = GETPOST('date_endyear', 'int'); $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ?GETPOST('showaccountdetail', 'aZ09') : 'no'; -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->socid > 0) { - $socid = $user->socid; -} -if (!empty($conf->comptabilite->enabled)) { - $result = restrictedArea($user, 'compta', '', '', 'resultat'); -} -if (!empty($conf->accounting->enabled)) { - $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); -} - $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -151,6 +139,17 @@ if (GETPOST("modecompta", 'alpha')) { $AccCat = new AccountancyCategory($db); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid > 0) { + $socid = $user->socid; +} +if (!empty($conf->comptabilite->enabled)) { + $result = restrictedArea($user, 'compta', '', '', 'resultat'); +} +if (!empty($conf->accounting->enabled)) { + $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); +} /* diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 0616327cc39..0f54bb93a36 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -108,6 +108,14 @@ $year_end = $tmpe['year']; $nbofyear = ($year_end - $year_start) + 1; //var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour')); +// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') +$modecompta = $conf->global->ACCOUNTING_MODE; +if (!empty($conf->accounting->enabled)) { + $modecompta = 'BOOKKEEPING'; +} +if (GETPOST("modecompta", 'alpha')) { + $modecompta = GETPOST("modecompta", 'alpha'); +} // Security check $socid = GETPOST('socid', 'int'); @@ -121,15 +129,6 @@ if (!empty($conf->accounting->enabled)) { $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); } -// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') -$modecompta = $conf->global->ACCOUNTING_MODE; -if (!empty($conf->accounting->enabled)) { - $modecompta = 'BOOKKEEPING'; -} -if (GETPOST("modecompta", 'alpha')) { - $modecompta = GETPOST("modecompta", 'alpha'); -} - /* * View diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index df3a82a4b7f..91932100565 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -144,16 +144,20 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta", 'alpha'); } -// Security check -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->rights->accounting->comptarapport->lire) { - accessforbidden(); -} - $AccCat = new AccountancyCategory($db); +// Security check +$socid = GETPOST('socid', 'int'); +if ($user->socid > 0) { + $socid = $user->socid; +} +if (!empty($conf->comptabilite->enabled)) { + $result = restrictedArea($user, 'compta', '', '', 'resultat'); +} +if (!empty($conf->accounting->enabled)) { + $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); +} + /* * View diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 430df926859..067c021fe75 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -48,7 +48,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks', 'hrm')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); @@ -93,7 +93,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { // Link to a project if ($action == 'classin' && $user->rights->tax->charges->creer) { $object->fetch($id); - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('fk_project')); } if ($action == 'setfk_user' && $user->rights->tax->charges->creer) { @@ -360,20 +360,20 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } // Payment Mode print ''.$langs->trans('PaymentMode').''; - $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); + $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id'); print ''; // Bank Account if (!empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; - print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 2, '', 0, '', 1); + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1); print ''; } @@ -475,7 +475,7 @@ if ($id > 0) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 79379ee0b24..1644a4ee5e3 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -44,16 +44,16 @@ $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $year = GETPOST("year", 'int'); $month = GETPOST("month", 'int'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int"); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index c6c0e8e0816..25d9d4b9460 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -52,8 +52,8 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } -$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"]; -$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"]; +$sortorder = GETPOST("sortorder", 'aZ09'); +$sortfield = GETPOST("sortfield", 'aZ09'); if (!$sortorder) { $sortorder = "asc"; } @@ -89,16 +89,16 @@ $date_endyear = GETPOST("date_endyear"); $date_endmonth = GETPOST("date_endmonth"); $date_endday = GETPOST("date_endday"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int"); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 10c938ad8b4..e844f2aa619 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -51,8 +51,8 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } -$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"]; -$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"]; +$sortorder = GETPOST("sortorder", 'aZ09'); +$sortfield = GETPOST("sortfield", 'aZ09'); if (!$sortorder) { $sortorder = "asc"; } @@ -61,25 +61,25 @@ if (!$sortfield) { } // Date range -$year = GETPOST("year"); -$month = GETPOST("month"); -$date_startyear = GETPOST("date_startyear"); -$date_startmonth = GETPOST("date_startmonth"); -$date_startday = GETPOST("date_startday"); -$date_endyear = GETPOST("date_endyear"); -$date_endmonth = GETPOST("date_endmonth"); -$date_endday = GETPOST("date_endday"); +$year = GETPOST("year", 'int'); +$month = GETPOST("month", 'int'); +$date_startyear = GETPOST("date_startyear", 'int'); +$date_startmonth = GETPOST("date_startmonth", 'int'); +$date_startday = GETPOST("date_startday", 'int'); +$date_endyear = GETPOST("date_endyear", 'int'); +$date_endmonth = GETPOST("date_endmonth", 'int'); +$date_endday = GETPOST("date_endday", 'int'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, $_REQUEST["date_startmonth"], $_REQUEST["date_startday"], $_REQUEST["date_startyear"]); -$date_end = dol_mktime(23, 59, 59, $_REQUEST["date_endmonth"], $_REQUEST["date_endday"], $_REQUEST["date_endyear"]); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q") ?GETPOST("q") : 0; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 159422c081c..1600b75cff4 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -44,8 +44,8 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } -$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"]; -$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"]; +$sortorder = GETPOST("sortorder", 'aZ09'); +$sortfield = GETPOST("sortfield", 'aZ09'); if (!$sortorder) { $sortorder = "asc"; } @@ -83,23 +83,23 @@ $search_societe = GETPOST("search_societe", 'alpha'); $search_zip = GETPOST("search_zip", 'alpha'); $search_town = GETPOST("search_town", 'alpha'); $search_country = GETPOST("search_country", 'alpha'); -$date_startyear = GETPOST("date_startyear", 'alpha'); -$date_startmonth = GETPOST("date_startmonth", 'alpha'); -$date_startday = GETPOST("date_startday", 'alpha'); -$date_endyear = GETPOST("date_endyear", 'alpha'); -$date_endmonth = GETPOST("date_endmonth", 'alpha'); -$date_endday = GETPOST("date_endday", 'alpha'); +$date_startyear = GETPOST("date_startyear", 'int'); +$date_startmonth = GETPOST("date_startmonth", 'int'); +$date_startday = GETPOST("date_startday", 'int'); +$date_endyear = GETPOST("date_endyear", 'int'); +$date_endmonth = GETPOST("date_endmonth", 'int'); +$date_endday = GETPOST("date_endday", 'int'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int") ?GETPOST("q", "int") : 0; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 5f5ecb1de91..15f0e89987f 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -51,8 +51,8 @@ if (empty($year)) { $month_current = dol_print_date(dol_now(), "%m"); $year_start = $year - ($nbofyear - 1); } -$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); -$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); +$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzuserrel'); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index b199dcbeb9c..bf91d8b4d6a 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca.php + * \file htdocs/compta/stats/supplier_turnover.php * \brief Page reporting purchase turnover */ @@ -47,8 +47,8 @@ if (empty($year)) { $month_current = strftime("%m", dol_now()); $year_start = $year - ($nbofyear - 1); } -$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); -$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); +$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzuserrel'); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end @@ -120,8 +120,6 @@ if (!empty($conf->accounting->enabled)) { } - - /* * View */ diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index bdf4e5e0f85..26659c851f9 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -30,27 +30,14 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array("products", "categories", "errors", 'accountancy')); -// Security pack (data & check) -$socid = GETPOST('socid', 'int'); - -if ($user->socid > 0) { - $socid = $user->socid; -} -if (!empty($conf->comptabilite->enabled)) { - $result = restrictedArea($user, 'compta', '', '', 'resultat'); -} -if (!empty($conf->accounting->enabled)) { - $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); -} - // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta = $conf->global->ACCOUNTING_MODE; if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } -$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"]; -$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"]; +$sortorder = GETPOST("sortorder", 'aZ09'); +$sortfield = GETPOST("sortfield", 'aZ09'); if (!$sortorder) { $sortorder = "asc"; } @@ -84,16 +71,16 @@ $date_endyear = GETPOST("date_endyear"); $date_endmonth = GETPOST("date_endmonth"); $date_endday = GETPOST("date_endday"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int"); @@ -204,6 +191,19 @@ foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } +// Security pack (data & check) +$socid = GETPOST('socid', 'int'); + +if ($user->socid > 0) { + $socid = $user->socid; +} +if (!empty($conf->comptabilite->enabled)) { + $result = restrictedArea($user, 'compta', '', '', 'resultat'); +} +if (!empty($conf->accounting->enabled)) { + $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); +} + /* * View diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index fbfb0994e4a..4b64b2e5942 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/compta/stats/supplier_ca_by_thirdparty.php + * \file htdocs/compta/stats/supplier_turnover_by_thirdparty.php * \brief Page reporting purchase turnover by thirdparty */ @@ -38,8 +38,8 @@ if (GETPOST("modecompta")) { $modecompta = GETPOST("modecompta"); } -$sortorder = isset($_GET["sortorder"]) ? $_GET["sortorder"] : $_POST["sortorder"]; -$sortfield = isset($_GET["sortfield"]) ? $_GET["sortfield"] : $_POST["sortfield"]; +$sortorder = GETPOST("sortorder", 'aZ09'); +$sortfield = GETPOST("sortfield", 'aZ09'); if (!$sortorder) { $sortorder = "asc"; } @@ -59,17 +59,6 @@ if (GETPOST('subcat', 'alpha') === 'yes') { // Hook $hookmanager->initHooks(array('supplierturnoverbythirdpartylist')); -// Security check -if ($user->socid > 0) { - $socid = $user->socid; -} -if (!empty($conf->comptabilite->enabled)) { - $result = restrictedArea($user, 'compta', '', '', 'resultat'); -} -if (!empty($conf->accounting->enabled)) { - $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); -} - // Date range $year = GETPOST("year", 'int'); $month = GETPOST("month", 'int'); @@ -84,16 +73,16 @@ $date_endyear = GETPOST("date_endyear", 'alpha'); $date_endmonth = GETPOST("date_endmonth", 'alpha'); $date_endday = GETPOST("date_endday", 'alpha'); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - $month_current = strftime("%m", dol_now()); + $year_current = dol_print_date(dol_now(), '%Y'); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year_current; } else { $year_current = $year; - $month_current = strftime("%m", dol_now()); + $month_current = dol_print_date(dol_now(), '%m'); $year_start = $year; } -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzuserrel'); +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzuserrel'); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int") ?GETPOST("q", "int") : 0; @@ -175,6 +164,17 @@ foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } +// Security check +if ($user->socid > 0) { + $socid = $user->socid; +} +if (!empty($conf->comptabilite->enabled)) { + $result = restrictedArea($user, 'compta', '', '', 'resultat'); +} +if (!empty($conf->accounting->enabled)) { + $result = restrictedArea($user, 'accounting', '', '', 'comptarapport'); +} + /* * View diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 40261cb7f05..71e511397b6 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -722,7 +722,7 @@ if ($id) { } /* - * Action buttons + * Action bar */ print "
\n"; if ($action != 'edit') { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index e75908adc10..421b88ea6b8 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi * @@ -1035,7 +1035,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Unsubscribe if (!empty($conf->mailing->enabled)) { - if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1) { + if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1) { print "\n".''; - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print ''; + print $langs->trans("Usage"); + print ''; + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print ' '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print ''; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print ' '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print ' '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print ''; + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print ''; - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print ''; - print '
'; - } - - if (!empty($conf->eventorganization->enabled)) { - print ' '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - - print ''; - print ''; // Thirdparty if ($conf->societe->enabled) { @@ -805,45 +805,48 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Usage - print ''; - print $langs->trans("Usage"); - print ''; - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print ''; - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print ' '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + if (jQuery("#usage_opportunity").prop("checked")) { + console.log("Show opportunities fields"); + jQuery(".classuseopportunity").show(); + } else { + console.log("Hide opportunities fields "+jQuery("#usage_opportunity").prop("checked")); + jQuery(".classuseopportunity").hide(); + } + }); + });'; + print ''; + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')) . '"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print ' '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print ''; } print ''; @@ -980,7 +983,6 @@ if ($action == 'create' && $user->rights->projet->creer) { dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; print '
'; @@ -988,35 +990,37 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Usage - print ''; - print ''; + print ''; } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; - } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; @@ -1325,7 +1329,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // ancre /* - * Documents generes + * Generated documents */ $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c85ebddadc1..137757eae1a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1168,6 +1168,8 @@ class Project extends CommonObject $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id; } elseif ($option == 'preview') { $url = DOL_URL_ROOT.'/projet/element.php?id='.$this->id; + } elseif ($option == 'eventorganization') { + $url = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_list.php?projectid='.$this->id; } else { $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id; } diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 7f6c6c4f009..8fc018ab8ab 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -313,34 +313,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index ac8ed3879cd..f72b1eba7d2 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -235,34 +235,36 @@ print '
'; print ''; // Usage -print ''; -print ''; + print ''; } -if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; -} -if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; -} -if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); -} -print ''; // Visibility print ''; if (!$i) { diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index f25e78bceda..6b1b0eac4c1 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -65,7 +65,7 @@ $includeuserlist = array(); llxHeader('', $langs->trans('Projects')); $title = $langs->trans("ProjectsStatistics"); -$dir = $conf->projet->dir_output.'/temp'; +$dir = $conf->project->dir_output.'/temp'; print load_fiche_titre($title, '', 'project'); @@ -224,7 +224,8 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $mesg = $px3->isGraphKo(); if (!$mesg) { $px3->SetData($data); - $i = $startyear; $legend = array(); + $i = $startyear; + $legend = array(); while ($i <= $endyear) { $legend[] = $i; $i++; @@ -268,7 +269,7 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -complete_head_from_modules($conf, $langs, null, $head, $h, $type); +complete_head_from_modules($conf, $langs, null, $head, $h, 'project_stats'); print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); @@ -337,9 +338,9 @@ foreach ($data_all_year as $val) { print ''; print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } print ''; $oldyear = $year; @@ -350,7 +351,7 @@ print ''; print '
'; -$stringtoshow .= '
'; -print $langs->trans("Usage"); -print ''; -if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; +if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 7795981c4c3..cf8cc1dd34d 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -35,6 +35,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $num = $db->num_rows($resql); $i = 0; + $total = 0; $totalnb = 0; $totaloppnb = 0; $totalamount = 0; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 933abd53692..e6b381a6650 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -987,7 +987,7 @@ while ($i < min($num, $limit)) { // Project url if (!empty($arrayfields['p.ref']['checked'])) { print ''; - print $object->getNomUrl(1); + print $object->getNomUrl(1, (!empty(GETPOST('search_usage_event_organization', 'int'))?'eventorganization':'')); if ($object->hasDelay()) { print img_warning($langs->trans('Late')); } @@ -1198,8 +1198,8 @@ while ($i < min($num, $limit)) { // Event Organization if (!empty($arrayfields['p.usage_organize_event']['checked'])) { print ''; - if ($obj->usage_event_organization) { - print yn($obj->usage_event_organization); + if ($obj->usage_organize_event) { + print yn($obj->usage_organize_event); } print ' 0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].''.($val['total'] ?price(price2num($val['total'], 'MT'), 1) : '0').''.($val['avg'] ?price(price2num($val['avg'], 'MT'), 1) : '0').''.($val['weighted'] ?price(price2num($val['weighted'], 'MT'), 1) : '0').''.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').''.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').''.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').'
'; +$stringtoshow = '
'; if ($mesg) { print $mesg; } else { diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index eb5b0ae7b0a..07724753f2d 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -462,34 +462,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 9829e079da6..8ce97133493 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -147,29 +147,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; - // Usage + // Opportunities if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) && !empty($object->usage_opportunity)) { // Opportunity status print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; @@ -180,7 +187,7 @@ if ($id > 0 || !empty($ref)) { } print '
'.$langs->trans("OpportunityStatus").''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 854e57bbd1f..7916c236fb3 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -209,29 +209,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 9e2ea202601..afa63f7eee4 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -166,29 +166,36 @@ if ($object->id > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index e23b5e3d70b..2452cc71d86 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -141,29 +141,36 @@ if ($object->id > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print ''; - print ''; + print ''; print ''; print ''; } print ''; - print ''; + print ''; print ''; print ''; $oldyear = $year; @@ -208,7 +208,7 @@ print ''; print '
'; -$stringtoshow .= '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 81c05fde59d..531b9eb7b3a 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -65,7 +65,7 @@ $includeuserlist = array(); llxHeader('', $langs->trans('Tasks')); $title = $langs->trans("TasksStatistics"); -$dir = $conf->projet->dir_output.'/temp'; +$dir = $conf->project->dir_output.'/temp'; print load_fiche_titre($title, '', 'projecttask'); @@ -134,12 +134,12 @@ if (!count($arrayyears)) { $h = 0; $head = array(); -$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -complete_head_from_modules($conf, $langs, null, $head, $h, $type); +complete_head_from_modules($conf, $langs, null, $head, $h, 'project_tasks_stats'); print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); @@ -191,13 +191,13 @@ foreach ($data_all_year as $val) { $oldyear--; print '
0 ? '&userid='.$userid : '').'">'.$oldyear.' 0 ? '&userid='.$userid : '').'">'.$oldyear.'0
0 ? '&userid='.$userid : '').'">'.$year.' 0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].'
'; +$stringtoshow = '
'; if ($mesg) { print $mesg; } else { diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 7895838e18e..828b32c599f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -252,29 +252,36 @@ if ($id > 0 || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; @@ -617,7 +624,7 @@ if ($id > 0 || !empty($ref)) { print ''; // ancre /* - * Documents generes + * Generated documents */ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 0beacab18a0..eb1c394d8cf 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -612,34 +612,36 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - if (!empty($conf->eventorganization->enabled)) { - print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("EventOrganizationDescriptionLong"); - print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); - } - print ''; // Visibility print ''; print ''; } elseif (!empty($object->socialnetworks[$key])) { @@ -2089,7 +2091,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Prof ids - $i = 1; $j = 0; $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); + $i = 1; + $j = 0; + $NBCOLS = ($conf->browser->layout == 'phone' ? 1 : 2); while ($i <= 6) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); if ($idprof != '-') { @@ -2875,7 +2879,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // ancre /* - * Documents generes + * Generated documents */ $filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47d714e08db..c141290d9e9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand * Copyright (C) 2019-2020 Josep Lluís Amador - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * Copyright (C) 2020 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -4247,7 +4247,7 @@ class Societe extends CommonObject $table = 'supplier_proposal'; } - $sql = "SELECT rowid, total_ht, total as total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; + $sql = "SELECT rowid, total_ht, total_ttc, fk_statut as status FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ".$this->id; if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('supplier_proposal').")"; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 6729a984820..b76a80e1148 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -189,7 +189,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; - $thirdpartycateggraph .= '
'; + $thirdpartycateggraph = '
'; $thirdpartycateggraph .= '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index aaf7e38cac8..133c5d1b18a 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/public/cron/cron_run_jobs.php + * \file htdocs/public/cron/cron_run_jobs_by_url.php * \ingroup cron * \brief Execute pendings jobs */ diff --git a/htdocs/public/project/index.html b/htdocs/public/project/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/public/project/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 51b8dbf9aa1..f25843f69e4 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/public/lead/new.php + * \file htdocs/public/project/new.php * \ingroup project * \brief Example of form to add a new lead */ diff --git a/htdocs/recruitment/admin/candidature_extrafields.php b/htdocs/recruitment/admin/candidature_extrafields.php index 984d92ce913..1f0ac538d0b 100644 --- a/htdocs/recruitment/admin/candidature_extrafields.php +++ b/htdocs/recruitment/admin/candidature_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/candidature_extrafields.php + * \file htdocs/recruitment/admin/candidature_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ diff --git a/htdocs/recruitment/admin/jobposition_extrafields.php b/htdocs/recruitment/admin/jobposition_extrafields.php index 7df03c0c543..3b17322d5eb 100644 --- a/htdocs/recruitment/admin/jobposition_extrafields.php +++ b/htdocs/recruitment/admin/jobposition_extrafields.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/recruitement/admin/jobposition_extrafields.php + * \file htdocs/recruitment/admin/jobposition_extrafields.php * \ingroup recruitment * \brief Page to setup extra fields of Candidature */ diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 26d1578b24c..2b832b3b467 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -548,9 +548,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea /* if ($permissiontoadd) { if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } else { - print ''.$langs->trans("Enable").''."\n"; + print ''.$langs->trans("Enable").''."\n"; } }*/ if ($permissiontoadd) { diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index b3d7fab8082..5ab07cdd536 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -493,6 +493,7 @@ class Dolresource extends CommonObject $sql .= " t.entity,"; $sql .= " t.ref,"; $sql .= " t.description,"; + $sql .= " t.fk_country,"; $sql .= " t.fk_code_type_resource,"; $sql .= " t.tms,"; // Add fields from extrafields diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 59074e582d2..38303518ac4 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d8e7e4d4009..775221caeb2 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -882,8 +882,9 @@ if ($id) { print dol_get_fiche_end(); - // Action buttons - + /* + * Action bar + */ print '
'."\n"; if ($action != 'edit') { // Reopen diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 3841a7c66ea..6607efa554d 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index d1ffffd6b87..a785b95c892 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -87,13 +87,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel - /* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -101,11 +95,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print '
'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 86f95cb8372..8169a6ca22f 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -279,7 +279,7 @@ for ($i = 1; $i <= 4; $i++) { societe->multidir_output[$this->control->tpl['entity']].'/'.$socid; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid; diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index c7b6e6e70a4..f058d38cd7c 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -205,7 +205,7 @@ if ($this->control->tpl['action_delete']) {
societe->multidir_output[$this->control->tpl['entity']].'/'.$socid; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$socid; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d69a602c900..e7d40037155 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -80,7 +80,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); -if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) { +if ($user->socid) { $socid = $user->socid; } if (empty($socid) && $action == 'view') { @@ -905,7 +905,9 @@ $title = $langs->trans("ThirdParty"); if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->name." - ".$langs->trans('Card'); } -$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Geschäftspartner'; + llxHeader('', $title, $help_url); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; @@ -1355,7 +1357,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Country print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; - print img_picto('', 'globe-americas', 'class="paddingrightonly"'); + print img_picto('', 'country', 'class="paddingrightonly"'); print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 maxwidth500 widthcentpercentminusx'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -2079,7 +2081,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($value['icon'])) { print ''; } - print ''; + print ''; print '
'; $thirdpartycateggraph .= ''; $thirdpartycateggraph .= ''; // Nb print '"; // Name - print ''; + $name_value = (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) : (empty($object->conf->$name) ? '' : $object->conf->$name)); + print ''; // URL - print ''; + $src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src)); + print ''; // Offset TZ - print ''; + $offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz)); + print ''; // Color (Possible colors are limited by Google) print ''; print ""; $i++; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c1abbc2e4ae..d4373812f61 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -916,7 +916,7 @@ if ($action == 'create' || $action == 'adduserldap') { } $checked = (GETPOST('superadmin', 'int') ? ' checked' : ''); $disabled = (GETPOST('superadmin', 'int') ? '' : ' disabled'); - print ' '.$langs->trans("SuperAdministrator"); + print '
'.$langs->trans("Categories").'
'; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 7050f6df48f..8c321b1386d 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1479,7 +1479,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; // ancre /* - * Documents generes + * Generated documents */ $filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id; $urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index d7d373f721a..cc056896414 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -527,12 +527,9 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } else { // View mode - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ - + /* + * Action bar + */ print "\n".'
'."\n"; if ($user->rights->produit->creer || $user->rights->service->creer) { diff --git a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php index 035be6ff86d..66bcf2c61e4 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposal_extrafields.php @@ -82,13 +82,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print "
"; print load_fiche_titre($langs->trans('NewAttribute')); @@ -96,11 +90,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php index f4b63f25cd7..5a061101fab 100644 --- a/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php +++ b/htdocs/supplier_proposal/admin/supplier_proposaldet_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print ""; } - -/* ************************************************************************** */ -/* */ -/* Creation d'un champ optionnel */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition d'un champ optionnel */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index ebd126e377f..1b10c92b0dc 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1036,7 +1036,9 @@ if (empty($reshook)) { * View */ -llxHeader('', $langs->trans('CommRequests'), 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'); +$help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur'; + +llxHeader('', $langs->trans('CommRequests'), $help_url); $form = new Form($db); $formother = new FormOther($db); @@ -1786,30 +1788,31 @@ if ($action == 'create') { if ($action == 'statut') { // Form to set proposal accepted/refused - $form_close = '
'; + $form_close = ''; $form_close .= ''; $form_close .= ''; if (!empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) { $form_close .= '

'.$langs->trans('SupplierProposalRefFournNotice').'

'; // TODO Suggest a permanent checkbox instead of option } - $form_close .= ''; - $form_close .= ''; - $form_close .= '
'.$langs->trans("CloseAs").''; + $form_close .= ''; + $form_close .= ''; - $form_close .= ''; - $form_close .= '
'.$langs->trans("CloseAs").''; $form_close .= ''; $form_close .= '
'.$langs->trans('Note').'
'; + $form_close .= '
'; + $form_close .= '
'; $form_close .= ''; $form_close .= '   '; $form_close .= ' '; - $form_close .= '
'; + $form_close .= ''; + $form_close .= ''; print $form_close; } @@ -1894,7 +1897,7 @@ if ($action == 'create') { print '
'; /* - * Documents generes + * Generated documents */ $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->supplier_proposal->dir_output."/".dol_sanitizeFileName($object->ref); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 0bb4936d460..3ad210b2f77 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -272,7 +272,7 @@ if ($sall || $search_product_category > 0 || $search_user > 0) { $sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; -$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,'; +$sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,'; $sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,'; $sql .= ' sp.datec as date_creation, sp.tms as date_update,'; $sql .= " p.rowid as project_id, p.ref as project_ref,"; @@ -822,6 +822,11 @@ if ($resql) { $total = 0; $subtotal = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val'] = array(); + $totalarray['val']['sp.total_ht'] = 0; + $totalarray['val']['sp.total_tva'] = 0; + $totalarray['val']['sp.total_ttc'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -956,7 +961,7 @@ if ($resql) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ht'; } - $totalarray['val']['sp.total_ht'] += $obj->total_ht; + $totalarray['val']['sp.total_ht'] += $obj->total_ht; } // Amount VAT if (!empty($arrayfields['sp.total_tva']['checked'])) { diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index c764cd1e566..67bc8edcdf3 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -127,7 +127,9 @@ if ($action != '') { $form = new Form($db); $formproduct = new FormProduct($db); -llxHeader('', $langs->trans("CashDeskSetup")); +$help_url = 'EN:Module_Point_of_sale_(TakePOS)'; + +llxHeader('', $langs->trans("CashDeskSetup"), $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 136841a8683..c9cdb681267 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -1,6 +1,6 @@ -/* Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2020 Thibault FOUCART * * 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 @@ -21,10 +21,6 @@ * \brief Ajax search component for TakePos. It search products of a category. */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (!defined('NOCSRFCHECK')) { define('NOCSRFCHECK', '1'); } diff --git a/htdocs/theme/eldy/img/menus/index.html b/htdocs/theme/common/weather/index.html similarity index 100% rename from htdocs/theme/eldy/img/menus/index.html rename to htdocs/theme/common/weather/index.html diff --git a/htdocs/theme/eldy/img/weather/weather-clear-night.png b/htdocs/theme/common/weather/weather-clear-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-clear-night.png rename to htdocs/theme/common/weather/weather-clear-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-clear.png b/htdocs/theme/common/weather/weather-clear.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-clear.png rename to htdocs/theme/common/weather/weather-clear.png diff --git a/htdocs/theme/eldy/img/weather/weather-clouds-night.png b/htdocs/theme/common/weather/weather-clouds-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-clouds-night.png rename to htdocs/theme/common/weather/weather-clouds-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-clouds.png b/htdocs/theme/common/weather/weather-clouds.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-clouds.png rename to htdocs/theme/common/weather/weather-clouds.png diff --git a/htdocs/theme/eldy/img/weather/weather-few-clouds-night.png b/htdocs/theme/common/weather/weather-few-clouds-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-few-clouds-night.png rename to htdocs/theme/common/weather/weather-few-clouds-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-few-clouds.png b/htdocs/theme/common/weather/weather-few-clouds.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-few-clouds.png rename to htdocs/theme/common/weather/weather-few-clouds.png diff --git a/htdocs/theme/eldy/img/weather/weather-freezing-rain.png b/htdocs/theme/common/weather/weather-freezing-rain.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-freezing-rain.png rename to htdocs/theme/common/weather/weather-freezing-rain.png diff --git a/htdocs/theme/eldy/img/weather/weather-hail.png b/htdocs/theme/common/weather/weather-hail.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-hail.png rename to htdocs/theme/common/weather/weather-hail.png diff --git a/htdocs/theme/eldy/img/weather/weather-many-clouds.png b/htdocs/theme/common/weather/weather-many-clouds.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-many-clouds.png rename to htdocs/theme/common/weather/weather-many-clouds.png diff --git a/htdocs/theme/eldy/img/weather/weather-mist.png b/htdocs/theme/common/weather/weather-mist.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-mist.png rename to htdocs/theme/common/weather/weather-mist.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers-day.png b/htdocs/theme/common/weather/weather-showers-day.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers-day.png rename to htdocs/theme/common/weather/weather-showers-day.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers-night.png b/htdocs/theme/common/weather/weather-showers-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers-night.png rename to htdocs/theme/common/weather/weather-showers-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers-scattered-day.png b/htdocs/theme/common/weather/weather-showers-scattered-day.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers-scattered-day.png rename to htdocs/theme/common/weather/weather-showers-scattered-day.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers-scattered-night.png b/htdocs/theme/common/weather/weather-showers-scattered-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers-scattered-night.png rename to htdocs/theme/common/weather/weather-showers-scattered-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers-scattered.png b/htdocs/theme/common/weather/weather-showers-scattered.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers-scattered.png rename to htdocs/theme/common/weather/weather-showers-scattered.png diff --git a/htdocs/theme/eldy/img/weather/weather-showers.png b/htdocs/theme/common/weather/weather-showers.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-showers.png rename to htdocs/theme/common/weather/weather-showers.png diff --git a/htdocs/theme/eldy/img/weather/weather-snow-rain.png b/htdocs/theme/common/weather/weather-snow-rain.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-snow-rain.png rename to htdocs/theme/common/weather/weather-snow-rain.png diff --git a/htdocs/theme/eldy/img/weather/weather-snow-scattered-day.png b/htdocs/theme/common/weather/weather-snow-scattered-day.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-snow-scattered-day.png rename to htdocs/theme/common/weather/weather-snow-scattered-day.png diff --git a/htdocs/theme/eldy/img/weather/weather-snow-scattered-night.png b/htdocs/theme/common/weather/weather-snow-scattered-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-snow-scattered-night.png rename to htdocs/theme/common/weather/weather-snow-scattered-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-snow-scattered.png b/htdocs/theme/common/weather/weather-snow-scattered.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-snow-scattered.png rename to htdocs/theme/common/weather/weather-snow-scattered.png diff --git a/htdocs/theme/eldy/img/weather/weather-snow.png b/htdocs/theme/common/weather/weather-snow.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-snow.png rename to htdocs/theme/common/weather/weather-snow.png diff --git a/htdocs/theme/eldy/img/weather/weather-storm-day.png b/htdocs/theme/common/weather/weather-storm-day.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-storm-day.png rename to htdocs/theme/common/weather/weather-storm-day.png diff --git a/htdocs/theme/eldy/img/weather/weather-storm-night.png b/htdocs/theme/common/weather/weather-storm-night.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-storm-night.png rename to htdocs/theme/common/weather/weather-storm-night.png diff --git a/htdocs/theme/eldy/img/weather/weather-storm.png b/htdocs/theme/common/weather/weather-storm.png similarity index 100% rename from htdocs/theme/eldy/img/weather/weather-storm.png rename to htdocs/theme/common/weather/weather-storm.png diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d3909983c52..9a9b4e7ed6c 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -465,6 +465,7 @@ input#onlinepaymenturl, input#directdownloadlink { .formconsumeproduce { background: #f3f3f3; padding: 20px 0px 0px 0px; + border-radius: 8px; } div#moretabsList, div#moretabsListaction { @@ -4618,6 +4619,11 @@ span[phptag] { border: none; font-weight: normal; } +.websitebar .button.bordertransp { + color: unset; + text-decoration: unset !important; +} + .websitebar { border-bottom: 1px solid #ccc; background: #e6e6e6; diff --git a/htdocs/theme/eldy/img/menus/README.md b/htdocs/theme/eldy/img/menus/README.md deleted file mode 100644 index 72f376c3f2b..00000000000 --- a/htdocs/theme/eldy/img/menus/README.md +++ /dev/null @@ -1,14 +0,0 @@ - -Tutorial to create a new image for menu: - -1) First find an image. -2) With Gimp, open image and check there is a alpha channel. If not add one (Menu Color - Convert to alpha). -3) Convert image into black and white (Menu Image - Mode - Grey levels). -4) Use the degrade tool with option (Menu Tools - Paint - Degrade - CTRL+L): -* Mode: Erase color (you can also try "Clear only") -* Opacity: 50 +/- -* Offset: 0 -* PP toward transparent -* Shape: Linear -* Select on image top of file and drag to bottom. -Il est possible aussi d'augmenter la transparence globale depuis le calque. diff --git a/htdocs/theme/eldy/img/menus/agenda.png b/htdocs/theme/eldy/img/menus/agenda.png deleted file mode 100644 index 0caf60eb271..00000000000 Binary files a/htdocs/theme/eldy/img/menus/agenda.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/agenda_over.png b/htdocs/theme/eldy/img/menus/agenda_over.png deleted file mode 100644 index 3c695cc3c80..00000000000 Binary files a/htdocs/theme/eldy/img/menus/agenda_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/bank.png b/htdocs/theme/eldy/img/menus/bank.png deleted file mode 100644 index 9e15a9a2dc8..00000000000 Binary files a/htdocs/theme/eldy/img/menus/bank.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/bank_over.png b/htdocs/theme/eldy/img/menus/bank_over.png deleted file mode 100644 index bca5ce3c449..00000000000 Binary files a/htdocs/theme/eldy/img/menus/bank_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/commercial.png b/htdocs/theme/eldy/img/menus/commercial.png deleted file mode 100644 index 2c36155fb96..00000000000 Binary files a/htdocs/theme/eldy/img/menus/commercial.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/commercial_over.png b/htdocs/theme/eldy/img/menus/commercial_over.png deleted file mode 100644 index 51146c72359..00000000000 Binary files a/htdocs/theme/eldy/img/menus/commercial_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/company.png b/htdocs/theme/eldy/img/menus/company.png deleted file mode 100644 index 39a3b75db68..00000000000 Binary files a/htdocs/theme/eldy/img/menus/company.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/company_over.png b/htdocs/theme/eldy/img/menus/company_over.png deleted file mode 100644 index c86e6fcf97e..00000000000 Binary files a/htdocs/theme/eldy/img/menus/company_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ecm.png b/htdocs/theme/eldy/img/menus/ecm.png deleted file mode 100644 index 3ba3f280a54..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ecm.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ecm_over.png b/htdocs/theme/eldy/img/menus/ecm_over.png deleted file mode 100644 index d72bc896f38..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ecm_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/externalsite.png b/htdocs/theme/eldy/img/menus/externalsite.png deleted file mode 100644 index cda6eddc774..00000000000 Binary files a/htdocs/theme/eldy/img/menus/externalsite.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/externalsite_over.png b/htdocs/theme/eldy/img/menus/externalsite_over.png deleted file mode 100644 index 4620d6f3461..00000000000 Binary files a/htdocs/theme/eldy/img/menus/externalsite_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ftp.png b/htdocs/theme/eldy/img/menus/ftp.png deleted file mode 100644 index 1f544834fbe..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ftp.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ftp_over.png b/htdocs/theme/eldy/img/menus/ftp_over.png deleted file mode 100644 index ca707d5d645..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ftp_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic1.png b/htdocs/theme/eldy/img/menus/generic1.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic1.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic1_over.png b/htdocs/theme/eldy/img/menus/generic1_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic1_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic2.png b/htdocs/theme/eldy/img/menus/generic2.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic2.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic2_over.png b/htdocs/theme/eldy/img/menus/generic2_over.png deleted file mode 100644 index 62eed5564b6..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic2_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic3.png b/htdocs/theme/eldy/img/menus/generic3.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic3.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic3_over.png b/htdocs/theme/eldy/img/menus/generic3_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic3_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic4.png b/htdocs/theme/eldy/img/menus/generic4.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic4.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/generic4_over.png b/htdocs/theme/eldy/img/menus/generic4_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/eldy/img/menus/generic4_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/globe.png b/htdocs/theme/eldy/img/menus/globe.png deleted file mode 100644 index 87d8e86d4e8..00000000000 Binary files a/htdocs/theme/eldy/img/menus/globe.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/globe_over.png b/htdocs/theme/eldy/img/menus/globe_over.png deleted file mode 100644 index 9bfc263168f..00000000000 Binary files a/htdocs/theme/eldy/img/menus/globe_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/holiday.png b/htdocs/theme/eldy/img/menus/holiday.png deleted file mode 100644 index 146dcdaf120..00000000000 Binary files a/htdocs/theme/eldy/img/menus/holiday.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/holiday_over.png b/htdocs/theme/eldy/img/menus/holiday_over.png deleted file mode 100644 index 146dcdaf120..00000000000 Binary files a/htdocs/theme/eldy/img/menus/holiday_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/home.png b/htdocs/theme/eldy/img/menus/home.png deleted file mode 100644 index 175c9e9df71..00000000000 Binary files a/htdocs/theme/eldy/img/menus/home.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/home_over.png b/htdocs/theme/eldy/img/menus/home_over.png deleted file mode 100644 index e2cd61164ca..00000000000 Binary files a/htdocs/theme/eldy/img/menus/home_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/mail.png b/htdocs/theme/eldy/img/menus/mail.png deleted file mode 100644 index ef09835e61f..00000000000 Binary files a/htdocs/theme/eldy/img/menus/mail.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/mail_over.png b/htdocs/theme/eldy/img/menus/mail_over.png deleted file mode 100644 index cebc59aac9d..00000000000 Binary files a/htdocs/theme/eldy/img/menus/mail_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/members.png b/htdocs/theme/eldy/img/menus/members.png deleted file mode 100644 index bf195586d1a..00000000000 Binary files a/htdocs/theme/eldy/img/menus/members.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/members_over.png b/htdocs/theme/eldy/img/menus/members_over.png deleted file mode 100644 index 9ff7409af9a..00000000000 Binary files a/htdocs/theme/eldy/img/menus/members_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/menu.png b/htdocs/theme/eldy/img/menus/menu.png deleted file mode 100644 index 526e1975ab0..00000000000 Binary files a/htdocs/theme/eldy/img/menus/menu.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/money.png b/htdocs/theme/eldy/img/menus/money.png deleted file mode 100644 index 2190aa22c70..00000000000 Binary files a/htdocs/theme/eldy/img/menus/money.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/money_over.png b/htdocs/theme/eldy/img/menus/money_over.png deleted file mode 100644 index 47b61f2013d..00000000000 Binary files a/htdocs/theme/eldy/img/menus/money_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/pointofsale.png b/htdocs/theme/eldy/img/menus/pointofsale.png deleted file mode 100644 index 3f1d00e3add..00000000000 Binary files a/htdocs/theme/eldy/img/menus/pointofsale.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/pointofsale_over.png b/htdocs/theme/eldy/img/menus/pointofsale_over.png deleted file mode 100644 index 9ef02b49295..00000000000 Binary files a/htdocs/theme/eldy/img/menus/pointofsale_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/products.png b/htdocs/theme/eldy/img/menus/products.png deleted file mode 100644 index 2e3f6f70c4d..00000000000 Binary files a/htdocs/theme/eldy/img/menus/products.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/products_over.png b/htdocs/theme/eldy/img/menus/products_over.png deleted file mode 100644 index a36e3d0afd7..00000000000 Binary files a/htdocs/theme/eldy/img/menus/products_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/project.png b/htdocs/theme/eldy/img/menus/project.png deleted file mode 100644 index dfb2fa7c0a0..00000000000 Binary files a/htdocs/theme/eldy/img/menus/project.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/project_over.png b/htdocs/theme/eldy/img/menus/project_over.png deleted file mode 100644 index 0f86a34b5fa..00000000000 Binary files a/htdocs/theme/eldy/img/menus/project_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/shop.png b/htdocs/theme/eldy/img/menus/shop.png deleted file mode 100644 index 83cabd58266..00000000000 Binary files a/htdocs/theme/eldy/img/menus/shop.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/shop_over.png b/htdocs/theme/eldy/img/menus/shop_over.png deleted file mode 100644 index 4458d1804a0..00000000000 Binary files a/htdocs/theme/eldy/img/menus/shop_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ticket.png b/htdocs/theme/eldy/img/menus/ticket.png deleted file mode 100644 index 57fc2aedb5b..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ticket.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/ticket_over.png b/htdocs/theme/eldy/img/menus/ticket_over.png deleted file mode 100644 index 57fc2aedb5b..00000000000 Binary files a/htdocs/theme/eldy/img/menus/ticket_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/tools.png b/htdocs/theme/eldy/img/menus/tools.png deleted file mode 100644 index de26cd9b4cf..00000000000 Binary files a/htdocs/theme/eldy/img/menus/tools.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus/tools_over.png b/htdocs/theme/eldy/img/menus/tools_over.png deleted file mode 100644 index b04305187df..00000000000 Binary files a/htdocs/theme/eldy/img/menus/tools_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/agenda.png b/htdocs/theme/eldy/img/menus_black/agenda.png deleted file mode 100644 index ca69e7a53ab..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/agenda.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/agenda_over.png b/htdocs/theme/eldy/img/menus_black/agenda_over.png deleted file mode 100644 index 4e4f1d58543..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/agenda_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/bank.png b/htdocs/theme/eldy/img/menus_black/bank.png deleted file mode 100644 index f2ab8dcf64c..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/bank.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/bank_over.png b/htdocs/theme/eldy/img/menus_black/bank_over.png deleted file mode 100644 index b71c896a486..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/bank_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/commercial.png b/htdocs/theme/eldy/img/menus_black/commercial.png deleted file mode 100644 index 9f74d3ff193..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/commercial.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/commercial_over.png b/htdocs/theme/eldy/img/menus_black/commercial_over.png deleted file mode 100644 index 73345ebd2d2..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/commercial_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/company.png b/htdocs/theme/eldy/img/menus_black/company.png deleted file mode 100644 index 3db34e9a4d7..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/company.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/company_over.png b/htdocs/theme/eldy/img/menus_black/company_over.png deleted file mode 100644 index 54f61141f69..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/company_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ecm.png b/htdocs/theme/eldy/img/menus_black/ecm.png deleted file mode 100644 index 4d8295ca0dd..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ecm.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ecm_over.png b/htdocs/theme/eldy/img/menus_black/ecm_over.png deleted file mode 100644 index a71608da773..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ecm_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/externalsite.png b/htdocs/theme/eldy/img/menus_black/externalsite.png deleted file mode 100644 index b04fe8d6f62..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/externalsite.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/externalsite_over.png b/htdocs/theme/eldy/img/menus_black/externalsite_over.png deleted file mode 100644 index 968cff8042a..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/externalsite_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ftp.png b/htdocs/theme/eldy/img/menus_black/ftp.png deleted file mode 100644 index 3132f4977d1..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ftp.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ftp_over.png b/htdocs/theme/eldy/img/menus_black/ftp_over.png deleted file mode 100644 index f8cca29d214..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ftp_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic1.png b/htdocs/theme/eldy/img/menus_black/generic1.png deleted file mode 100644 index 3aa0f69fd23..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic1.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic1_over.png b/htdocs/theme/eldy/img/menus_black/generic1_over.png deleted file mode 100644 index e78c61ecb6e..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic1_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic2.png b/htdocs/theme/eldy/img/menus_black/generic2.png deleted file mode 100644 index 3aa0f69fd23..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic2.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic2_over.png b/htdocs/theme/eldy/img/menus_black/generic2_over.png deleted file mode 100644 index e78c61ecb6e..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic2_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic3.png b/htdocs/theme/eldy/img/menus_black/generic3.png deleted file mode 100644 index 3aa0f69fd23..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic3.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic3_over.png b/htdocs/theme/eldy/img/menus_black/generic3_over.png deleted file mode 100644 index e78c61ecb6e..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic3_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic4.png b/htdocs/theme/eldy/img/menus_black/generic4.png deleted file mode 100644 index 3aa0f69fd23..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic4.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/generic4_over.png b/htdocs/theme/eldy/img/menus_black/generic4_over.png deleted file mode 100644 index e78c61ecb6e..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/generic4_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/globe.png b/htdocs/theme/eldy/img/menus_black/globe.png deleted file mode 100644 index 8ea33cbadc6..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/globe.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/globe_over.png b/htdocs/theme/eldy/img/menus_black/globe_over.png deleted file mode 100644 index 409cf638196..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/globe_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/holiday.png b/htdocs/theme/eldy/img/menus_black/holiday.png deleted file mode 100644 index 24d9e498948..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/holiday.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/holiday_over.png b/htdocs/theme/eldy/img/menus_black/holiday_over.png deleted file mode 100644 index 24d9e498948..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/holiday_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/home.png b/htdocs/theme/eldy/img/menus_black/home.png deleted file mode 100644 index 15dafc01b06..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/home.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/home_over.png b/htdocs/theme/eldy/img/menus_black/home_over.png deleted file mode 100644 index f19ae6ec4b6..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/home_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/mail.png b/htdocs/theme/eldy/img/menus_black/mail.png deleted file mode 100644 index bab0121d1f2..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/mail.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/mail_over.png b/htdocs/theme/eldy/img/menus_black/mail_over.png deleted file mode 100644 index e0c2e0a98b8..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/mail_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/members.png b/htdocs/theme/eldy/img/menus_black/members.png deleted file mode 100644 index 4010af188cd..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/members.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/members_over.png b/htdocs/theme/eldy/img/menus_black/members_over.png deleted file mode 100644 index 3548942d14c..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/members_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/menu.png b/htdocs/theme/eldy/img/menus_black/menu.png deleted file mode 100644 index 0b080a18715..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/menu.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/money.png b/htdocs/theme/eldy/img/menus_black/money.png deleted file mode 100644 index c9668b65fb9..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/money.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/money_over.png b/htdocs/theme/eldy/img/menus_black/money_over.png deleted file mode 100644 index 6ed4fe78532..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/money_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/pointofsale.png b/htdocs/theme/eldy/img/menus_black/pointofsale.png deleted file mode 100644 index 21740c2d335..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/pointofsale.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/pointofsale_over.png b/htdocs/theme/eldy/img/menus_black/pointofsale_over.png deleted file mode 100644 index ce906378a8b..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/pointofsale_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/products.png b/htdocs/theme/eldy/img/menus_black/products.png deleted file mode 100644 index 08ec9b25477..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/products.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/products_over.png b/htdocs/theme/eldy/img/menus_black/products_over.png deleted file mode 100644 index e9e586bfda7..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/products_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/project.png b/htdocs/theme/eldy/img/menus_black/project.png deleted file mode 100644 index 3313e646419..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/project.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/project_over.png b/htdocs/theme/eldy/img/menus_black/project_over.png deleted file mode 100644 index ecd01444b4b..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/project_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/shop.png b/htdocs/theme/eldy/img/menus_black/shop.png deleted file mode 100644 index 5db29cb0e3a..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/shop.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/shop_over.png b/htdocs/theme/eldy/img/menus_black/shop_over.png deleted file mode 100644 index e1429d1b97e..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/shop_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ticket.png b/htdocs/theme/eldy/img/menus_black/ticket.png deleted file mode 100644 index 998efdbaf82..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ticket.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/ticket_over.png b/htdocs/theme/eldy/img/menus_black/ticket_over.png deleted file mode 100644 index 998efdbaf82..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/ticket_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/tools.png b/htdocs/theme/eldy/img/menus_black/tools.png deleted file mode 100644 index 5008c2fb98c..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/tools.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/menus_black/tools_over.png b/htdocs/theme/eldy/img/menus_black/tools_over.png deleted file mode 100644 index 7d200d2e7ae..00000000000 Binary files a/htdocs/theme/eldy/img/menus_black/tools_over.png and /dev/null differ diff --git a/htdocs/theme/eldy/img/weather/index.html b/htdocs/theme/eldy/img/weather/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index e9f6893ca98..339235ce2c7 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -119,7 +119,7 @@ div.mainmenu.mrp::before { } div.mainmenu.project::before { - content: "\f0e8"; + content: "\f542"; } div.mainmenu.ticket::before { diff --git a/htdocs/theme/md/img/menus/agenda.png b/htdocs/theme/md/img/menus/agenda.png deleted file mode 100644 index 35d8b1b3169..00000000000 Binary files a/htdocs/theme/md/img/menus/agenda.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/bank.png b/htdocs/theme/md/img/menus/bank.png deleted file mode 100644 index b83e7cd310a..00000000000 Binary files a/htdocs/theme/md/img/menus/bank.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/cart.png b/htdocs/theme/md/img/menus/cart.png deleted file mode 100644 index 8d8da880f0e..00000000000 Binary files a/htdocs/theme/md/img/menus/cart.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/chart.png b/htdocs/theme/md/img/menus/chart.png deleted file mode 100644 index 18559b692d1..00000000000 Binary files a/htdocs/theme/md/img/menus/chart.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/commercial.png b/htdocs/theme/md/img/menus/commercial.png deleted file mode 100644 index ba06d79a766..00000000000 Binary files a/htdocs/theme/md/img/menus/commercial.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/company.png b/htdocs/theme/md/img/menus/company.png deleted file mode 100644 index 7b9227c0674..00000000000 Binary files a/htdocs/theme/md/img/menus/company.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/ecm.png b/htdocs/theme/md/img/menus/ecm.png deleted file mode 100644 index 1bb8e0dafd6..00000000000 Binary files a/htdocs/theme/md/img/menus/ecm.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/externalsite.png b/htdocs/theme/md/img/menus/externalsite.png deleted file mode 100644 index 8abd6437ea6..00000000000 Binary files a/htdocs/theme/md/img/menus/externalsite.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/ftp.png b/htdocs/theme/md/img/menus/ftp.png deleted file mode 100644 index a70a9d29b77..00000000000 Binary files a/htdocs/theme/md/img/menus/ftp.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic1.png b/htdocs/theme/md/img/menus/generic1.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/md/img/menus/generic1.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic1_over.png b/htdocs/theme/md/img/menus/generic1_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/md/img/menus/generic1_over.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic2.png b/htdocs/theme/md/img/menus/generic2.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/md/img/menus/generic2.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic2_over.png b/htdocs/theme/md/img/menus/generic2_over.png deleted file mode 100644 index 62eed5564b6..00000000000 Binary files a/htdocs/theme/md/img/menus/generic2_over.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic3.png b/htdocs/theme/md/img/menus/generic3.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/md/img/menus/generic3.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic3_over.png b/htdocs/theme/md/img/menus/generic3_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/md/img/menus/generic3_over.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic4.png b/htdocs/theme/md/img/menus/generic4.png deleted file mode 100644 index ef13122ace5..00000000000 Binary files a/htdocs/theme/md/img/menus/generic4.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/generic4_over.png b/htdocs/theme/md/img/menus/generic4_over.png deleted file mode 100644 index 29023816e67..00000000000 Binary files a/htdocs/theme/md/img/menus/generic4_over.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/globe.png b/htdocs/theme/md/img/menus/globe.png deleted file mode 100644 index 0bc7dfd4802..00000000000 Binary files a/htdocs/theme/md/img/menus/globe.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/graph.png b/htdocs/theme/md/img/menus/graph.png deleted file mode 100644 index fb04031d47a..00000000000 Binary files a/htdocs/theme/md/img/menus/graph.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/holiday.png b/htdocs/theme/md/img/menus/holiday.png deleted file mode 100644 index 014c9918c2e..00000000000 Binary files a/htdocs/theme/md/img/menus/holiday.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/home.png b/htdocs/theme/md/img/menus/home.png deleted file mode 100644 index c5441fa2962..00000000000 Binary files a/htdocs/theme/md/img/menus/home.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/index.html b/htdocs/theme/md/img/menus/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/img/menus/mail.png b/htdocs/theme/md/img/menus/mail.png deleted file mode 100644 index 7b65a3d522e..00000000000 Binary files a/htdocs/theme/md/img/menus/mail.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/members.png b/htdocs/theme/md/img/menus/members.png deleted file mode 100644 index 270e4de2e05..00000000000 Binary files a/htdocs/theme/md/img/menus/members.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/menu.png b/htdocs/theme/md/img/menus/menu.png deleted file mode 100644 index 526e1975ab0..00000000000 Binary files a/htdocs/theme/md/img/menus/menu.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/money.png b/htdocs/theme/md/img/menus/money.png deleted file mode 100644 index 707d1676167..00000000000 Binary files a/htdocs/theme/md/img/menus/money.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/pointofsale.png b/htdocs/theme/md/img/menus/pointofsale.png deleted file mode 100644 index 8826337cd31..00000000000 Binary files a/htdocs/theme/md/img/menus/pointofsale.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/products.png b/htdocs/theme/md/img/menus/products.png deleted file mode 100644 index f614d17171a..00000000000 Binary files a/htdocs/theme/md/img/menus/products.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/project.png b/htdocs/theme/md/img/menus/project.png deleted file mode 100644 index 54f4aa382fe..00000000000 Binary files a/htdocs/theme/md/img/menus/project.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/shop.png b/htdocs/theme/md/img/menus/shop.png deleted file mode 100644 index 16b6cd01fbc..00000000000 Binary files a/htdocs/theme/md/img/menus/shop.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/ticket.png b/htdocs/theme/md/img/menus/ticket.png deleted file mode 100644 index 57fc2aedb5b..00000000000 Binary files a/htdocs/theme/md/img/menus/ticket.png and /dev/null differ diff --git a/htdocs/theme/md/img/menus/tools.png b/htdocs/theme/md/img/menus/tools.png deleted file mode 100644 index 244478041a4..00000000000 Binary files a/htdocs/theme/md/img/menus/tools.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/index.html b/htdocs/theme/md/img/weather/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/theme/md/img/weather/weather-clear-night.png b/htdocs/theme/md/img/weather/weather-clear-night.png deleted file mode 100644 index f89b2ad8cad..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-clear-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-clear.png b/htdocs/theme/md/img/weather/weather-clear.png deleted file mode 100644 index ed1d48065f3..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-clear.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-clouds-night.png b/htdocs/theme/md/img/weather/weather-clouds-night.png deleted file mode 100644 index 0c74a6a37b4..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-clouds-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-clouds.png b/htdocs/theme/md/img/weather/weather-clouds.png deleted file mode 100644 index 75a8d230e50..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-clouds.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-few-clouds-night.png b/htdocs/theme/md/img/weather/weather-few-clouds-night.png deleted file mode 100644 index e2bbfee2b0e..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-few-clouds-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-few-clouds.png b/htdocs/theme/md/img/weather/weather-few-clouds.png deleted file mode 100644 index 3f188e6220d..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-few-clouds.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-freezing-rain.png b/htdocs/theme/md/img/weather/weather-freezing-rain.png deleted file mode 100644 index d270b5ae1bb..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-freezing-rain.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-hail.png b/htdocs/theme/md/img/weather/weather-hail.png deleted file mode 100644 index 9df0bdc24d7..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-hail.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-many-clouds.png b/htdocs/theme/md/img/weather/weather-many-clouds.png deleted file mode 100644 index de4cae7e8e1..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-many-clouds.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-mist.png b/htdocs/theme/md/img/weather/weather-mist.png deleted file mode 100644 index a2b57a5e408..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-mist.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers-day.png b/htdocs/theme/md/img/weather/weather-showers-day.png deleted file mode 100644 index 0b8e3149311..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers-day.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers-night.png b/htdocs/theme/md/img/weather/weather-showers-night.png deleted file mode 100644 index 1fff3febf5c..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered-day.png b/htdocs/theme/md/img/weather/weather-showers-scattered-day.png deleted file mode 100644 index ae098117351..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers-scattered-day.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered-night.png b/htdocs/theme/md/img/weather/weather-showers-scattered-night.png deleted file mode 100644 index ad0283a08db..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers-scattered-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers-scattered.png b/htdocs/theme/md/img/weather/weather-showers-scattered.png deleted file mode 100644 index 9d4abf53203..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers-scattered.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-showers.png b/htdocs/theme/md/img/weather/weather-showers.png deleted file mode 100644 index 38cd41f03b5..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-showers.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-snow-rain.png b/htdocs/theme/md/img/weather/weather-snow-rain.png deleted file mode 100644 index dc742aa1c4c..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-snow-rain.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered-day.png b/htdocs/theme/md/img/weather/weather-snow-scattered-day.png deleted file mode 100644 index 0048fec3df0..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-snow-scattered-day.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered-night.png b/htdocs/theme/md/img/weather/weather-snow-scattered-night.png deleted file mode 100644 index d8b0ccaa7ff..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-snow-scattered-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-snow-scattered.png b/htdocs/theme/md/img/weather/weather-snow-scattered.png deleted file mode 100644 index dff11fb3342..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-snow-scattered.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-snow.png b/htdocs/theme/md/img/weather/weather-snow.png deleted file mode 100644 index 16e4b472e7e..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-snow.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-storm-day.png b/htdocs/theme/md/img/weather/weather-storm-day.png deleted file mode 100644 index 3d434f5a768..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-storm-day.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-storm-night.png b/htdocs/theme/md/img/weather/weather-storm-night.png deleted file mode 100644 index 4075950838a..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-storm-night.png and /dev/null differ diff --git a/htdocs/theme/md/img/weather/weather-storm.png b/htdocs/theme/md/img/weather/weather-storm.png deleted file mode 100644 index 6e5360313b7..00000000000 Binary files a/htdocs/theme/md/img/weather/weather-storm.png and /dev/null differ diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 1ab7dc02bf0..0946315391a 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -375,7 +375,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { content: "\f571"; } .fa-dol-project:before { - content: "\f0e8"; + content: "\f542"; } .fa-dol-commande:before, .fa-dol-order_supplier:before { diff --git a/htdocs/theme/md/main_menu_fa_icons.inc.php b/htdocs/theme/md/main_menu_fa_icons.inc.php index 23121d94991..d5392c5b086 100644 --- a/htdocs/theme/md/main_menu_fa_icons.inc.php +++ b/htdocs/theme/md/main_menu_fa_icons.inc.php @@ -22,13 +22,97 @@ font-size: 1.5em; } -div.mainmenu.ticket::before { - content: "\f3ff"; -} -div.mainmenu.ticket { +div.mainmenu { background-image: none !important; } +div.mainmenu.menu::before { + content: "\f0c9"; +} + + +div.mainmenu.home::before{ + content: "\f015"; +} + +div.mainmenu.billing::before { + content: "\f51e"; +} + +div.mainmenu.accountancy::before { + /* content: "\f53d"; */ + content: "\f688"; + font-size: 1.2em; +} + +div.mainmenu.agenda::before { + content: "\f073"; +} + +div.mainmenu.bank::before { + content: "\f19c"; +} + +div.mainmenu.cashdesk::before { + content: "\f788"; +} + + +div.mainmenu.takepos::before { + content: "\f788"; +} + +div.mainmenu.companies::before { + content: "\f1ad"; +} + +div.mainmenu.commercial::before { + content: "\f0f2"; +} + +div.mainmenu.ecm::before { + content: "\f07c"; +} + +div.mainmenu.externalsite::before { + content: "\f360"; +} + +div.mainmenu.ftp::before { + content: "\f362"; +} + +div.mainmenu.hrm::before { + content: "\f508"; +} + +div.mainmenu.members::before { + content: "\f007"; +} + +div.mainmenu.products::before { + content: "\f1b2"; +} + +div.mainmenu.mrp::before { + content: "\f1b3"; +} + +div.mainmenu.project::before { + content: "\f542"; +} + +div.mainmenu.ticket::before { + content: "\f3ff"; +} + +div.mainmenu.tools::before { + content: "\f0ad"; +} + +div.mainmenu.website::before { + content: "\f57d"; +} div.mainmenu.generic1::before { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e7363b09e47..c5e27979121 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -669,7 +669,8 @@ if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } -$help_url = 'FR:DocumentationModuleTicket'; +$help_url = 'EN:Module_Ticket|FR:DocumentationModuleTicket'; + $page_title = $actionobject->getTitle($action); llxHeader('', $page_title, $help_url); diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index de341f2f62d..2a3850d1e59 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -46,6 +46,7 @@ $msg_id = GETPOST('msg_id', 'int'); $action = GETPOST('action', 'aZ09'); +$socid = 0; if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 627af1c3b9d..b258f991a47 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -89,13 +89,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -103,11 +97,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Edition of an optional field */ -/* */ -/* ************************************************************************** */ +// Edition of an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 25141ed4fcd..7e22a1c7122 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -88,13 +88,7 @@ if ($action != 'create' && $action != 'edit') { print "
"; } - -/* ************************************************************************** */ -/* */ -/* Creation of an optional field */ -/* */ -/* ************************************************************************** */ - +// Creation of an optional field if ($action == 'create') { print '
'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -102,11 +96,7 @@ if ($action == 'create') { require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } -/* ************************************************************************** */ -/* */ -/* Editing an optional field */ -/* */ -/* ************************************************************************** */ +// Editing an optional field if ($action == 'edit' && !empty($attrname)) { print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 3bd0468cc27..3faf6dc770c 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -174,7 +174,7 @@ print '
'; print ''.$langs->trans("AgendaExtSitesDesc")."
\n"; print "
\n"; -$selectedvalue = $conf->global->AGENDA_DISABLE_EXT; +$selectedvalue = empty($conf->global->AGENDA_DISABLE_EXT) ? 0 : $conf->global->AGENDA_DISABLE_EXT; if ($selectedvalue == 1) { $selectedvalue = 0; } else { @@ -201,20 +201,23 @@ while ($i <= $MAXAGENDA) { $offsettz = 'AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key; $color = 'AGENDA_EXT_COLOR_'.$id.'_'.$key; - print '
'.$langs->trans("AgendaExtNb", $key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : $object->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); + $color_value = (GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : (empty($object->conf->$color) ? 'ffffff' : $object->conf->$color)); + print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; + print img_picto('', 'country', 'class="paddingrightonly"'); print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -1820,12 +1821,12 @@ if ($action == 'create' || $action == 'adduserldap') { // Enable user if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } // Disable user if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print ''; + print ''; } else { if ($user->id == $id) { print ''; @@ -1835,7 +1836,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($user->id <> $id && $candisableuser && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin - print ''; + print ''; } else { print ''; } @@ -2107,7 +2108,7 @@ if ($action == 'create' || $action == 'adduserldap') { } $checked = (($object->admin && !$object->entity) ? ' checked' : ''); - print ' '.$langs->trans("SuperAdministrator"); + print '