diff --git a/README.md b/README.md index 834cc09236e..2cfe4138d62 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! -- At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) +- At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process. diff --git a/SECURITY.md b/SECURITY.md index 4c7fbaa8fd5..61f4a392db8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,11 +4,11 @@ This file contains some policies about the security reports on Dolibarr ERP CRM ## Supported Versions for security reports -| Version | Supported | -| ---------- | ------------------ | -| <= 14.0.1 | :x: | -| >= 14.0.2+ | :white_check_mark: | - +| Version | Supported | +| ---------- | ---------------------- | +| <= 14.0.1 | :x: | +| >= 14.0.2+ | :white_check_mark: except CSRF attacks| +| >= develop | :white_check_mark: | ## Reporting a Vulnerability @@ -54,7 +54,7 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us * $dolibarr_main_prod must be set to 1 into conf.php * $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value) * $dolibarr_main_force_https must be set to something else than 0. -* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default) +* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 2 into backoffice menu Home - Setup - Other (this protection should be set to 2 soon by default) * The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools) * ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities). * The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer). @@ -90,9 +90,8 @@ Scope is the web application (back office) and the APIs. * Clickjacking/UI redressing * Physical or social engineering attempts or issues that require physical access to a victim’s computer/device * Presence of autocomplete attribute on web forms -* Vulnerabilities affecting outdated browsers or platforms +* Vulnerabilities affecting outdated browsers or platforms, or vulnerabilities inside browsers themself. * Logout and other instances of low-severity Cross-Site Request Forgery -* Missing cookie flags * Missing security-related HTTP headers which do not lead directly to a vulnerability * Reports from automated web vulnerability scanners (Acunetix, Vega, etc.) that have not been validated * Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC) diff --git a/dev/tools/github_authors_peryear.sh b/dev/tools/github_authors_and_commits_peryear.sh similarity index 100% rename from dev/tools/github_authors_peryear.sh rename to dev/tools/github_authors_and_commits_peryear.sh diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 86efee3a04a..cd48526e62b 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -61,7 +61,7 @@ $object = new AccountingAccount($db); */ if (GETPOST('cancel', 'alpha')) { - $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php'; header("Location: ".$urltogo); exit; } @@ -121,7 +121,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) { } if (!$error) { setEventMessages("RecordCreatedSuccessfully", null, 'mesgs'); - $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php'; header("Location: " . $urltogo); exit; } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 4be890de7d5..cb931f550d8 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -820,7 +820,7 @@ if ($resql) { if ($iserasable) { print ''; if ($user->admin) { - print ''.img_delete().''; + print ''.img_delete().''; } //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 73c23e4d63b..081d074eab7 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1250,7 +1250,7 @@ while ($i < min($num, $limit)) { } if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print ''.img_delete().''; + print ''.img_delete().''; } } print ''; @@ -1274,7 +1274,7 @@ print ''; // TODO Replace this with mass delete action if ($user->rights->accounting->mouvements->supprimer_tous) { print '
'."\n"; - print ''.$langs->trans("DeleteMvt").''; + print ''.$langs->trans("DeleteMvt").''; print '
'; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 27f23d36a74..22ba2d3f0b1 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -904,7 +904,7 @@ while ($i < min($num, $limit)) { } if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print ''.img_delete().''; + print ''.img_delete().''; } } print ''; @@ -957,7 +957,7 @@ print ''; // TODO Replace this with mass delete action if ($user->rights->accounting->mouvements->supprimer_tous) { print '
'."\n"; - print ''.$langs->trans("DeleteMvt").''; + print ''.$langs->trans("DeleteMvt").''; print '
'; } diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 5e83c729fb1..101a8897bb5 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -915,7 +915,7 @@ while ($i < min($num, $limit)) { } if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print ''.img_delete().''; + print ''.img_delete().''; } } print ''; @@ -968,7 +968,7 @@ print ''; // TODO Replace this with mass delete action if ($user->rights->accounting->mouvements->supprimer_tous) { print '
'."\n"; - print ''.$langs->trans("DeleteMvt").''; + print ''.$langs->trans("DeleteMvt").''; print '
'; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index b227fcb8e88..78160c15954 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -121,8 +121,8 @@ class AccountancyExport self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'), self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'), self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'), - self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'), - self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'), + self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'), + self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'), self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'), self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'), self::$EXPORT_TYPE_ISUITEEXPERT => 'Export iSuite Expert', @@ -527,14 +527,19 @@ class AccountancyExport } /** - * Export format : Quadratus + * Export format : Quadratus (Format ASCII) + * Format since 2015 compatible QuadraCOMPTA + * Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html + * In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)" * * @param array $TData data * @return void */ public function exportQuadratus(&$TData) { - global $conf; + global $conf, $db; $end_line = "\r\n"; @@ -547,6 +552,44 @@ class AccountancyExport $code_compta = $data->subledger_account; } + $Tab = array(); + + if (!empty($data->subledger_account)) { + $Tab['type_ligne'] = 'C'; + $Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8); + $Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30); + + if ($data->doc_type == 'customer_invoice') { + $Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6)); + $Tab['filler'] = str_repeat(' ', 52); + $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); + } elseif ($data->doc_type == 'supplier_invoice') { + $Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6)); + $Tab['filler'] = str_repeat(' ', 52); + $Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); + } else { + $Tab['filler'] = str_repeat(' ', 59); + $Tab['coll_compte'] = str_pad(' ', 8); + } + + $Tab['filler2'] = str_repeat(' ', 110); + $Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB) + + if ($data->doc_type == 'customer_invoice') { + $Tab['type_compte'] = 'C'; + } elseif ($data->doc_type == 'supplier_invoice') { + $Tab['coll_compte'] = 'F'; + } else { + $Tab['coll_compte'] = 'G'; + } + + $Tab['filler3'] = str_repeat(' ', 235); + + $Tab['end_line'] = $end_line; + + print implode($Tab); + } + $Tab = array(); $Tab['type_ligne'] = 'M'; $Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d47078af06c..c80e1088e14 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -888,9 +888,11 @@ class BookKeeping extends CommonObject // Affichage par compte comptable if (!empty($option)) { $sql .= ' AND t.subledger_account IS NOT NULL'; - $sql .= ' ORDER BY t.subledger_account ASC'; + $sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : ''); + $sortorder = 'ASC'.($sortfield ? ','.$sortfield : ''); } else { - $sql .= ' ORDER BY t.numero_compte ASC'; + $sortfield = 't.numero_compte'.($sortfield ? ','.$sortfield : ''); + $sortorder = 'ASC'.($sortorder ? ','.$sortorder : ''); } $sql .= $this->db->order($sortfield, $sortorder); diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 018498c2457..0ff0919652d 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -404,13 +404,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -419,7 +419,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->MEMBER_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 16e9dc1886a..696520f79d4 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -125,15 +125,15 @@ if (empty($user->socid)) { echo '
'; if ($user->rights->adherent->creer) { - echo ''.$langs->trans('Modify').''; + echo ''.$langs->trans('Modify').''; } if (!$this->control->tpl['user_id'] && $user->rights->user->user->creer) { - echo ''.$langs->trans("CreateDolibarrLogin").''; + echo ''.$langs->trans("CreateDolibarrLogin").''; } if ($user->rights->adherent->supprimer) { - echo ''.$langs->trans('Delete').''; + echo ''.$langs->trans('Delete').''; } echo '

'; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index d46442edc94..ca1ad342d8a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1979,10 +1979,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $isinspip = $mailmanspip->is_in_spip($object); if ($isinspip == 1) { - print ''.$langs->trans("DeleteIntoSpip").''."\n"; + print ''.$langs->trans("DeleteIntoSpip").''."\n"; } if ($isinspip == 0) { - print ''.$langs->trans("AddIntoSpip").''."\n"; + print ''.$langs->trans("AddIntoSpip").''."\n"; } } @@ -2053,7 +2053,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', $MAX, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlright); print ''; } diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 3f4a3872980..b0a6e40d3ca 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -394,7 +394,7 @@ if ($rowid && $action != 'edit') { /* include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'invoice', $socid, 1); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1); */ print ''; diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index 0414bf20a14..7aa2f39a3ff 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -45,7 +45,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } echo ''; echo ''; - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; echo ''; } diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index d689b2df8af..5567e741272 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -282,9 +282,9 @@ while ($i <= $MAXAGENDA) { print ajax_constantonoff('AGENDA_EXT_ACTIVEBYDEFAULT' . $key); } else { if (empty($conf->global->{$default})) { - print '' . img_picto($langs->trans("Enabled"), 'on') . ''; + print '' . img_picto($langs->trans("Enabled"), 'on') . ''; } else { - print '' . img_picto($langs->trans("Disabled"), 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } } print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 463df5475f9..8060398574c 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -260,7 +260,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (in_array($name, $def)) { print ''."\n"; if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=action">'; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } else { @@ -269,7 +269,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -278,7 +278,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -324,9 +324,9 @@ print ' '."\n"; print ''."\n"; //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - 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 ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 2b2da673202..1d8cd8f723c 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -174,14 +174,14 @@ if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { $langs->load("errors"); print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' '; } - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print ''."\n"; } else { if (!isHTTPS()) { $langs->load("errors"); print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' '; } - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; print ''."\n"; @@ -190,9 +190,9 @@ if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { print ''."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { - 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 ''."\n"; @@ -221,7 +221,7 @@ if (empty($conf->cron->enabled)) { print ''.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module2300Name")).''; } else { if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; } else { // Get the max frequency of reminder if ($job->id > 0) { @@ -229,7 +229,7 @@ if (empty($conf->cron->enabled)) { $langs->load("cron"); print ''.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).''; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; } } } diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index a9463be9937..6580db4e8f3 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -258,7 +258,7 @@ while ($i < $nbofbank) { print img_picto($langs->trans("Activated"), 'on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'off'); print ''; } @@ -354,13 +354,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -369,7 +369,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BANKADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -428,13 +428,13 @@ print ""; // Active if ($conf->global->BANK_COLORIZE_MOVEMENT) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b0eb36d81ac..de05203f5f6 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -374,11 +374,11 @@ if ($conf->product->enabled) { print ''.$modBarCode->getExample($langs)."\n"; if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - 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/admin/bom.php b/htdocs/admin/bom.php index 0aae15eef3e..a36c3698306 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BOM_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -362,13 +362,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BOM_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c4e697bfe00..2e4226e89d5 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -423,8 +423,8 @@ foreach ($boxactivated as $key => $box) { $hasprevious = ($key != 0); print ''.($key + 1).''; print ''; - print ($hasnext ? ''.img_down().' ' : ''); - print ($hasprevious ? ''.img_up().'' : ''); + print ($hasnext ? ''.img_down().' ' : ''); + print ($hasprevious ? ''.img_up().'' : ''); print ''; print ''; print ''.img_delete().''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index d57292e3562..1e977fb48df 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -299,7 +299,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -424,13 +424,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -439,7 +439,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -655,10 +655,10 @@ print ''.$langs->trans("ShippableOrderIconInList").''; print ' '; print ''; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); } print ''; @@ -676,9 +676,9 @@ if ($conf->banque->enabled) { print ajax_constantonoff('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').''; + 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 ''; @@ -696,9 +696,9 @@ if ($conf->stock->enabled) { print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER'); } else { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { - 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 ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index b5e0c3ae28b..1c6a0ec0458 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->CONTRACT_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -353,13 +353,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->CONTRACT_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index e74a8df069c..026a4315c83 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -206,12 +206,12 @@ $param = '&mode='.$mode; $enabledisablehtml = $langs->trans("EnableDefaultValues").' '; if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 4fa7b2b79c7..8e60b02a5bf 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -357,13 +357,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->DELIVERY_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 52badf366ca..44df7f74189 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -93,9 +93,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('ECM_AUTO_TREE_ENABLED'); } else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } elseif (!empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index fe1a61c686c..9b45716d152 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -356,7 +356,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -374,7 +374,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($action != 'classify') { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref.='
'; diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 9c088aec61c..36ba50818c6 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -580,13 +580,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 32f82f5dad5..2d4736cc49d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -229,7 +229,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -353,13 +353,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPEDITION_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 1553f6887f8..f7c9a84c5d1 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPENSEREPORT_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -358,13 +358,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -373,7 +373,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 26ba4d40f58..85cd419d9ee 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -252,9 +252,8 @@ if ($resql) { print ''; print "".$langs->trans("RSS")." ".($i + 1).""; print ''; - print ''; - print "   "; - print ''; + print ''; + print ''; print ''; print ''; print ''."\n"; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index bf4e2ea9eb6..ae269492ddf 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -501,13 +501,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; } @@ -516,7 +516,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FACTURE_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 4d9304472d5..4369bb9a2a7 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -294,7 +294,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FICHEINTER_ADDON == $classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -419,13 +419,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir).'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -434,7 +434,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 81db1cbe58d..55d19a7ea6c 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -230,7 +230,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->HOLIDAY_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -359,13 +359,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -374,7 +374,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($conf->global->HOLIDAY_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -466,9 +466,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -482,9 +482,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -498,9 +498,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; @@ -514,9 +514,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1); } else { if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } } print ""; diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 477f38fa663..b886e6faf39 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -533,13 +533,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 1a274f8cec1..737aa7e1940 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -131,7 +131,7 @@ if (!function_exists("ldap_connect")) { $form = new Form($db); -print ''; +print ''; print ''; print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index d68726c5125..b51843e1509 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -145,7 +145,7 @@ print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescContact").'
'; print '
'; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 91fba4e3519..14718303f67 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -120,7 +120,7 @@ print $langs->trans("LDAPDescGroups").'
'; print '
'; -print ''; +print ''; print ''; print '
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 3fb65f730c6..44ed5f5dc25 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -184,7 +184,7 @@ if (!function_exists("ldap_connect")) { setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -print ''; +print ''; print ''; print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 777bc80c6e1..a812f98a5e7 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -112,7 +112,7 @@ print $langs->trans("LDAPDescMembersTypes").'
'; print '
'; -print ''; +print ''; print ''; $form = new Form($db); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index ab6c0f52121..dbdd61b9913 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -173,7 +173,7 @@ if (!function_exists("ldap_connect")) { } -print ''; +print ''; print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7eef9a05517..bacc8ef3166 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -935,7 +935,7 @@ if ($resql) { print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ccf12d5a104..253ee32e581 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -878,7 +878,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { } } $codeenabledisable .= ''."\n"; - $codeenabledisable .= 'global->MRP_MO_ADDON == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -359,13 +359,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -374,7 +374,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->MRP_MO_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 4d170aa5fbd..ba7690bb6e3 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -144,7 +144,7 @@ $linkback = ''; -print ''; +print ''; print ''; print '
'; print ''; print ''; - print ''; + print ''; print '
'; print ''; print '
'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'; @@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''; @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) else { print '"; } @@ -318,7 +318,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index f9c183b5c7d..90a75626e7c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''; @@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) else { print '"; } @@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index dcd91df0dbc..22ce045a7ab 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -278,7 +278,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROPALE_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -402,13 +402,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print ""; } @@ -417,7 +417,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->PROPALE_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -658,11 +658,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) { - 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 ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 988023175db..a2758304527 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -350,15 +350,15 @@ if ($mode == 'config' && $user->admin) { print ''; print ''; // edit icon - print ''; print ''; @@ -438,15 +438,15 @@ if ($mode == 'template' && $user->admin) { print ''; print ''; // edit icon - print ''; } diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 6367b80c150..218cc1ef853 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -363,13 +363,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->RECEPTION_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index a86ca272b85..b3204d594e0 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -260,7 +260,7 @@ foreach ($arrayhandler as $key => $module) { //print img_picto('', 'tick'); print img_picto($langs->trans("Enabled"), 'switch_on'); } else { - print ''; + print ''; //print $langs->trans("Activate"); print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 5f8cc66eb1e..477691cf6ef 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -111,9 +111,9 @@ if (function_exists("imagecreatefrompng")) { print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA'); } else { if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } } else { @@ -130,9 +130,9 @@ if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); } else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ""; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 8f267e9eb1c..92dba301854 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -149,7 +149,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) { } else { print dol_get_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - $link = ''; + $link = ''; //$link.=$langs->trans("Activate"); $link .= img_picto($langs->trans("Disabled"), 'switch_off'); $link .= ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e45a01d9ed1..2f357b2d5fc 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -565,13 +565,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -580,7 +580,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->STOCK_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index a888a248d11..40fe58f68d6 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -256,7 +256,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -375,7 +375,7 @@ foreach ($dirmodels as $reldir) { //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") //{ // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; + print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; /*} @@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) { print ""; } else { print '"; } @@ -395,9 +395,9 @@ foreach ($dirmodels as $reldir) { if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index cfa6c878a74..00b5fbfdb8e 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -269,7 +269,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir) { if (in_array($name, $def)) { print '"; } else { print '"; } @@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -472,11 +472,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { - 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 ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 15210f89360..ce2c9f0f872 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir) { print ""; } else { print '"; } @@ -381,9 +381,9 @@ foreach ($dirmodels as $reldir) { if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 980ebe10fff..6e3f190aeb6 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -257,7 +257,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -380,22 +380,22 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { - print ""; } // Defaut - print "'; @@ -503,9 +503,9 @@ if ($conf->banque->enabled) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { - 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 ''; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 3d31c516858..72e8db6bb4e 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -149,7 +149,7 @@ if (!$base) { print ''; print ''; print ''; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 8a6d6bbb4ed..db2b8374b9b 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -340,69 +340,6 @@ if (empty($out)) { } print '
'; -print '
'; -print '
'; -print '
'; - - -print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder'); - - -//print ''.$langs->trans("PasswordEncryption").': '; -print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; -if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { - print '     If unset: \'md5\''; -} -if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print '
MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
'; -} else { - print '('.$langs->trans("Recommended").': password_hash)'; - print '
'; -} -if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print '
The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; - print 'If you really want to switch, you must:
'; - print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'
'; - print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password
'; - print '- You can now logout and login with this new password. You must now reset password of all other users.
'; - print '

'; -} -print '
'; - -print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
"; -print '
'; - -print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).'   ('.$langs->trans("Recommended").': 0)
'; -print '
'; - -print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).'   ('.$langs->trans("Recommended").': 1)
'; -print '
'; - -print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."
"; -print '
'; - -print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."
"; -print '
'; - -print 'MAIN_EXEC_USE_POPEN = '; -if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { - print ''.$langs->trans("Undefined").''; -} else { - print $conf->global->MAIN_EXEC_USE_POPEN; -} -if ($execmethod == 1) { - print ', "exec" PHP method will be used for shell commands'; - print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; - print ''; -} -if ($execmethod == 2) { - print ', "popen" PHP method will be used for shell commands'; - print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; - print ''; -} -print "
"; -print '
'; - // Modules/Applications @@ -462,6 +399,73 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) { print '

'; + +print '
'; + + +print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder'); + + +//print ''.$langs->trans("PasswordEncryption").': '; +print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; +if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { + print '     If unset: \'md5\''; +} +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print '
MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
'; +} else { + print '('.$langs->trans("Recommended").': password_hash)'; + print '
'; +} +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print '
The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; + print 'If you really want to switch, you must:
'; + print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'
'; + print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password
'; + print '- You can now logout and login with this new password. You must now reset password of all other users.
'; + print '

'; +} +print '
'; + +print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
"; +print '
'; + +print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).'   ('.$langs->trans("Recommended").': 0)
'; +print '
'; + +print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).'   ('.$langs->trans("Recommended").': 1)
'; +print '
'; + +print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."
"; +print '
'; + +print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."
"; +print '
'; + +print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."
"; +print '
'; + + +print 'MAIN_EXEC_USE_POPEN = '; +if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { + print ''.$langs->trans("Undefined").''; +} else { + print $conf->global->MAIN_EXEC_USE_POPEN; +} +if ($execmethod == 1) { + print ', "exec" PHP method will be used for shell commands'; + print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; + print ''; +} +if ($execmethod == 2) { + print ', "popen" PHP method will be used for shell commands'; + print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; + print ''; +} +print "
"; +print '
'; + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index c3778861ddf..03fd647dd29 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -400,13 +400,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 22e4a4a1b42..68dbfb429b8 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -180,10 +180,11 @@ $head = ticketAdminPrepareHead(); print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); -print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php', 2).''; +print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php', 2).''; print dol_get_fiche_end(); +$param = ''; $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 8b5c05b7bda..2327abd549e 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -463,6 +463,8 @@ if ($mode == 'searchkey') { } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1); + $massactionbutton = ''; + print ''; print ''; @@ -499,7 +501,7 @@ if ($mode == 'searchkey') { //} print ''; // Action column - print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index da3a1913d64..85ab0f0e9a8 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -147,9 +147,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('USER_MAIL_REQUIRED'); } else { if (empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -165,9 +165,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX'); } else { if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -256,13 +256,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -271,7 +271,7 @@ foreach ($dirmodels as $reldir) { if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index b73d3ce4f22..3319ab994a6 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -188,13 +188,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -203,7 +203,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->USERGROUP_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 1b6fa5bebe7..ada5a6e0b3b 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -250,11 +250,11 @@ foreach ($workflowcodes as $key => $params) { print ajax_constantonoff($key); } else { if (!empty($conf->global->$key)) { - 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/admin/workstation.php b/htdocs/admin/workstation.php index f14393e2588..76556fb4d68 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -423,13 +423,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index ceaf6aa2ecc..b2473409b5b 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -102,7 +102,7 @@ if (empty($reshook)) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = DOL_URL_ROOT.'/compta/bank/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/asset/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); } } } @@ -247,7 +247,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -294,13 +294,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { if ($user->rights->asset->write) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } if ($user->rights->asset->delete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } @@ -334,7 +334,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'asset', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright); print '
'; } diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 66cd9bcb4cf..34e0a732f57 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -57,6 +57,7 @@ class Asset extends CommonObject const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; + const STATUS_CANCELED = 9; /** @@ -95,7 +96,7 @@ class Asset extends CommonObject 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,), 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '9'=>'Cancel')), ); /** diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index 16af18d8277..ebd340e393d 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -97,7 +97,7 @@ if ($id > 0 || !empty($ref)) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) { if ($user->rights->asset->creer) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index bf65f40fe13..841086399c9 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -139,7 +139,7 @@ if ($object->id > 0) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -156,7 +156,7 @@ if ($object->id > 0) { if ($user->rights->bom->creer) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 235336d4f73..ed55f7cf29c 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -71,6 +71,9 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +if ($object->id > 0) { + $object->calculateCosts(); +} // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); @@ -105,7 +108,7 @@ if (empty($reshook)) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/bom/bom_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.($id > 0 ? $id : '__ID__'); } } } @@ -305,8 +308,6 @@ if (($id || $ref) && $action == 'edit') { // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals(); - $head = bomPrepareHead($object); print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); @@ -450,7 +451,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -467,7 +468,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref.=''; @@ -596,7 +597,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Modify if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } @@ -616,24 +617,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Re-open if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) { - print ''.$langs->trans("ReOpen").''."\n"; + print ''.$langs->trans("ReOpen").''."\n"; } // Create MO if ($conf->mrp->enabled) { if ($object->status == $object::STATUS_VALIDATED && !empty($user->rights->mrp->write)) { - print ''.$langs->trans("CreateMO").''."\n"; + print ''.$langs->trans("CreateMO").''."\n"; } } // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print ''.$langs->trans("ToClone").''."\n"; } // Close / Cancel if ($permissiontoadd && $object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Disable").''."\n"; + print ''.$langs->trans("Disable").''."\n"; } /* @@ -651,7 +652,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } @@ -687,14 +688,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlright = ''; + $morehtmlright = ''; $morehtmlright .= $langs->trans("SeeAll"); $morehtmlright .= ''; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'bom', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright); print '
'; } diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index dd0227e4305..c36ac32bb59 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -125,7 +125,7 @@ if ($object->id) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index f456e7ddf98..8ace40cc900 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index de8c87bcd43..a4ab56c2a66 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -98,7 +98,7 @@ class BOM extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), - 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), + 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), @@ -381,7 +381,7 @@ class BOM extends CommonObject if ($result > 0 && !empty($this->table_element_line)) { $this->fetchLines(); } - $this->calculateCosts(); + //$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it. return $result; } @@ -1035,7 +1035,8 @@ class BOM extends CommonObject } /** - * BOM costs calculation based on cost_price or pmp of each BOM line + * BOM costs calculation based on cost_price or pmp of each BOM line. + * Set the property ->total_cost and ->unit_cost of BOM. * * @return void */ @@ -1045,30 +1046,36 @@ class BOM extends CommonObject $this->unit_cost = 0; $this->total_cost = 0; - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; - $productFournisseur = new ProductFournisseur($this->db); - - foreach ($this->lines as &$line) { + if (is_array($this->lines) && count($this->lines)) { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); $tmpproduct = new Product($this->db); - $result = $tmpproduct->fetch($line->fk_product); - if ($result < 0) { - $this->error = $tmpproduct->error; - return -1; - } - $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); - if (empty($line->unit_cost)) { - if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { - $line->unit_cost = $productFournisseur->fourn_unitprice; + + foreach ($this->lines as &$line) { + $tmpproduct->cost_price = 0; + $tmpproduct->pmp = 0; + + $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading + if ($result < 0) { + $this->error = $tmpproduct->error; + return -1; } + $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); + if (empty($line->unit_cost)) { + if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { + $line->unit_cost = $productFournisseur->fourn_unitprice; + } + } + + $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); + + $this->total_cost += $line->total_cost; } - $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); - $this->total_cost += $line->total_cost; - } - - $this->total_cost = price2num($this->total_cost, 'MT'); - if ($this->qty) { - $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); + $this->total_cost = price2num($this->total_cost, 'MT'); + if ($this->qty) { + $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); + } } } } @@ -1383,7 +1390,7 @@ class BOMLine extends CommonObjectLine $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; - $url = dol_buildpath('/bom/bomline_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/bom/bomline_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php index fcba37105d3..946563f7b81 100644 --- a/htdocs/bom/tpl/linkedobjectblock.tpl.php +++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php @@ -73,7 +73,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo '
'; echo "\n"; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index fff9d077a08..2c3896a6282 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -129,7 +129,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { $coldisplay++; if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation - print 'id.'">'; + print 'id.'">'; print img_delete(); print ''; } diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 045e656de50..839ce4c3f86 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -313,12 +313,12 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { // Edit if ($user->rights->bookmark->creer && $action != 'edit') { - print ''.$langs->trans("Edit").''."\n"; + print ''.$langs->trans("Edit").''."\n"; } // Remove if ($user->rights->bookmark->supprimer && $action != 'edit') { - print ''.$langs->trans("Delete").''."\n"; + print ''.$langs->trans("Delete").''."\n"; } print ''; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index bddeb9a771a..02e6892b571 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -101,9 +101,9 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('CATEGORIE_RECURSIV_ADD'); } else { if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index ba5515149d4..d5c135279bf 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -58,6 +58,7 @@ class Categorie extends CommonObject const TYPE_ACTIONCOMM = 'actioncomm'; const TYPE_WEBSITE_PAGE = 'website_page'; const TYPE_TICKET = 'ticket'; + const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -81,7 +82,8 @@ class Categorie extends CommonObject 'warehouse' => 9, 'actioncomm' => 10, 'website_page' => 11, - 'ticket' => 12 + 'ticket' => 12, + 'knowledgemanagement' => 13 ); /** @@ -102,7 +104,8 @@ class Categorie extends CommonObject 9 => 'warehouse', 10 => 'actioncomm', 11 => 'website_page', - 12 => 'ticket' + 12 => 'ticket', + 13 => 'knowledgemanagement' ); /** @@ -146,7 +149,8 @@ class Categorie extends CommonObject 'warehouse'=> 'Entrepot', 'actioncomm' => 'ActionComm', 'website_page' => 'WebsitePage', - 'ticket' => 'Ticket' + 'ticket' => 'Ticket', + 'knowledgemanagement' => 'KnowledgeRecord' ); /** diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 5fb1c85dd40..06c3caae43c 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -234,7 +234,7 @@ if ($object->id) { print ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; } if ($user->rights->categorie->creer) { - print ''; + print ''; print img_delete().''; } if ($nbbyrow) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e4ceccdb3fc..8a10b39826f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -278,8 +278,20 @@ if (empty($reshook) && $action == 'add') { $object->fulldayevent = (!empty($fulldayevent) ? 1 : 0); $object->location = GETPOST("location", 'alphanohtml'); $object->label = GETPOST('label', 'alphanohtml'); - $object->fk_element = GETPOST("fk_element", 'int'); - $object->elementtype = GETPOST("elementtype", 'alpha'); + + if (GETPOST("elementtype", 'alpha')) { + $modulecodetouseforpermissioncheck = GETPOST("elementtype", 'alpha'); + + $hasPermissionOnLinkedObject = 0; + if ($user->hasRight($modulecodetouseforpermissioncheck, 'read')) { + $hasPermissionOnLinkedObject = 1; + } + if ($hasPermissionOnLinkedObject) { + $object->fk_element = GETPOST("fk_element", 'int'); + $object->elementtype = GETPOST("elementtype", 'alpha'); + } + } + if (!GETPOST('label')) { if (GETPOST('actioncode', 'aZ09') == 'AC_RDV' && $contact->getFullName($langs)) { $object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs)); @@ -520,8 +532,20 @@ if (empty($reshook) && $action == 'update') { } $object->fk_project = GETPOST("projectid", 'int'); $object->note_private = trim(GETPOST("note", "restricthtml")); - $object->fk_element = GETPOST("fk_element", "int"); - $object->elementtype = GETPOST("elementtype", "alphanohtml"); + + if (GETPOST("elementtype", 'alpha')) { + $modulecodetouseforpermissioncheck = GETPOST("elementtype", 'alpha'); + + $hasPermissionOnLinkedObject = 0; + if ($user->hasRight($modulecodetouseforpermissioncheck, 'read')) { + $hasPermissionOnLinkedObject = 1; + } + if ($hasPermissionOnLinkedObject) { + $object->fk_element = GETPOST("fk_element", 'int'); + $object->elementtype = GETPOST("elementtype", 'alpha'); + } + } + if (!$datef && $percentage == 100) { $error++; $donotclearsession = 1; setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors'); @@ -1191,7 +1215,7 @@ if ($action == 'create') { print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((empty($societe->id) ? '' : $societe->id), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); - print ' '; + print ' '; print ''; $urloption = '?action=create&donotclearsession=1'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; @@ -1218,7 +1242,7 @@ if ($action == 'create') { if (!empty($projectid)) { $projectsListId = $projectid; } - $tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : ''; + $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId); print ''; } @@ -1226,12 +1250,28 @@ if ($action == 'create') { // Object linked if (!empty($origin) && !empty($originid)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + + $hasPermissionOnLinkedObject = 0; + if ($user->hasRight($origin, 'read')) { + $hasPermissionOnLinkedObject = 1; + } + //var_dump('origin='.$origin.' originid='.$originid.' $hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject); + + if (! in_array($origin, array('societe', 'project', 'task', 'user'))) { + // We do not use link for object that already contains a hard coded field to make links with agenda events + print ''; + print ''; + } } $reg = array(); @@ -1847,7 +1887,7 @@ if ($id > 0) { if ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index df73c6a70f7..79fb13a8717 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -735,13 +735,14 @@ class ActionComm extends CommonObject /** * Load object from database * - * @param int $id Id of action to get - * @param string $ref Ref of action to get - * @param string $ref_ext Ref ext to get - * @param string $email_msgid Email msgid - * @return int <0 if KO, >0 if OK + * @param int $id Id of action to get + * @param string $ref Ref of action to get + * @param string $ref_ext Ref ext to get + * @param string $email_msgid Email msgid + * @param string $loadresources 1=Load also resources + * @return int <0 if KO, >0 if OK */ - public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '') + public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1) { global $langs; @@ -858,7 +859,11 @@ class ActionComm extends CommonObject $this->event_paid = $obj->event_paid; $this->status = $obj->status; - $this->fetchResources(); + $this->fetch_optionals(); + + if ($loadresources) { + $this->fetchResources(); + } } $this->db->free($resql); } else { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 8b97f23737e..dbfbc84b69f 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -952,18 +952,18 @@ if ($action == 'create') { print "\n\n
\n"; if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) { - print ''.$langs->trans("SetToDraft").''; + print ''.$langs->trans("SetToDraft").''; } if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { - print ''.$langs->trans("EditWithEditor").''; + print ''.$langs->trans("EditWithEditor").''; } else { - print ''.$langs->trans("EditWithTextEditor").''; + print ''.$langs->trans("EditWithTextEditor").''; } if (!empty($conf->use_javascript_ajax)) { - print ''.$langs->trans("EditHTMLSource").''; + print ''.$langs->trans("EditHTMLSource").''; } } @@ -972,7 +972,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("TestMailing").''; } else { - print ''.$langs->trans("TestMailing").''; + print ''.$langs->trans("TestMailing").''; } if ($object->statut == 0) { @@ -1011,7 +1011,7 @@ if ($action == 'create') { if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) { print ''.$langs->trans("DeleteMailing").''; } else { - print ''.$langs->trans("DeleteMailing").''; + print ''.$langs->trans("DeleteMailing").''; } } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 656d370d6d5..72eee9c22df 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2011,7 +2011,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -2544,7 +2544,7 @@ if ($action == 'create') { // ReOpen if ( (( ! empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; print '>'.$langs->trans('ReOpen').''; } @@ -2552,7 +2552,7 @@ if ($action == 'create') { if (empty($user->socid)) { if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($usercansend) { - print ''.$langs->trans('SendMail').''; + print ''.$langs->trans('SendMail').''; } else { print ''.$langs->trans('SendMail').''; } @@ -2595,13 +2595,13 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) { if (!empty($conf->facture->enabled) && $usercancreateinvoice) { - print ''.$langs->trans("AddBill").''; + print ''.$langs->trans("CreateBill").''; } $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { if ($usercanclose) { - print 'socid.'">'.$langs->trans("ClassifyBilled").''; + print 'socid.'">'.$langs->trans("ClassifyBilled").''; } else { print ''.$langs->trans("ClassifyBilled").''; } @@ -2611,7 +2611,7 @@ if ($action == 'create') { // Close as accepted/refused if ($object->statut == Propal::STATUS_VALIDATED) { if ($usercanclose) { - print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; + print 'global->MAIN_JUMP_TAG) ? '' : '#close').'"'; print '>'.$langs->trans('SetAcceptedRefused').''; } else { print ''.$langs->trans("ToClone").''; + print ''.$langs->trans("ToClone").''; } // Delete if ($usercandelete) { - print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 61a14ab62d8..69876476907 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -148,7 +148,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index a60f892274c..e1e9eec4ee4 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -141,7 +141,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 798dc87bcfd..5a8d2b2294c 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -88,7 +88,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ff8a583b0ef..bff848c78e2 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -316,13 +316,14 @@ if ($action == 'validate' && $permissiontovalidate) { if ($tmpproposal->fetch($checked)) { if ($tmpproposal->statut == 0) { if ($tmpproposal->valid($user)) { - setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs'); + setEventMessage($langs->trans('hasBeenValidated', $tmpproposal->ref), 'mesgs'); } else { setEventMessage($langs->trans('CantBeValidated'), 'errors'); $error++; } } else { - setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors'); + $langs->load("errors"); + setEventMessage($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), 'errors'); $error++; } } else { diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 53a3a37c84d..c46fb7a67b2 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -112,7 +112,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 23c1a459c74..829effed6a2 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -68,7 +68,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } print ''; print '
'; - print ''; + print ''; print "\n"; } if (count($linkedObjectBlock) > 1) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3aaa79cab55..2e37cdcd0a1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2041,7 +2041,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -2485,14 +2485,14 @@ if ($action == 'create' && $usercancreate) { if (empty($reshook)) { // Reopen a closed order if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) { - print ''.$langs->trans('ReOpen').''; + print ''.$langs->trans('ReOpen').''; } // Send if (empty($user->socid)) { if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($usercansend) { - print ''.$langs->trans('SendMail').''; + print ''.$langs->trans('SendMail').''; } else { print ''.$langs->trans('SendMail').''; } @@ -2574,31 +2574,31 @@ if ($action == 'create' && $usercancreate) { // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { - print ''.$langs->trans("CreateBill").''; + print ''.$langs->trans("CreateBill").''; } if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { - print ''.$langs->trans("ClassifyBilled").''; + print ''.$langs->trans("ClassifyBilled").''; } } if ($object->statut > Commande::STATUS_DRAFT && $object->billed) { if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { - print ''.$langs->trans("ClassifyUnBilled").''; + print ''.$langs->trans("ClassifyUnBilled").''; } } // Clone if ($usercancreate) { - print ''.$langs->trans("ToClone").''; + print ''.$langs->trans("ToClone").''; } // Cancel order if ($object->statut == Commande::STATUS_VALIDATED && (!empty($usercanclose) || !empty($usercancancel))) { - print ''.$langs->trans("Cancel").''; + print ''.$langs->trans("Cancel").''; } // Delete order if ($usercandelete) { if ($numshipping == 0) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans("Delete").''; } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 0a44d87f4ae..5b9705209c5 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index f8cc503e0ec..7eb835fe938 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 2e5f0b696ff..d9221096392 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -88,7 +88,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d91638fcf52..22b24c048a2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -309,13 +309,14 @@ if ($action == 'validate' && $permissiontoadd) { $idwarehouse = 0; } if ($objecttmp->valid($user, $idwarehouse)) { - setEventMessage($objecttmp->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs'); + setEventMessage($langs->trans('hasBeenValidated', $objecttmp->ref), 'mesgs'); } else { setEventMessage($langs->trans('CantBeValidated'), 'errors'); $error++; } } else { - setEventMessage($objecttmp->ref." ".$langs->trans('IsNotADraft'), 'errors'); + $langs->load("errors"); + setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors'); $error++; } } else { @@ -339,13 +340,14 @@ if ($action == 'shipped' && $permissiontoadd) { if ($objecttmp->fetch($checked)) { if ($objecttmp->statut == 1) { if ($objecttmp->cloture($user)) { - setEventMessage($objecttmp->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs'); + setEventMessage($langs->trans('PassedInClosedStatus', $objecttmp->ref), 'mesgs'); } else { - setEventMessage($langs->trans('CantBeValidated'), 'errors'); + setEventMessage($langs->trans('CantBeClosed'), 'errors'); $error++; } } else { - setEventMessage($objecttmp->ref." ".$langs->trans('IsNotADraft'), 'errors'); + $langs->load("errors"); + setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors'); $error++; } } else { diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index e03d9c00edb..c3218c8cbe8 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index a0641c4c493..211702059cb 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -64,7 +64,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo ''; echo "\n"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index e5e264a12f5..f6a03c1d11d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -889,7 +889,7 @@ if ($resql) { print ''; }*/ print ''; @@ -1683,7 +1683,7 @@ if ($resql) { } } if ($user->rights->banque->modifier) { - print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; + print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; print img_delete('', 'class="marginleftonly"'); print ''; } diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 403caa6cdfd..2605bc39d30 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -146,8 +146,8 @@ if ($result) { //print ''.$langs->trans("List").''; print ''; print ''; } print ""; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 68c6ed20458..3b078698728 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -555,7 +555,7 @@ if ($id) { $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->banque->modifier) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 1b5fd5fd383..5f55f4c2559 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -99,7 +99,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index b173426e179..e50dc10ff7f 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -62,7 +62,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 26949590334..eebe3e4832f 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -107,9 +107,9 @@ if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { $permissiontoadd = ($user->rights->cashdesk->run || $user->rights->takepos->run); $permissiontodelete = ($user->rights->cashdesk->run || $user->rights->takepos->run) || ($permissiontoadd && $object->status == 0); if (empty($backtopage)) { - $backtopage = dol_buildpath('/compta/cashcontrol/cashcontrol_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.($id > 0 ? $id : '__ID__'); } -$backurlforlist = dol_buildpath('/compta/cashcontrol/cashcontrol_list.php', 1); +$backurlforlist = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_list.php'; $triggermodname = 'CACHCONTROL_MODIFY'; // Name of trigger action code to execute when we modify record if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH1)) { @@ -679,11 +679,11 @@ if (empty($action) || $action == "view" || $action == "close") { print ''; if ($object->status == CashControl::STATUS_DRAFT) { - print ''; + print ''; - print ''; + print ''; } else { - print ''; + print ''; } print ''; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 6f390e82552..77db777c077 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -431,7 +431,7 @@ if ($action == 'create') { print $langs->trans('Project'); print ''; if ($action != 'classify' && $user->rights->deplacement->creer) { - print ''; } @@ -485,7 +485,7 @@ if ($action == 'create') { if ($object->statut == Deplacement::STATUS_VALIDATED) { // if validated if ($user->rights->deplacement->creer) { - print ''.$langs->trans('ClassifyRefunded').''; + print ''.$langs->trans('ClassifyRefunded').''; } else { print ''.$langs->trans('ClassifyRefunded').''; } diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 99e09130011..153bd58114d 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1201,7 +1201,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 99bf843f50b..105c94d6a73 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4202,7 +4202,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -4673,7 +4673,7 @@ if ($action == 'create') { print ''; print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code); print ' → '; - print ' '; + print ' '; print ''; print " '; + $response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$urltoprint); + } + $i++; + } + } else { + dol_print_error($db); + } + $response =json_encode($response); + echo $response; +} diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index 066e5b7812d..0056120c6bd 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -53,7 +53,7 @@ top_httphead(); // Registering the location of boxes if (isset($_GET['action']) && !empty($_GET['action'])) { - if ($_GET['action'] == 'getrandompassword' && $user->admin) { + if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generic = $_GET['generic'] ? true : false; echo getRandomPassword($generic); diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php new file mode 100644 index 00000000000..14a431bcb84 --- /dev/null +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -0,0 +1,215 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_graph_invoices_peryear.php + * \ingroup factures + * \brief Box to show graph of invoices per year + */ +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last invoices + */ +class box_graph_invoices_peryear extends ModeleBoxes +{ + public $boxcode = "invoicesperyear"; + public $boximg = "object_bill"; + public $boxlabel = "BoxCustomersInvoicesPerYear"; + public $depends = array("facture"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param) + { + global $user; + + $this->db = $db; + + $this->hidden = !($user->rights->facture->lire); + } + + /** + * Load data into info_box_contents array to show array later. + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $conf, $user, $langs; + + $this->max = $max; + + $refreshaction = 'refresh_'.$this->boxcode; + + //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + //$facturestatic=new Facture($this->db); + + $startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1; + if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1; + + $text = $langs->trans("Turnover", $max); + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject boxfilter', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $dir = ''; // We don't need a path because image file will not be saved into disk + $prefix = ''; + $socid = 0; + if ($user->socid) $socid = $user->socid; + if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user + + if ($user->rights->facture->lire) { + $mesg = ''; + + $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; + $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; + + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; + $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { + $endyear = GETPOST($param_year, 'int'); + $showtot = GETPOST($param_showtot, 'alpha'); + } else { + $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true); + $endyear = $tmparray['year']; + $showtot = $tmparray['showtot']; + } + if (empty($showtot)) { $showtot = 1; } + $nowarray = dol_getdate(dol_now(), true); + if (empty($endyear)) $endyear = $nowarray['year']; + $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH); + $startyear = $endyear - $numberyears; + + $mode = 'customer'; + $WIDTH = (($showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320'; + $HEIGHT = '192'; + + $stats = new FactureStats($this->db, $socid, $mode, 0); + + // Build graphic amount of object. $data = array(array('Lib',val1,val2,val3),...) + $data2 = $stats->getAmountByYear($numberyears); + + $filenamenb = $dir."/".$prefix."invoicesamountyears-".$endyear.".png"; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountyears-'.$endyear.'.png'; + if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountyears-'.$endyear.'.png'; + + $px2 = new DolGraph(); + $mesg = $px2->isGraphKo(); + if (!$mesg) { + $langs->load("bills"); + + $px2->SetData($data2); + unset($data2); + $i = $startyear; + $legend = array(); + while ($i <= $endyear) { + if ($startmonth != 1) { + $legend[] = sprintf("%d/%d", $i - 2001, $i - 2000); + } else { + $legend[] = $i; + } + $i++; + } + $px2->SetLegend([$langs->trans("AmountOfBillsHT")]); + $px2->SetMaxValue($px2->GetCeilMaxValue()); + $px2->SetWidth($WIDTH); + $px2->SetHeight($HEIGHT); + $px2->SetYLabel($langs->trans("AmountOfBillsHT")); + $px2->SetShading(3); + $px2->SetHorizTickIncrement(1); + $px2->SetCssPrefix("cssboxes"); + $px2->mode = 'depth'; + $px2->SetTitle($langs->trans("Turnover")); + + $px2->draw($filenamenb, $fileurlnb); + } + + if (empty($conf->use_javascript_ajax)) { + $langs->load("errors"); + $mesg = $langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + + if (!$mesg) { + $stringtoshow = ''; + $stringtoshow .= ''; + $stringtoshow .= '
'; // hideobject is to start hidden + $stringtoshow .= '
'; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= $langs->trans("Year").' '; + $stringtoshow .= ''; + $stringtoshow .= ''; + $stringtoshow .= '
'; + $stringtoshow .= $px2->show(); + $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow); + } else { + $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg); + } + } else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover left"', + 'text' => ''.$langs->trans("ReadPermissionNotAllowed").'' + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 9b7cbfc2fe6..0c349ad3e4c 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -122,7 +122,7 @@ class box_task extends ModeleBoxes $boxcontent .= ''."\n"; $selectArray = array('all' => $langs->trans("NoFilter"), 'im_task_contact' => $langs->trans("WhichIamLinkedTo"), 'im_project_contact' => $langs->trans("WhichIamLinkedToProject")); $boxcontent .= $form->selectArray($cookie_name, $selectArray, $filterValue); - $boxcontent .= ''; + $boxcontent .= ''; $boxcontent .= ''."\n"; $boxcontent .= ''."\n"; if (!empty($conf->use_javascript_ajax)) { diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 0c4155da6c7..d756e1461ea 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -112,11 +112,11 @@ class box_validated_projects extends ModeleBoxes $sql .= " COUNT(DISTINCT t.rowid) as tasknumber"; $sql .= " FROM ".MAIN_DB_PREFIX."projet AS p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet"; - // TODO Replace -1, -2, -3 with ID used for type of contat project_task into llx_c_type_contact. Once done, we can switch widget as stable. + // TODO Replace -1, -2, -3 with ID used for type of contact project_task into llx_c_type_contact. Once done, we can switch widget as stable. $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)"; $sql .= " WHERE p.fk_statut = 1"; // Only open projects if ($projectsListId) { - $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project we ara allowed + $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project are allowed } $sql .= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user = ".((int) $user->id).")"; $sql .= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo"; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 18920da3bc2..3f75ee30d02 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -447,6 +447,9 @@ abstract class CommonDocGenerator $array_key.'_bank_iban'=>$bank_account->iban, $array_key.'_bank_bic'=>$bank_account->bic, + $array_key.'_bank_label'=>$bank_account->label, + $array_key.'_bank_number'=>$bank_account->number, + $array_key.'_bank_proprio'=>$bank_account->proprio, $array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs), $array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 462a3bd5c44..eb5edb921f3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1733,6 +1733,18 @@ abstract class CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the project with id $this->fk_project into this->project + * + * @return int <0 if KO, >=0 if OK + */ + public function fetch_project() + { + // phpcs:enable + return $this->fetch_projet(); + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load the project with id $this->fk_project into this->project @@ -3845,8 +3857,14 @@ abstract class CommonObject $classfile = 'conferenceorbooth'; $classname = 'ConferenceOrBooth'; $module = 'eventorganization'; + } elseif ($objecttype == 'mo') { + $classpath = 'mrp/class'; + $classfile = 'mo'; + $classname = 'Mo'; + $module = 'mrp'; } + // Here $module, $classfile and $classname are set if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) { if ($loadalsoobjects) { @@ -7323,7 +7341,11 @@ abstract class CommonObject dol_include_once($InfoFieldList[1]); if ($classname && class_exists($classname)) { $object = new $classname($this->db); - $object->fetch($value); + if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong + $object->fetch($value, '', '', '', 0, 1, 1); + } else { + $object->fetch($value); + } $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else { @@ -8199,10 +8221,10 @@ abstract class CommonObject // Special cas for product if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) { // Link to resize - $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; + $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; // Link to delete - $return .= ''; + $return .= ''; $return .= img_delete().''; } } @@ -8228,10 +8250,10 @@ abstract class CommonObject // Special case for product if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) { // Link to resize - $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; + $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; // Link to delete - $return .= ''; + $return .= ''; $return .= img_delete().''; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5813c45047a..46159a52519 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7009,7 +7009,7 @@ class Form $tmparray = explode('@', $objecttmp->ismultientitymanaged); $sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { if (!$user->rights->societe->client->voir && !$user->socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } @@ -7037,7 +7037,7 @@ class Form $sql .= " AND t.fk_soc = ".((int) $user->socid); } } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { if (!$user->rights->societe->client->voir && !$user->socid) { $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -7891,12 +7891,16 @@ class Form $tplpath = 'eventorganization'; } elseif ($objecttype == 'conferenceorboothattendee') { $tplpath = 'eventorganization'; + } elseif ($objecttype == 'mo') { + $tplpath = 'mrp'; + if (empty($conf->mrp->enabled)) { + continue; // Do not show if module disabled + } } global $linkedObjectBlock; $linkedObjectBlock = $objects; - // Output template part (modules that overwrite templates must declare this into descriptor) $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); foreach ($dirtpls as $reldir) { @@ -7982,7 +7986,8 @@ class Form 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), 'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'), - 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')') + 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'), + 'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMO', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s INNER JOIN ".MAIN_DB_PREFIX."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')') ); } diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 09c94485d11..4b12b4513e5 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -221,10 +221,13 @@ class FormActions if ($typeelement == 'project') { $projectid = $object->id; } + if ($typeelement == 'task') { + $taskid = $object->id; + } $newcardbutton = ''; if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').($taskid > 0 ? '&taskid='.$taskid : '').'&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 8e03f158a02..13619fe5aa3 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -73,6 +73,18 @@ class FormAdmin $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12, 0, $mainlangonly); + // If the language to select is not inside the list of available language and empty value is not available, we must find + // an alternative as the language code to pre-select (to avoid to have first element in list pre-selected). + if ($selected && !in_array($selected, $langs_available) && empty($showempty)) { + $tmparray = explode('_', $selected); + if (!empty($tmparray[1])) { + $selected = getLanguageCodeFromCountryCode($tmparray[1]); + } + if (empty($selected)) { + $selected = $langs->defaultlang; + } + } + $out = ''; $out .= '
'; + print ' + '."\n"; + } + // MESSAGE $msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ''; print ''; } else { - print ''; } @@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) { print ""; } else { print '"; } } diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 8169a6ca22f..7dfe7c212f2 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -267,7 +267,7 @@ for ($i = 1; $i <= 4; $i++) { use_javascript_ajax) { ?> trans('Delete'); ?> - ">trans('Delete'); ?> + ">trans('Delete'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index f058d38cd7c..86c7d9c9f65 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -194,7 +194,7 @@ if ($this->control->tpl['action_delete']) { use_javascript_ajax) { ?> trans('Delete'); ?> - ">trans('Delete'); ?> + ">trans('Delete'); ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 96142f65cd6..a155f08e529 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2942,7 +2942,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile print ''.$langs->trans('Delete').''."\n"; } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 1f11e6a29c3..9574544a11a 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -394,7 +394,7 @@ class CompanyPaymentMode extends CommonObject $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; - $url = dol_buildpath('/monmodule/companypaymentmode_card.php', 1).'?id='.$this->id; + $url = ''; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4110e59d4de..8f0e2c84805 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2581,7 +2581,7 @@ class Societe extends CommonObject $label .= ' ('.dol_escape_htmltag($this->name_alias).')'; } } - $label .= '
'.$langs->trans('Email').': '.$this->email; + $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email; if (!empty($this->phone) || !empty($this->fax)) { $phonelist = array(); if ($this->phone) { @@ -2590,7 +2590,7 @@ class Societe extends CommonObject if ($this->fax) { $phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax'); } - $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist); + $label .= '
'.implode(' ', $phonelist); } if (!empty($this->address)) { $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 8fbbbbcee6e..f73c460b4a4 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -392,7 +392,7 @@ class SocieteAccount extends CommonObject $label .= ''.$langs->trans('Login').': '.$this->ref; //$label.= '' . $langs->trans('WebSite') . ': ' . $this->ref; - $url = dol_buildpath('/website/websiteaccount_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ca4793c2c60..bc786a540d6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1639,7 +1639,7 @@ while ($i < min($num, $limit)) { $titlealt = $val['label']; } if ($obj->stcomm_id != $val['id']) { - print ''.img_action($titlealt, $val['code'], $val['picto']).''; + print ''.img_action($titlealt, $val['code'], $val['picto']).''; } } print ''; diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php index 295fe8b2075..85223e856f3 100644 --- a/htdocs/societe/partnership.php +++ b/htdocs/societe/partnership.php @@ -132,7 +132,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET if (empty($reshook)) { $error = 0; - $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/partnership/partnership.php?id='.($id > 0 ? $id : '__ID__'); // Actions when linking object each other include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index da4ca1c0cd7..dbb0e8f0553 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -620,11 +620,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print img_info(); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_delete('default', 'style="vertical-align: middle;"'); print ''; print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index b00e5954e6d..bc677f29f53 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1463,7 +1463,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -1848,12 +1848,12 @@ if ($action == 'create') { // Edit if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercancreate) { - print ''; + print ''; } // ReOpen if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $usercanclose) { - print '
global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; + print ''; } @@ -1861,7 +1861,7 @@ if ($action == 'create') { if (empty($user->socid)) { if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) { if ($usercansend) { - print ''; + print ''; } else { print ''; } @@ -1889,12 +1889,12 @@ if ($action == 'create') { // Clone if ($usercancreate) { - print ''; + print ''; } // Delete if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) { - print ''; } } diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 02a4fc51966..faa9127779c 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoedit) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index 580c0f0974e..2795c006723 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -116,7 +116,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 80c67871e91..7d6d72276d8 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -81,7 +81,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index c4ab85e8e20..6466c6f42cb 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index c33c3b2ebac..d0fce33ed22 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo price($objectlink->total_ht); } ?>
- + global->TAKEPOS_REF_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index ed52280a8f4..858531e97a1 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -999,36 +999,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { query($sql); -$paiementsModes = array(); -if ($resql) { - while ($obj = $db->fetch_object($resql)) { - $paycode = $obj->code; - if ($paycode == 'LIQ') { - $paycode = 'CASH'; - } - if ($paycode == 'CHQ') { - $paycode = 'CHEQUE'; - } + $resql = $db->query($sql); + $paiementsModes = array(); + if ($resql) { + while ( $obj = $db->fetch_object($resql) ) { + $paycode = $obj->code; + if ($paycode == 'LIQ') { + $paycode = 'CASH'; + } + if ($paycode == 'CHQ') { + $paycode = 'CHEQUE'; + } - $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"]; - //var_dump($constantforkey.' '.$conf->global->$constantforkey); - if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) { - array_push($paiementsModes, $obj); + $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"]; + //var_dump($constantforkey.' '.$conf->global->$constantforkey); + if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) { + array_push($paiementsModes, $obj); + } } } + + if (empty($paiementsModes)) { + $langs->load('errors'); + setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); + setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); + } } -if (empty($paiementsModes)) { - $langs->load('errors'); - setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); - setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); -} if (count($maincategories) == 0) { if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { $tmpcategory = new Categorie($db); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 520fe8dccdb..ae12665e008 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) { if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { $bankaccount = GETPOST('accountid', 'int'); } else { - if ($pay == "cash") { + if ($pay == 'LIQ') { $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility - } elseif ($pay == "card") { - $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility - } elseif ($pay == "cheque") { + } elseif ($pay == "CHQ") { $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility } else { $accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 773118e670f..51744ce0528 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -330,23 +330,20 @@ print ''; + print ''; } else { print ''; } @@ -359,23 +356,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; @@ -389,23 +383,20 @@ print ''; + print ''; } else { $button = array_pop($action_buttons); print ''; diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index fee91e959aa..9acf76b30c2 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -190,7 +190,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project'); if ($user->rights->ticket->write) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { @@ -217,7 +217,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= ''; -$linkback = ''.$langs->trans("BackToList").' '; +$linkback = ''.$langs->trans("BackToList").' '; dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e7a00699733..f91fe4f01b3 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -532,7 +532,7 @@ if (empty($reshook)) { } } - if ($action == 'setsubject') { + if ($action == 'setsubject' && $user->rights->ticket->write) { if ($object->fetch(GETPOST('id', 'int'))) { if ($action == 'setsubject') { $object->subject = GETPOST('subject', 'alphanohtml'); @@ -946,7 +946,7 @@ if ($action == 'create' || $action == 'presend') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; } $morehtmlref .= ' : '; if ($action == 'classify') { @@ -1340,28 +1340,28 @@ if ($action == 'create' || $action == 'presend') { print ''; } if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { - print ''; + print ''; } /* This is useless. We can already modify each field individually if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) { - print ''; + print ''; } */ // Close ticket if statut is read if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { - print ''; + print ''; } // Abadon ticket if statut is read if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { - print ''; + print ''; } // Re-open ticket if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) { - print ''; + print ''; } // Delete ticket diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index ea273064840..874036a5c38 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1344,7 +1344,7 @@ class Ticket extends CommonObject $label .= ''.$langs->trans('TicketTrackId').': '.$this->track_id.'
'; $label .= ''.$langs->trans('Subject').': '.$this->subject; - $url = dol_buildpath('/ticket/card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/ticket/card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 8d450ffb44b..dbd553f9c1f 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -52,7 +52,7 @@ $lineid = GETPOST('lineid', 'int'); // Store current page url -$url_page_current = dol_buildpath('/ticket/contact.php', 1); +$url_page_current = DOL_URL_ROOT.'/ticket/contact.php'; $object = new Ticket($db); @@ -192,7 +192,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index d534e8a1123..8b45b8ebbf7 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -161,7 +161,7 @@ if ($object->id) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->ticket->write) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 4b048d54671..aeab9ac6e27 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -159,7 +159,7 @@ if (!$user->rights->ticket->read) { } // Store current page url -$url_page_current = dol_buildpath('/ticket/list.php', 1); +$url_page_current = DOL_URL_ROOT.'/ticket/list.php'; if ($project_ref) { $tmpproject = new Project($db); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 68615424abf..365376f0add 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -188,7 +188,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project'); if ($user->rights->ticket->write) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ''; $morehtmlref .= ' : '; } if ($action == 'classify') { @@ -215,7 +215,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= ''; -$linkback = ''.$langs->trans("BackToList").' '; +$linkback = ''.$langs->trans("BackToList").' '; dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); @@ -248,7 +248,7 @@ if (!empty($object->id)) { // Show link to add event (if read and not closed) $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php index 17da4cd2db5..51c2cbfb7fd 100644 --- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php @@ -65,7 +65,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8d03d1d1cfb..480ff3a8a74 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1805,7 +1805,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''."\n"; // API key - if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) { print ''; print ''."\n"; @@ -2328,7 +2328,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "\n"; // API key - if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) { print ''; print ''."\n"; print '
'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'.$langs->trans($printer->listprinters[$line]['fk_profile_name']).''.$printer->listprinters[$line]['parameter'].''; + print ''; print img_picto($langs->trans("Edit"), 'edit'); print ''; // delete icon - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinter"), 'printer'); print '
'.$printer->listprinterstemplates[$line]['name'].''.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template']).''; + print ''; print img_picto($langs->trans("Edit"), 'edit'); print ''; // delete icon - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinterTemplate"), 'printer'); print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; } else { @@ -390,7 +390,7 @@ foreach ($dirmodels as $reldir) { print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''."\n"; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; + print ''; if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print '
'.$obj->Check_time.''.$obj->Collation; if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) { - print '
'.$langs->trans("Convert").' UTF8'; + print '
'.$langs->trans("Convert").' UTF8'; } print '
'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1); print $searchpicto; print '
'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo '
'.$langs->trans("LinkedObject").''.dolGetElementUrl($originid, $origin, 1).'
'.$langs->trans("LinkedObject").''; + if ($hasPermissionOnLinkedObject) { + print dolGetElementUrl($originid, $origin, 1); + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + } + print '
'.$objectlink->getLibStatut(3).''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'
'; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo '
'; - print '
'; + print '
'; print ''; print '
'; - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; print '
id.'">'; + print 'id.'">'; print img_edit($langs->trans('SetProject'), 1); print ''; if ($delallowed) { $tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource); - $out .= 'trans("Delete"), 'delete').''; } if ($printer) { //$out.= ''; - $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').''; } if ($morepicto) { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 4c4fd764e57..dd43ae0ffae 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -243,6 +243,65 @@ class FormTicket } } + if ($conf->knowledgemanagement->enabled) { + // KM Articles + print '
'; @@ -698,8 +757,12 @@ class FormTicket } elseif ($htmlname!='') { $groupticket=GETPOST($htmlname, 'aZ09'); $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; - $arraycodenotparent[] = ""; + $arrayidused = array(); + $arrayidusedconcat = array(); + $arraycodenotparent = array(); + $arraycodenotparent[] = ""; + $stringtoprint = ''.$langs->trans("GroupOfTicket").' '; $stringtoprint .= ' '; - $levelid = 1; - while ($levelid <= $use_multilevel) { + $levelid = 1; // The first combobox + while ($levelid <= $use_multilevel) { // Loop to take the child of the combo $tabscript = array(); $stringtoprint .= ''; $stringtoprint .=''; } @@ -732,7 +732,7 @@ if ($id) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); @@ -977,17 +977,17 @@ if ($id) { if ($action != 'edit') { // Reopen if ($object->paye && $user->rights->salaries->write) { - print ""; + print '"; } // Edit if ($object->paye == 0 && $user->rights->salaries->write) { - print ""; + print '"; } // Emit payment if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) { - print ""; + print '"; } // Classify 'paid' diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index e4364f6727f..d33d04c49ff 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -248,7 +248,7 @@ print '
'; if ($action == '') { if ($user->rights->salaries->delete) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index b9b2046fd90..29f8d0b175d 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -391,7 +391,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print '
'; if (!$disabled) { - print ''; + print ''; } print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) { @@ -468,7 +468,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) { print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; //} @@ -576,7 +576,7 @@ foreach ($dirsociete as $dirroot) { print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print " getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
'.$langs->trans("ApiKey").''; if (!empty($object->api_key)) { @@ -1972,7 +1972,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity); print '   '; print ''; - print ''; + print ''; } print '
'.$langs->trans("ApiKey").''; print ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 649b8b55502..2dbc2a3f020 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -663,26 +663,103 @@ class User extends CommonObject * You can use it like this: if ($user->hasRight('module', 'level11')). * It replaces old syntax: if ($user->rights->module->level1) * - * @param int $module Id of permission to add or 0 to add several permissions - * @param string $permlevel1 Permission level1 + * @param int $module Module of permission to check + * @param string $permlevel1 Permission level1 (Example: 'read', 'write', 'delete') * @param string $permlevel2 Permission level2 * @return int 1 if user has permission, 0 if not. * @see clearrights(), delrights(), getrights(), hasRight() */ public function hasRight($module, $permlevel1, $permlevel2 = '') { + global $conf; + + // For compatibility with bad naming permissions on module + $moduletomoduletouse = array( + 'contract' => 'contrat', + 'member' => 'adherent', // We must check $user->rights->adherent... + 'mo' => 'mrp', + 'order' => 'commande', + 'product' => 'produit', // We must check $user->rights->produit... + 'project' => 'projet', + 'shipping' => 'expedition', + 'task' => 'task@projet', + 'fichinter' => 'ficheinter', + 'invoice' => 'facture', + 'invoice_supplier' => 'fournisseur', + 'knowledgerecord' => 'knowledgerecord@knowledgemanagement' + ); + if (!empty($moduletomoduletouse[$module])) { + $module = $moduletomoduletouse[$module]; + } + + // If module is abc@module, we check permission user->rights->module->abc->permlevel1 + $tmp = explode('@', $module, 2); + if (! empty($tmp[1])) { + $module = $tmp[1]; + $permlevel2 = $permlevel1; + $permlevel1 = $tmp[0]; + } + + //var_dump($module); + //var_dump($this->rights->$module); + if (!in_array($module, $conf->modules)) { + return 0; + } + + // For compatibility with bad naming permissions on permlevel1 + if ($permlevel1 == 'propale') { + $permlevel1 = 'propal'; + } + if ($permlevel1 == 'member') { + $permlevel1 = 'adherent'; + } + if ($permlevel1 == 'recruitmentcandidature') { + $permlevel1 = 'recruitmentjobposition'; + } + + //var_dump($module.' '.$permlevel1.' '.$permlevel2); if (empty($module) || empty($this->rights) || empty($this->rights->$module) || empty($permlevel1)) { return 0; } if ($permlevel2) { - if (!empty($this->rights->$module->$permlevel1) && !empty($this->rights->$module->$permlevel1->$permlevel2)) { - return $this->rights->$module->$permlevel1->$permlevel2; + if (!empty($this->rights->$module->$permlevel1)) { + if (!empty($this->rights->$module->$permlevel1->$permlevel2)) { + return $this->rights->$module->$permlevel1->$permlevel2; + } + // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer" + // instead of "read", "write", "delete" + if ($permlevel2 == 'read' && !empty($this->rights->$module->$permlevel1->lire)) { + return $this->rights->$module->lire; + } + if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->creer)) { + return $this->rights->$module->create; + } + if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->create)) { + return $this->rights->$module->create; + } + if ($permlevel2 == 'delete' && !empty($this->rights->$module->$permlevel1->supprimer)) { + return $this->rights->$module->supprimer; + } } } else { if (!empty($this->rights->$module->$permlevel1)) { return $this->rights->$module->$permlevel1; } + // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer" + // instead of "read", "write", "delete" + if ($permlevel1 == 'read' && !empty($this->rights->$module->lire)) { + return $this->rights->$module->lire; + } + if ($permlevel1 == 'write' && !empty($this->rights->$module->creer)) { + return $this->rights->$module->create; + } + if ($permlevel1 == 'write' && !empty($this->rights->$module->create)) { + return $this->rights->$module->create; + } + if ($permlevel1 == 'delete' && !empty($this->rights->$module->supprimer)) { + return $this->rights->$module->supprimer; + } } return 0; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1f20b018f2e..4fb9c51644f 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -96,7 +96,7 @@ if (empty($reshook)) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/user/group/card.php?id='.($id > 0 ? $id : '__ID__'); } } } @@ -380,11 +380,11 @@ if ($action == 'create') { } if ($caneditperms) { - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } if ($candisableperms) { - print ''.$langs->trans("DeleteGroup").''; + print ''.$langs->trans("DeleteGroup").''; } print "\n"; @@ -418,7 +418,7 @@ if ($action == 'create') { print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300'); print '   '; print ''; - print ''; + print ''; print '
'."\n"; print '
'; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index e2c419b0543..46506163c1f 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -332,7 +332,7 @@ if ($object->id > 0) { if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Own permission by group if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ''; @@ -343,7 +343,7 @@ if ($object->id > 0) { } else { // Do not own permission if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 5ff285972df..48cbad46799 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -337,7 +337,7 @@ if ($result > 0) { print $langs->trans("SMS"); } print ''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; $i++; } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 391682b2d6d..7c7fe868b2f 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -279,9 +279,9 @@ print ''.$langs->trans("Module").''; if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { if ($caneditperms) { print ''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print ' / '; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ''; } print ' '; @@ -359,9 +359,9 @@ if ($result) { if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) { if ($caneditperms) { print ''; - print 'module.'&confirm=yes&token='.newToken().'">'.$langs->trans("All").""; + print 'module.'&confirm=yes">'.$langs->trans("All").""; print ' / '; - print 'module.'&confirm=yes&token='.newToken().'">'.$langs->trans("None").""; + print 'module.'&confirm=yes">'.$langs->trans("None").""; print ''; } print ' '; @@ -399,7 +399,7 @@ if ($result) { print ''; } elseif (in_array($obj->id, $permsuser)) { // Permission granted by user if ($caneditperms) { - print 'id.'&confirm=yes&token='.newToken().'">'; + print 'id.'&confirm=yes">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ''; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index c29fc519258..a3ad036ca9a 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -888,7 +888,7 @@ if (!empty($id) || !empty($ref)) { print ''.$prodstatic->getLibStatut(2, 0).''; print ''.$prodstatic->getLibStatut(2, 1).''; print ''; - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; print 'id.'">'.img_delete().''; print ''; print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 5d941d0564b..62b024047e4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3123,7 +3123,7 @@ if (!GETPOST('hide_websitemenu')) { print ''; // end websitetools print ''; - if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { + if ($action == 'editsource' || $action == 'editcontent' || GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { $url = 'https://wiki.dolibarr.org/index.php/Module_Website'; $htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 398affc8cb2..ac035127f14 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -230,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($action != 'classify') { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref.='
'; @@ -344,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'websiteaccount', $socid, 1, '', $MAXEVENT); + $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT); */ print '
'; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 682431d7c8a..a3204e76459 100755 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -154,7 +154,7 @@ if ($object->id > 0) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 0cf0f628492..8bf2dc48e2d 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; + //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; $morehtmlref .= ' : '; if ($action == 'classify') { //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index b33be2818dc..7c5d654a7d9 100755 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -118,7 +118,7 @@ if ($object->id) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -135,7 +135,7 @@ if ($object->id) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index b395c5e5a1b..b5a27aeb1e2 100755 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -345,7 +345,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit 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_buildpath('/workstation/workstation_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/workstation/workstation_card.php?id='.$id); exit; } diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 7e1b765bf82..ebe8d99af16 100755 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -96,7 +96,7 @@ if ($id > 0 || !empty($ref)) { // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index b27959a24c6..5d0155885c2 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -516,7 +516,7 @@ class Hook extends CommonObject $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; - $url = dol_buildpath('/zapier/hook_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/zapier/hook_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not