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/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/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/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 '
'."\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/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..b33bdf00086 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').''; } @@ -2601,7 +2601,7 @@ if ($action == 'create') { $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 dda6eec132c..f6a03c1d11d 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -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 cbf2d8952b6..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); @@ -5319,7 +5319,7 @@ if ($action == 'create') { && ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) { // A paid invoice (partially or completely) if ($object->close_code != 'replaced' || (!$objectidnext)) { // Not replaced by another invoice or replaced but the replacement invoice has been deleted - print ''.$langs->trans('ReOpen').''; + print ''.$langs->trans('ReOpen').''; } else { print ''.$langs->trans('ReOpen').''; } @@ -5328,7 +5328,7 @@ if ($action == 'create') { // Validate if ($object->statut == Facture::STATUS_DRAFT && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (!empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) { if ($usercanvalidate) { - print ''.$langs->trans('Validate').''; + print ''.$langs->trans('Validate').''; } } @@ -5513,7 +5513,7 @@ if ($action == 'create') { } elseif ($objectidnext) { print ''.$langs->trans('Delete').''; } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } else { print ''.$langs->trans('Delete').''; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 2105e197e1f..4381557cd28 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 5196216c57c..c9b6f9a39a8 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 5b9b7fc4316..69322187e59 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -94,7 +94,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index efb0e23a27a..40bb97fa236 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 0d2c3070261..e94fd6f5e1b 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -241,7 +241,7 @@ if ($object->id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 47523447205..bcfece64157 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -93,7 +93,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print $objectlink->getLibStatut(3); } print ''; - print ''; + print ''; print "\n"; } if (count($linkedObjectBlock) > 1) { diff --git a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php index 935f6b03948..7c9683c8b8c 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php @@ -57,7 +57,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> - + '; if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $object->statut == 0 && $_GET['action'] == '') { if ($user->rights->facture->paiement) { - print ''.$langs->trans('Valid').''; + print ''.$langs->trans('Valid').''; } } } @@ -453,7 +453,7 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->socid == 0 && $action == '') { if ($user->rights->facture->paiement) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 0092e731046..61d295a29b0 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -710,11 +710,11 @@ if ($action == 'new') { print '
'; if ($user->socid == 0 && !empty($object->id) && $object->statut == 0 && $user->rights->banque->cheque) { - print ''.$langs->trans('Validate').''; + print ''.$langs->trans('Validate').''; } if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print '
'; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 75ff876ddc7..59aae0a4015 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017-2021 Alexandre Spangaro - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2021 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2020 Tobias Sekan * @@ -31,13 +31,6 @@ */ require '../../main.inc.php'; - -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'facture', $facid, ''); - require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -57,6 +50,10 @@ $facid = GETPOST('facid', 'int'); $socid = GETPOST('socid', 'int'); $userid = GETPOST('userid', 'int'); +// Security check +if ($user->socid) $socid = $user->socid; +$result = restrictedArea($user, 'facture', $facid, ''); + $search_ref = GETPOST("search_ref", "alpha"); $search_date_startday = GETPOST('search_date_startday', 'int'); $search_date_startmonth = GETPOST('search_date_startmonth', 'int'); diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 27a35e83352..b1ec9800aa5 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -251,7 +251,7 @@ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) if ($action == '') { if ($user->rights->tax->charges->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index bfa14009380..94dd817900e 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -307,7 +307,7 @@ if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) if ($action == '') { if ($user->rights->tax->charges->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 8a232377ab7..257e7617531 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -414,7 +414,7 @@ if ($id > 0 || $ref) { print "'; @@ -435,7 +435,7 @@ if ($id > 0 || $ref) { if ($obj->statut == 2) { if ($user->rights->prelevement->bons->credit) { //print ''.$langs->trans("StandingOrderReject").''; - print ''.$langs->trans("StandingOrderReject").''; + print ''.$langs->trans("StandingOrderReject").''; } else { //print ''.$langs->trans("StandingOrderReject").''; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 79a998a3278..f436c47b10e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -497,7 +497,7 @@ if ($id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->tax->charges->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); @@ -752,32 +752,32 @@ if ($id > 0) { // Reopen if ($object->paye && $user->rights->tax->charges->creer) { - print ''; + print ''; } // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { - 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->tax->charges->creer) { - print ""; + print '"; } // Classify 'paid' if ($object->paye == 0 && round($resteapayer) <= 0 && $user->rights->tax->charges->creer) { - print ''; + print ''; } // Clone if ($user->rights->tax->charges->creer) { - print '"; + print '"; } // Delete if ($user->rights->tax->charges->supprimer && empty($totalpaye)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 13ba7d08b34..363af314113 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -738,17 +738,17 @@ if ($id) { if ($action != 'edit') { // Reopen if ($object->paye && $user->rights->tax->charges->creer) { - print ""; + print '"; } // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { - 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->tax->charges->creer) { - print ""; + print ''; } // Classify 'paid' @@ -758,16 +758,16 @@ if ($id) { || (round($resteapayer) >= 0 && $object->amount < 0) ) && $user->rights->tax->charges->creer) { - print ""; + print '"; } // Clone if ($user->rights->tax->charges->creer) { - print ""; + print '"; } if (!empty($user->rights->tax->charges->supprimer) && empty($totalpaye)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index c624eca4026..e458cdf3016 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -139,15 +139,15 @@ if (!empty($this->control->tpl['action_delete'])) { if (empty($user->socid)) { print '
'; if ($user->rights->societe->contact->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } if (!$this->control->tpl['user_id'] && $user->rights->user->user->creer) { - print ''.$langs->trans("CreateDolibarrLogin").''; + print ''.$langs->trans("CreateDolibarrLogin").''; } if ($user->rights->societe->contact->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print '

'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1941d7e31d6..835e7f0cafb 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1371,7 +1371,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $titlealt = $val['label']; } if ($object->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/contact/list.php b/htdocs/contact/list.php index 26624b1bf10..bae32e8b3b1 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1216,7 +1216,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/contrat/agenda.php b/htdocs/contrat/agenda.php index 94232aa6afd..60136fe0dc7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -176,7 +176,7 @@ if ($id > 0) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { if ($action != 'classify') { - //$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + //$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f77b59a1f49..bf9208ccb2b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1318,7 +1318,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->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); @@ -1546,12 +1546,12 @@ if ($action == 'create') { print ''; } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } @@ -2039,7 +2039,7 @@ if ($action == 'create') { } if ($object->statut == 1) { if ($user->rights->contrat->creer) { - print ''; + print ''; } else { print ''; } @@ -2048,7 +2048,7 @@ if ($action == 'create') { if (!empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("orders"); if ($user->rights->commande->creer) { - print ''; + print ''; } else { print ''; } @@ -2103,7 +2103,7 @@ if ($action == 'create') { // - Droit de creer + mode brouillon (erreur creation) // - Droit de supprimer if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 3d0be4d9552..9b016e92b19 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 0d66204f81d..690b5432a1b 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -147,7 +147,7 @@ if ($object->id) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 46a710a754d..50f84a148a4 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -116,7 +116,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 310e2bd00b9..8715a8ce4cc 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo price($totalcontrat); } ?> - + create($user); if ($result > 0) { // Creation OK - if ($conf->categorie->enabled) { - $categories = GETPOST('categories', 'array'); + if ($conf->categorie->enabled && method_exists($object, 'setCategories')) { + $categories = GETPOST('categories', 'array:int'); $object->setCategories($categories); } $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 45076e522a3..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 @@ -7329,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 { @@ -8205,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().''; } } @@ -8234,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.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 .= ''; $html .= ''."\n"; diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 0d824d2c7c0..f290b2b4e90 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -233,7 +233,7 @@ class printing_printipp extends PrintingDriver if ($conf->global->PRINTIPP_URI_DEFAULT == $value) { $html .= img_picto($langs->trans("Default"), 'on'); } else { - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $html .= ''; $html .= ''."\n"; diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index 0e920483508..d44a261a16b 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -87,9 +87,9 @@ class mod_lot_advanced extends ModeleNumRefBatch // Option to enable custom masks per product $texte .= ''; diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index ca24a67c781..5e8fde199c1 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -87,9 +87,9 @@ class mod_sn_advanced extends ModeleNumRefBatch // Option to enable custom masks per product $texte .= ''; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 5374245cea4..0c627322d69 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -208,8 +208,6 @@ class pdf_standard extends ModelePDFStock // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "stocks", "orders", "deliveries")); - $nblines = count($object->lines); - if ($conf->stock->dir_output) { // Definition of $dir and $file if ($object->specimen) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 1257d473ced..078b68d864e 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -303,12 +303,12 @@ foreach ($list as $entry) { if ($permission) { $href = $_SERVER["PHP_SELF"]; - $href .= '?id='.$object->id; + $href .= '?id='.((int) $object->id); $href .= '&action=deletecontact&token='.newToken(); - $href .= '&lineid='.$entry->id; + $href .= '&lineid='.((int) $entry->id); - print ""; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index b50ca83c6f6..ad27dae210c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -164,7 +164,7 @@ if (($line->info_bits & 2) == 2) { // Show date range if ($line->element == 'facturedetrec') { if ($line->date_start_fill || $line->date_end_fill) { - print '

'; + print '
'; } if ($line->date_start_fill) { print ''.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill); @@ -180,7 +180,7 @@ if (($line->info_bits & 2) == 2) { } } else { if ($line->date_start || $line->date_end) { - print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; + print '
'.get_date_range($line->date_start, $line->date_end, $format).'
'; } //print get_date_range($line->date_start, $line->date_end, $format); } diff --git a/htdocs/datapolicy/admin/setupmail.php b/htdocs/datapolicy/admin/setupmail.php index 2ec083b0fa8..535c4383d0d 100644 --- a/htdocs/datapolicy/admin/setupmail.php +++ b/htdocs/datapolicy/admin/setupmail.php @@ -160,7 +160,7 @@ print dol_get_fiche_end(); print '

'; print $langs->trans('SendAgreementText'); -print ''.$langs->trans('SendAgreement').''; +print ''.$langs->trans('SendAgreement').''; llxFooter(); $db->close(); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 7d4a3b181e0..c72718ffce2 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -330,7 +330,7 @@ if ($action == 'create') { // Create. Seems to no be used $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on shipment 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=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1); @@ -651,9 +651,9 @@ if ($action == 'create') { // Create. Seems to no be used if ($user->rights->expedition->delivery->supprimer) { if ($conf->expedition_bon->enabled) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index d8b06285be4..c56effea73a 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -251,12 +251,12 @@ if (is_resource($handle)) { print ''; } else { print "
'; } } else { print ""; } @@ -267,7 +267,7 @@ if (is_resource($handle)) { print ''; } else { print "'; } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 2aa4b971e0f..528a640b391 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') { $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->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); @@ -876,7 +876,7 @@ if (!empty($id) && $action != 'edit') { // Classify 'paid' if ($object->statut == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer) { - print '"; + print '"; } // Delete diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 374306bc7b0..52e33a26cb4 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -132,7 +132,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->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/don/info.php b/htdocs/don/info.php index 8d8f4065dda..431783e873a 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -82,7 +82,7 @@ if (!empty($conf->projet->enabled)) { $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->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/don/note.php b/htdocs/don/note.php index 13f9b1d4a96..9dca36bd1a0 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->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/don/payment/card.php b/htdocs/don/payment/card.php index 40cf0298895..363ef6d34ef 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -213,7 +213,7 @@ print '
'; if (empty($action)) { if ($user->rights->don->supprimer) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3c7af135922..54b1e6b6bb8 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -144,7 +144,6 @@ class EcmDirectory extends CommonObject // Clean parameters $this->label = dol_sanitizeFileName(trim($this->label)); - $this->fk_parent = trim($this->fk_parent); $this->description = trim($this->description); $this->date_c = $now; $this->fk_user_c = $user->id; @@ -155,7 +154,7 @@ class EcmDirectory extends CommonObject // Check if same directory does not exists with this name $relativepath = $this->label; - if ($this->fk_parent) { + if ($this->fk_parent > 0) { $parent = new EcmDirectory($this->db); $parent->fetch($this->fk_parent); $relativepath = $parent->getRelativePath().$relativepath; @@ -194,11 +193,11 @@ class EcmDirectory extends CommonObject $sql .= ") VALUES ("; $sql .= " '".$this->db->escape($this->label)."',"; $sql .= " '".$this->db->escape($conf->entity)."',"; - $sql .= " '".$this->db->escape($this->fk_parent)."',"; + $sql .= " ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").","; $sql .= " '".$this->db->escape($this->description)."',"; $sql .= " ".((int) $this->cachenbofdoc).","; $sql .= " '".$this->db->idate($this->date_c)."',"; - $sql .= " '".$this->db->escape($this->fk_user_c)."'"; + $sql .= " ".($this->fk_user_c > 0 ? ((int) $this->fk_user_c) : "null").","; $sql .= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); @@ -249,20 +248,19 @@ class EcmDirectory extends CommonObject // Clean parameters $this->label = trim($this->label); - $this->fk_parent = trim($this->fk_parent); $this->description = trim($this->description); - - // Check parameters - // Put here code to add control on parameters values + if ($this->fk_parent <= 0) { + $this->fk_parent = 0; + } $this->db->begin(); // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; - $sql .= " label='".$this->db->escape($this->label)."',"; - $sql .= " fk_parent='".$this->db->escape($this->fk_parent)."',"; - $sql .= " description='".$this->db->escape($this->description)."'"; - $sql .= " WHERE rowid=".((int) $this->id); + $sql .= " label = '".$this->db->escape($this->label)."',"; + $sql .= " fk_parent = ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").","; + $sql .= " description = '".$this->db->escape($this->description)."'"; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 74d7cc309b9..737d2134ccc 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -515,7 +515,7 @@ class EmailCollector extends CommonObject $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; - $url = dol_buildpath('/admin/emailcollector_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 1987a5300bd..328f3504497 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -106,8 +106,8 @@ class ConferenceOrBooth extends ActionComm 'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index f4a4933a899..1e76e3544e5 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -103,14 +103,15 @@ class ConferenceOrBoothAttendee extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project'), - 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), + 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'), 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), + 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,), + 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>3,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2), @@ -126,6 +127,7 @@ class ConferenceOrBoothAttendee extends CommonObject public $fk_actioncomm; public $email; public $date_subscription; + public $fk_invoice; public $amount; public $note_public; public $note_private; @@ -634,6 +636,31 @@ class ConferenceOrBoothAttendee extends CommonObject } } + // 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_projet() + { + // phpcs:enable + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + + if (empty($this->fk_project) && !empty($this->fk_projet)) { + $this->fk_project = $this->fk_projet; // For backward compatibility + } + if (empty($this->fk_project)) { + return 0; + } + + $project = new Project($this->db); + $result = $project->fetch($this->fk_project); + + $this->projet = $project; // deprecated + $this->project = $project; + return $result; + } /** * Set draft status @@ -736,7 +763,7 @@ class ConferenceOrBoothAttendee extends CommonObject $label .= '
'.$langs->trans('DateOfRegistration').': '.dol_print_date($this->date_subscription, 'dayhour'); $label .= '
'.$langs->trans('AmountPaid').': '.$this->amount; - $url = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not @@ -836,6 +863,17 @@ class ConferenceOrBoothAttendee extends CommonObject return $result; } + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLabelStatus($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + /** * Return the label of the status * diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index ec3e00c0dde..fafbd0a6f8b 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -152,8 +152,6 @@ if (empty($reshook)) { /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -558,16 +556,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit&token='.newToken().'', '', $permissiontoadd); // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&action=delete&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); } print '
'."\n"; } diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 9fc26503c44..3b135c21dc4 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -358,7 +358,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/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 891fdc1da6e..7defb3dbf3c 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -55,6 +55,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' $id = GETPOST('id', 'int'); $projectid = GETPOST('projectid', 'int'); +$projectref = GETPOST('ref'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -152,12 +153,12 @@ if (!$permissiontoread) accessforbidden(); * Actions */ -if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) { +if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) { $project = new Project($db); //If "set" fields keys is in projects fields $project_attr=preg_replace('/^set/', '', $action); if (array_key_exists($project_attr, $project->fields)) { - $result = $project->fetch($projectid); + $result = $project->fetch($projectid, $projectref); if ($result < 0) { setEventMessages(null, $project->errors, 'errors'); } else { @@ -234,11 +235,13 @@ $now = dol_now(); $help_url = ''; $title = $langs->trans('ListOfConferencesOrBooths'); -if ($projectid > 0) { +if ($projectid > 0 || $projectref) { $project = new Project($db); - $result = $project->fetch($projectid); + $result = $project->fetch($projectid, $projectref); if ($result < 0) { setEventMessages(null, $project->errors, 'errors'); + } else { + $projectid = $project->id; } $result = $project->fetch_thirdparty(); if ($result < 0) { @@ -430,8 +433,8 @@ if ($projectid > 0) { print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage")); //print ''; print ''; - print ''; + print ''; + print ''; + print ''; - // Label - print ''; - print ''; + print '
'; - // Project - if (empty($withproject)) { - print ''; + print dol_get_fiche_end(); - // Third party - print ''; + print '
'; + } + + /* + * Actions + */ + /*print '
'; + + if ($user->rights->projet->all->creer || $user->rights->projet->creer) + { + if ($projectstatic->public || $userWrite > 0) + { + print ''.$langs->trans('AddTask').''; + } + else + { + print ''.$langs->trans('AddTask').''; + } + } + else + { + print ''.$langs->trans('AddTask').''; + } + + print '
'; + */ + + // To verify role of users + //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project + //$arrayofuseridoftask=$object->getListContactId('internal'); + + $head = task_prepare_head($object); + + if ($action == 'edit' && $user->rights->projet->creer) { + print ''; + print ''; + print ''; + print ''; + print ''; + + print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', ''); + + 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 ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; print '
id.'">'; + print 'id.'">'; print img_edit($langs->trans('SetProject'), 1); print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'
getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
"; print $ligne->LibStatut($obj->statut, 2); print " "; - print ''; + print ''; print sprintf("%06s", $obj->rowid); print '
getLibStatut(7); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
'; 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/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9c93b69ee16..357fcc9972f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8230,8 +8230,8 @@ function picto_from_langcode($codelang, $moreatt = '', $notitlealt = 0) * Return default language from country code. * Return null if not found. * - * @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'MX', ... - * @return string Value of locale like 'en_US', 'fr_FR', ... + * @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'IN', 'MX', ... + * @return string Value of locale like 'en_US', 'fr_FR', ... or null if not found */ function getLanguageCodeFromCountryCode($countrycode) { @@ -8281,12 +8281,12 @@ function getLanguageCodeFromCountryCode($countrycode) 'ar-SY', 'ar-TN', 'ar-YE', - 'as-IN', + //'as-IN', // Moved after en-IN 'ba-RU', 'be-BY', 'bg-BG', 'bn-BD', - 'bn-IN', + //'bn-IN', // Moved after en-IN 'bo-CN', 'br-FR', 'ca-ES', @@ -8307,6 +8307,8 @@ function getLanguageCodeFromCountryCode($countrycode) 'en-GB', 'en-IE', 'en-IN', + 'as-IN', // as-IN must be after en-IN (en in priority if country is IN) + 'bn-IN', // bn-IN must be after en-IN (en in priority if country is IN) 'en-JM', 'en-MY', 'en-NZ', @@ -8444,7 +8446,7 @@ function getLanguageCodeFromCountryCode($countrycode) $locale_language = locale_get_primary_language($locale); $locale_region = locale_get_region($locale); if (strtoupper($countrycode) == $locale_region) { - //var_dump($locale.'-'.$locale_language.'-'.$locale_region); + //var_dump($locale.' - '.$locale_language.' - '.$locale_region); return strtolower($locale_language).'_'.strtoupper($locale_region); } } @@ -8884,7 +8886,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) if ($newcrit != '') { $numnewcrit = price2num($newcrit); if (is_numeric($numnewcrit)) { - $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.$db->sanitize($numnewcrit); // should be a numeric + $newres .= ($i2 > 0 ? ' OR ' : '').$field.' '.$operator.' '.((float) $numnewcrit); // should be a numeric } else { $newres .= ($i2 > 0 ? ' OR ' : '').'1 = 2'; // force false } @@ -8943,7 +8945,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); if (preg_match('/\.(id|rowid)$/', $field)) { // Special case for rowid that is sometimes a ref so used as a search field - $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ?trim($tmpcrit) : '0'); + $newres .= $field." = ".(is_numeric(trim($tmpcrit)) ? ((float) trim($tmpcrit)) : '0'); } else { $newres .= $field." LIKE '"; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5ea704881e3..26c56d45463 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2166,6 +2166,9 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $classpath = 'fichinter/class'; $module = 'ficheinter'; $myobject = 'fichinter'; + } elseif ($objecttype == 'project') { + $classpath = 'projet/class'; + $module = 'projet'; } elseif ($objecttype == 'task') { $classpath = 'projet/class'; $module = 'projet'; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 9506984f4f3..ba18e415539 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -101,7 +101,7 @@ function ticket_prepare_head($object) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $upload_dir = $conf->ticket->dir_output."/".$object->ref; $nbFiles = count(dol_dir_list($upload_dir, 'files')); - $head[$h][0] = dol_buildpath('/ticket/document.php', 1).'?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/ticket/document.php?id='.$object->id; $head[$h][1] = $langs->trans("Documents"); if ($nbFiles > 0) { $head[$h][1] .= ''.$nbFiles.''; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 2fadb5d86ae..ef341c83e89 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -142,7 +142,7 @@ class modFacture extends DolibarrModules 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", - 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', + 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last parameter is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 528f45ee962..7f487fdcf94 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_stdandard extends ModelePDFMovement +class pdf_standard extends ModelePDFMovement { /** * @var DoliDb Database handler diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index ec53b523336..226ed6c43cd 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -237,7 +237,7 @@ class printing_printgcp extends PrintingDriver if ($conf->global->PRINTING_GCP_DEFAULT == $printer_det['id']) { $html .= img_picto($langs->trans("Default"), 'on'); } else { - $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $html .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $html .= '
'; if ($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) { - $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $texte .= ' '.$langs->trans('CustomMasks')."\n"; $texte .= ''; if ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) { - $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; + $texte .= ''.img_picto($langs->trans("Enabled"), 'on').''; } else { - $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; + $texte .= ''.img_picto($langs->trans("Disabled"), 'off').''; } $texte .= ' '.$langs->trans('CustomMasks')."\n"; $texte .= '"; - print ""; + print ''; + print ''; print img_picto($langs->trans("Unlink"), "unlink"); print ""; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').''; 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 '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 ''; - $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); + $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id); + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5'); $linksuggest .= '&securekey='.urlencode($encodedsecurekey); //print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global'; - $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5'); + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.((int) $project->id).'&type=global'; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Project").''; - print $projectstatic->getNomUrl(1); - print '
'.$langs->trans("ThirdParty").''; - if ($projectstatic->societe->id) { - print $projectstatic->societe->getNomUrl(1); - } else { - print ' '; - } - print '
'; + + // Ref + print ''; + print ''; + + // Label + print ''; + print ''; + + // Project + if (empty($withproject)) { + print ''; + + // Third party + print ''; + } - // Date start - print ''; + // Task parent + print ''; - // Date end - print ''; + // Date start + print ''; - // Planned workload - print ''; + // Date end + print ''; - // Progress declared - print ''; + // Planned workload + print ''; - // Description - print ''; - print ''; + // Progress declared + print ''; - // Other options - $parameters = array(); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); - } + // Description + print ''; + print ''; - print '
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'.$langs->trans("Project").''; + print $projectstatic->getNomUrl(1); + print '
'.$langs->trans("ThirdParty").''; + if ($projectstatic->societe->id) { + print $projectstatic->societe->getNomUrl(1); + } else { + print ' '; } - - // Task parent - print '
'.$langs->trans("ChildOfProjectTask").''; - print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id); print '
'.$langs->trans("DateStart").''; - print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0); - print '
'.$langs->trans("ChildOfProjectTask").''; + print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id); + print '
'.$langs->trans("Deadline").''; - print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0); - print '
'.$langs->trans("DateStart").''; + print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0); + print '
'.$langs->trans("PlannedWorkload").''; - print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text'); - print '
'.$langs->trans("Deadline").''; + print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0); + print '
'.$langs->trans("ProgressDeclared").''; - print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1); - print '
'.$langs->trans("PlannedWorkload").''; + print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text'); + print '
'.$langs->trans("Description").''; - print ''; - print '
'.$langs->trans("ProgressDeclared").''; + print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1); + print '
'.$langs->trans("Description").''; + print ''; + print '
'; + // Other options + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (empty($reshook)) { + print $object->showOptionals($extrafields, 'edit'); + } - print dol_get_fiche_end(); + print ''; - print $form->buttonsSaveCancel("Modify"); + print dol_get_fiche_end(); - print ''; + print $form->buttonsSaveCancel("Modify"); + + print ''; + } else { + /* + * Fiche tache en mode visu + */ + $param = ($withproject ? '&withproject=1' : ''); + $linkback = $withproject ? ''.$langs->trans("BackToList").'' : ''; + + print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); + + if ($action == 'delete') { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete"); + } + + if (!GETPOST('withproject') || empty($projectstatic->id)) { + $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); + $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")"; } else { - /* - * Fiche tache en mode visu - */ - $param = ($withproject ? '&withproject=1' : ''); - $linkback = $withproject ? ''.$langs->trans("BackToList").'' : ''; - - print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); - - if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete"); - } - - if (!GETPOST('withproject') || empty($projectstatic->id)) { - $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")"; - } else { - $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id); - } - - $morehtmlref = ''; - - // Project - if (empty($withproject)) { - $morehtmlref .= '
'; - $morehtmlref .= $langs->trans("Project").': '; - $morehtmlref .= $projectstatic->getNomUrl(1); - $morehtmlref .= '
'; - - // Third party - $morehtmlref .= $langs->trans("ThirdParty").': '; - if (!empty($projectstatic->thirdparty)) { - $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); - } - $morehtmlref .= '
'; - } - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); - - print '
'; - print '
'; - - print '
'; - print ''; - - // Task parent - print ''; - - // Date start - Date end - print ''; - - // Planned workload - print ''; - - // Description - print ''; - - print '
'.$langs->trans("ChildOfTask").''; - if ($object->fk_task_parent > 0) { - $tasktmp = new Task($db); - $tasktmp->fetch($object->fk_task_parent); - print $tasktmp->getNomUrl(1); - } - print '
'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; - $start = dol_print_date($object->date_start, 'dayhour'); - print ($start ? $start : '?'); - $end = dol_print_date($object->date_end, 'dayhour'); - print ' - '; - print ($end ? $end : '?'); - if ($object->hasDelay()) { - print img_warning("Late"); - } - print '
'.$langs->trans("PlannedWorkload").''; - if ($object->planned_workload != '') { - print convertSecondToTime($object->planned_workload, 'allhourmin'); - } - print '
'.$langs->trans("Description").''; - print nl2br($object->description); - print '
'; - print '
'; - - print '
'; - - print '
'; - print ''; - - // Progress declared - print ''; - - // Progress calculated - print ''; - - // Other attributes - $cols = 3; - $parameters = array('socid'=>$socid); - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
'.$langs->trans("ProgressDeclared").''; - if ($object->progress != '') { - print $object->progress.' %'; - } - print '
'.$langs->trans("ProgressCalculated").''; - if ($object->planned_workload != '') { - $tmparray = $object->getSummaryOfTimeSpent(); - if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) { - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; - } else { - print '0 %'; - } - } else { - print ''.$langs->trans("WorkloadNotDefined").''; - } - print '
'; - - print '
'; - print '
'; - - print '
'; - print '
'; - - print dol_get_fiche_end(); + $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id); } + $morehtmlref = ''; - if ($action != 'edit') { - /* - * Actions - */ + // Project + if (empty($withproject)) { + $morehtmlref .= '
'; + $morehtmlref .= $langs->trans("Project").': '; + $morehtmlref .= $projectstatic->getNomUrl(1); + $morehtmlref .= '
'; - print '
'; + // Third party + $morehtmlref .= $langs->trans("ThirdParty").': '; + if (!empty($projectstatic->thirdparty)) { + $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); + } + $morehtmlref .= '
'; + } - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been - // modified by hook - if (empty($reshook)) { - // Modify - if ($user->rights->projet->creer) { - print ''.$langs->trans('Modify').''; - } else { - print ''.$langs->trans('Modify').''; - } + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); - // Delete - if ($user->rights->projet->supprimer) { - if (!$object->hasChildren() && !$object->hasTimeSpent()) { - print ''.$langs->trans('Delete').''; - } else { - print ''.$langs->trans('Delete').''; - } - } else { - print ''.$langs->trans('Delete').''; - } + print '
'; + print '
'; - print '
'; + print '
'; + print ''; + + // Task parent + print ''; + + // Date start - Date end + print ''; + + // Planned workload + print ''; + + // Description + print ''; + + print '
'.$langs->trans("ChildOfTask").''; + if ($object->fk_task_parent > 0) { + $tasktmp = new Task($db); + $tasktmp->fetch($object->fk_task_parent); + print $tasktmp->getNomUrl(1); + } + print '
'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; + $start = dol_print_date($object->date_start, 'dayhour'); + print ($start ? $start : '?'); + $end = dol_print_date($object->date_end, 'dayhour'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) { + print img_warning("Late"); + } + print '
'.$langs->trans("PlannedWorkload").''; + if ($object->planned_workload != '') { + print convertSecondToTime($object->planned_workload, 'allhourmin'); + } + print '
'.$langs->trans("Description").''; + print nl2br($object->description); + print '
'; + print '
'; + + print '
'; + + print '
'; + print ''; + + // Progress declared + print ''; + + // Progress calculated + print ''; + + // Other attributes + $cols = 3; + $parameters = array('socid'=>$socid); + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
'.$langs->trans("ProgressDeclared").''; + if ($object->progress != '') { + print $object->progress.' %'; + } + print '
'.$langs->trans("ProgressCalculated").''; + if ($object->planned_workload != '') { + $tmparray = $object->getSummaryOfTimeSpent(); + if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) { + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; + } else { + print '0 %'; + } + } else { + print ''.$langs->trans("WorkloadNotDefined").''; + } + print '
'; + + print '
'; + print '
'; + + print '
'; + print '
'; + + print dol_get_fiche_end(); + } + + + if ($action != 'edit') { + /* + * Actions + */ + + print '
'; + + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) { + // Modify + if ($user->rights->projet->creer) { + print ''.$langs->trans('Modify').''; + } else { + print ''.$langs->trans('Modify').''; } - print '
'; - print ''; // ancre + // Delete + if ($user->rights->projet->supprimer) { + if (!$object->hasChildren() && !$object->hasTimeSpent()) { + print ''.$langs->trans('Delete').''; + } else { + print ''.$langs->trans('Delete').''; + } + } else { + print ''.$langs->trans('Delete').''; + } - /* - * Generated documents - */ - $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); - $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); - $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = ($user->rights->projet->lire); - $delallowed = ($user->rights->projet->creer); - - print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf); - - print '
'; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid; - $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject); - - print '
'; + print '
'; } + + print '
'; + print ''; // ancre + + /* + * Generated documents + */ + $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed = ($user->rights->projet->lire); + $delallowed = ($user->rights->projet->creer); + + print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf); + + print '
'; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid; + $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject); + + print '
'; } } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index fa6884ee920..0c5f5dce75b 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -108,6 +108,13 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($projectstatic->table_element); $extrafields->fetch_name_optionals_label($object->table_element); +if ($id > 0 || $ref) { + $object->fetch($id, $ref); +} + +restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); + + /* * Actions @@ -1219,6 +1226,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as inv ON inv.rowid = il.fk_facture,"; $sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; + if (empty($projectidforalltimes)) { $sql .= " AND t.fk_task =".((int) $object->id); } else { @@ -1234,7 +1242,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $sql .= natural_search('pt.label', $search_task_label); } if ($search_user > 0) { - $sql .= natural_search('t.fk_user', $search_user); + $sql .= natural_search('t.fk_user', $search_user, 2); } if ($search_valuebilled == '1') { $sql .= ' AND t.invoice_id > 0'; @@ -1249,6 +1257,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); + + if (! $resql) { + dol_print_error($db); + exit; + } + $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 $page = 0; @@ -1729,12 +1743,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { } print ' '; - print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_edit(); print ''; print ' '; - print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_delete('default', 'class="pictodelete paddingleft"'); print ''; diff --git a/htdocs/public/eventorganization/attendee_register.php b/htdocs/public/eventorganization/attendee_register.php index 0cfdf1dabc0..db3acde4628 100644 --- a/htdocs/public/eventorganization/attendee_register.php +++ b/htdocs/public/eventorganization/attendee_register.php @@ -64,19 +64,21 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; global $dolibarr_main_instance_unique_id; global $dolibarr_main_url_root; // Init vars $errmsg = ''; -$num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); $email = GETPOST("email"); $societe = GETPOST("societe"); +$emailcompany = GETPOST("emailcompany"); +$note_public = GETPOST('note_public', "nohtml"); // Getting id from Post and decoding it $type = GETPOST('type', 'aZ09'); @@ -234,7 +236,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If the price has been set, name is required for the invoice if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."
\n"; } if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; @@ -269,6 +271,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $confattendee->email = $email; $confattendee->fk_project = $project->id; $confattendee->fk_actioncomm = $id; + $confattendee->note_public = $note_public; $resultconfattendee = $confattendee->create($user); if ($resultconfattendee < 0) { $error++; @@ -293,7 +296,9 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen exit; } - $resultfetchthirdparty = -1; + $resultfetchthirdparty = 0; + + $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retreive same thirdparty for another event // Getting the thirdparty or creating it $thirdparty = new Societe($db); @@ -303,45 +308,104 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); } else { if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) { - // Fetch using the input field by user if we just created the attendee - if (!empty($societe)) { - $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email); - if ($resultfetchthirdparty <= 0) { - // Try to find the thirdparty from the contact - $resultfetchcontact = $contact->fetch('', null, '', $email); - if ($resultfetchcontact <= 0 || $contact->fk_soc <= 0) { - // Need to create a new one (not found or multiple with the same name/email) - $resultfetchthirdparty = 0; - } else { - $thirdparty->fetch($contact->fk_soc); - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - $resultfetchthirdparty = 1; - } - } else { - // We found a unique result with that name/email, so we set the fk_soc of attendee + // Fetch using the field input by end user if we have just created the attendee + if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $emailcompany); + if ($resultfetchthirdparty > 0) { + // We found a unique result with the name + emailcompany, so we set the fk_soc of attendee $confattendee->fk_soc = $thirdparty->id; $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); + } + } + // Fetch using the field input by end user if we have just created the attendee + if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email); + if ($resultfetchthirdparty > 0) { + // We found a unique result with the name + email, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); + } + } + if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); + } + } + if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) { + // Try to find thirdparty from the email only + $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that email only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email); + } + } + if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) { + // Try to find thirdparty from the generic mail only + $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name + email, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email); + } + } + + // TODO Add more tests on a VAT number, profid or a name ? + + if ($resultfetchthirdparty <= 0 && !empty($email)) { + // Try to find the thirdparty from the contact + $resultfetchcontact = $contact->fetch('', null, '', $email); + if ($resultfetchcontact > 0 && $contact->fk_soc > 0) { + $thirdparty->fetch($contact->fk_soc); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + $resultfetchthirdparty = 1; + } + } + + if ($resultfetchthirdparty <= 0 && !empty($societe)) { + // Try to find thirdparty from the company name only + $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', ''); + if ($resultfetchthirdparty > 0) { + // We found a unique result with that name only, so we set the fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } elseif ($resultfetchthirdparty == -2) { + $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs"; } - } else { - // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) - $resultfetchthirdparty = 0; } - } else { - // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) - $resultfetchthirdparty = 0; } } + // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party. + if (empty(floatval($project->price_registration))) { + $resultfetchthirdparty = 1; + } + if ($resultfetchthirdparty < 0) { + // If an error was found $error++; $errmsg .= $thirdparty->error; - } elseif ($resultfetchthirdparty == 0) { + } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected // Creation of a new thirdparty if (!empty($societe)) { $thirdparty->name = $societe; } else { - $thirdparty->name = $email; + $thirdparty->name = $genericcompanyname; } $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); @@ -350,7 +414,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $thirdparty->fournisseur = 0; $thirdparty->country_id = GETPOST("country_id", 'int'); $thirdparty->state_id = GETPOST("state_id", 'int'); - $thirdparty->email = $email; + $thirdparty->email = ($emailcompany ? $emailcompany : $email); // Load object modCodeTiers $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); @@ -388,6 +452,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if (!$error) { if (!empty(floatval($project->price_registration))) { $outputlangs = $langs; + // TODO Use default language of $thirdparty->default_lang to build $outputlang // Get product to use for invoice @@ -405,30 +470,41 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $errmsg .= $productforinvoicerow->error; } else { $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $confattendee->cond_reglement_id; - $facture->fk_project = $project->id; + if (empty($confattendee->fk_invoice)) { + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $confattendee->cond_reglement_id; + $facture->fk_project = $project->id; + $facture->status = Facture::STATUS_DRAFT; - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($confattendee->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); if (empty($facture->cond_reglement_id)) { - $error++; - $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; - $confattendee->errors[] = $confattendee->error; + $paymenttermstatic = new PaymentTerm($confattendee->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; + $confattendee->errors[] = $confattendee->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } else { + $confattendee->fk_invoice = $resultfacture; + $confattendee->update($user); } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; } else { - $facture->add_object_linked($confattendee->element, $confattendee->id); + $facture->fetch($confattendee->fk_invoice); } + + // Add link between invoice and the attendee registration + /*if (!$error) { + $facture->add_object_linked($confattendee->element, $confattendee->id); + }*/ } if (!$error) { @@ -610,7 +686,10 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '' . "\n"; // Email - print '' . "\n"; + print '' . "\n"; + // Company print '' . "\n"; + + // Email company for invoice + if ($project->price_registration) { + print '' . "\n"; + } + // Address print '' . "\n"; + print '' . "\n"; + // Zip / Town print ''; + // Country print ''; } + $notetoshow = $note_public; + print ''; + print "
' . $langs->trans("Email") . '*
' . $langs->trans("EmailAttendee") . '*'; + print img_picto('', 'email', 'class="pictofixedwidth"'); + print '
' . $langs->trans("Company"); if (!empty(floatval($project->price_registration))) { @@ -619,15 +698,25 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print ' '; print img_picto('', 'company', 'class="pictofixedwidth"'); print '
' . $langs->trans("EmailCompanyForInvoice") . ''; + print img_picto('', 'email', 'class="pictofixedwidth"'); + print '
' . $langs->trans("Address") . '' . "\n"; - print '
' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ''; print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
' . $langs->trans('Country') . '*'; print img_picto('', 'country', 'class="pictofixedwidth"'); @@ -666,6 +755,14 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO print '
' . $langs->trans('Note') . ''; + if (!empty($conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION)) { + $notetoshow = str_replace('\n', "\n", $conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION); + } + print ''; + print '
\n"; print dol_get_fiche_end(); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d7bf9b3d565..059042399a2 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -115,6 +115,8 @@ if (!$action) { if ($source == 'organizedeventregistration') { // Finding the Attendee + $attendee = new ConferenceOrBoothAttendee($db); + $invoiceid = GETPOST('ref', 'int'); $invoice = new Facture($db); @@ -123,14 +125,28 @@ if ($source == 'organizedeventregistration') { if ($resultinvoice <= 0) { setEventMessages(null, $invoice->errors, "errors"); } else { + /* + $attendeeid = 0; + $invoice->fetchObjectLinked(); $linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee']; if (is_array($linkedAttendees)) { $linkedAttendees = array_values($linkedAttendees); + $attendeeid = $linkedAttendees[0]; + }*/ + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee"; + $sql .= " WHERE fk_invoice = ".((int) $invoiceid); + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + if ($obj) { + $attendeeid = $obj->rowid; + } + } - $attendee = new ConferenceOrBoothAttendee($db); - $resultattendee = $attendee->fetch($linkedAttendees[0]); + if ($attendeeid > 0) { + $resultattendee = $attendee->fetch($attendeeid); if ($resultattendee <= 0) { setEventMessages(null, $attendee->errors, "errors"); @@ -1840,7 +1856,7 @@ if ($source == 'organizedeventregistration') { print ''."\n"; if (! is_object($attendee->project)) { - $text = 'ErrorProjectotFound'; + $text = 'ErrorProjectNotFound'; } else { $text = $langs->trans("PaymentEvent").' - '.$attendee->project->title; } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 20a5239153a..70a684f5932 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1037,7 +1037,7 @@ if ($ispaymentok) { } // TODO send email with acknowledgment for the donation - // (need that the donation module can gen a pdf document for the cerfa with pre filled content) + // (we need first that the donation module is able to generate a pdf document for the cerfa with pre filled content) } elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) { // Record payment for registration to an event for an attendee include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3317288a4e1..fbb9d246431 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1317,7 +1317,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception 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); @@ -1920,10 +1920,10 @@ if ($action == 'create') { } elseif ($object->statut == Reception::STATUS_DRAFT) { // edit-delete buttons print ''; - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; print ''; print ''; - print 'id.'">'.img_delete().''; + print 'id.'">'.img_delete().''; print ''; // Display lines extrafields @@ -1990,9 +1990,9 @@ if ($action == 'create') { // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order) if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) { if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? - print ''.$langs->trans("ClassifyUnbilled").''; + print ''.$langs->trans("ClassifyUnbilled").''; } else { - print ''.$langs->trans("ReOpen").''; + print ''.$langs->trans("ReOpen").''; } } @@ -2026,12 +2026,12 @@ if ($action == 'create') { $label = "ClassifyBilled"; $paramaction = 'classifybilled'; } - print ''.$langs->trans($label).''; + print ''.$langs->trans($label).''; } } if ($user->rights->reception->supprimer) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index ddc28c72896..498b67d1593 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception 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/reception/list.php b/htdocs/reception/list.php index 76eb78b856a..b7f3f577ce2 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -579,43 +579,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.urlencode($limit); } if ($sall) { - $param .= "&sall=".urlencode($sall); + $param .= "&sall=".urlencode($sall); } if ($search_ref_rcp) { - $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); + $param .= "&search_ref_rcp=".urlencode($search_ref_rcp); } if ($search_ref_liv) { - $param .= "&search_ref_liv=".urlencode($search_ref_liv); + $param .= "&search_ref_liv=".urlencode($search_ref_liv); } if ($search_company) { - $param .= "&search_company=".urlencode($search_company); + $param .= "&search_company=".urlencode($search_company); } if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); + $param .= '&optioncss='.urlencode($optioncss); } if ($search_billed != '' && $search_billed >= 0) { - $param .= "&search_billed=".urlencode($search_billed); + $param .= "&search_billed=".urlencode($search_billed); } if ($search_town) { - $param .= "&search_town=".urlencode($search_town); + $param .= "&search_town=".urlencode($search_town); } if ($search_zip) { - $param .= "&search_zip=".urlencode($search_zip); + $param .= "&search_zip=".urlencode($search_zip); } if ($search_state) { - $param .= "&search_state=".urlencode($search_state); + $param .= "&search_state=".urlencode($search_state); } if ($search_status != '') { - $param .= "&search_status=".urlencode($search_status); + $param .= "&search_status=".urlencode($search_status); } if ($search_country) { - $param .= "&search_country=".urlencode($search_country); + $param .= "&search_country=".urlencode($search_country); } if ($search_type_thirdparty) { - $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); + $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty); } if ($search_ref_supplier) { - $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); + $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields foreach ($search_array_options as $key => $val) { @@ -891,7 +891,7 @@ while ($i < min($num, $limit)) { // Ref if (!empty($arrayfields['e.ref']['checked'])) { - print ""; + print ''; print $reception->getNomUrl(1); $filename = dol_sanitizeFileName($reception->ref); $filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref); @@ -904,10 +904,10 @@ while ($i < min($num, $limit)) { } } - // Ref customer + // Ref supplier if (!empty($arrayfields['e.ref_supplier']['checked'])) { - print ""; - print $obj->ref_supplier; + print ''; + print dol_escape_htmltag($obj->ref_supplier); print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -916,7 +916,7 @@ while ($i < min($num, $limit)) { // Third party if (!empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; print $companystatic->getNomUrl(1); print ''; if (!$i) { @@ -925,8 +925,8 @@ while ($i < min($num, $limit)) { } // Town if (!empty($arrayfields['s.town']['checked'])) { - print ''; - print $obj->town; + print ''; + print dol_escape_htmltag($obj->town); print ''; if (!$i) { $totalarray['nbfield']++; @@ -934,8 +934,8 @@ while ($i < min($num, $limit)) { } // Zip if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - print $obj->zip; + print ''; + print dol_escape_htmltag($obj->zip); print ''; if (!$i) { $totalarray['nbfield']++; @@ -943,7 +943,7 @@ while ($i < min($num, $limit)) { } // State if (!empty($arrayfields['state.nom']['checked'])) { - print "".$obj->state_name."\n"; + print "".dol_escape_htmltag($obj->state_name)."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -952,7 +952,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; + print dol_escape_htmltag($tmparray['label']); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index bbf2c80be2f..a75dd432082 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'.$langs->trans('Project').' '; if (0) { // Do not change on reception 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/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 39a5a24347d..41ebc02747f 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -69,7 +69,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { // For now, receptions must stay linked to order, so link is not deletable if ($object->element != 'order_supplier') { ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 6da39445f7f..3f71b0397a1 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -459,13 +459,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 ""; } @@ -475,9 +475,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($conf->global->$constforvar == $name) { //print img_picto($langs->trans("Default"), 'on'); // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset - print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), '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/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php index 2bcddf58964..9c30f0d1ccf 100644 --- a/htdocs/recruitment/admin/setup_candidatures.php +++ b/htdocs/recruitment/admin/setup_candidatures.php @@ -457,13 +457,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 ""; } @@ -473,9 +473,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($conf->global->$constforvar == $name) { //print img_picto($langs->trans("Default"), 'on'); // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset - print 'scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), '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/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php index 192d1d4c526..ce96d1cd67b 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php @@ -36,7 +36,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - public $prefix = 'JOC'; + public $prefix = 'JOA'; /** * @var string Error code (or message) diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 01ac72065ea..79795472b4e 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -186,7 +186,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/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index db51171a04a..4e6390314f5 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $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); @@ -567,7 +567,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; @@ -620,7 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 2e8c29cf2fe..dcd29c88118 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -167,7 +167,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/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 70b5366aec7..d2315b1f756 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -338,7 +338,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('/recruitment/recruitmentcandidature_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id); exit; } diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index 19808ca1b59..ead2df3c973 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -140,7 +140,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/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 253bf2a7e0c..4c3e642a224 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -184,7 +184,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index e5740fb203c..4295ce73284 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -148,14 +148,14 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1); + $backurlforlist = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_list.php'; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id : '__ID__'); } } } @@ -352,7 +352,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; } $morehtmlref .= ' : '; if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index e2a848e9760..89124068ce2 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -379,7 +379,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; } $morehtmlref .= ' : '; if ($action == 'classify') { @@ -466,7 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($object->status == $object::STATUS_DRAFT) { if ($permissiontoadd) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; @@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index 43d80901f3d..14355aeb0e3 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -165,7 +165,7 @@ if ($object->id) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 8f45caed040..0544cdb160f 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -359,7 +359,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('/recruitment/recruitmentjobposition_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.$id); exit; } diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index dc7cdaef4ae..2645980f7bb 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref .= ' : '; } if ($action == 'classify') { diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 88b3d0fdb03..649d69d7fb5 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -347,7 +347,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) { // Delete resource if ($user->rights->resource->delete) { print ''; } } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 7020beced48..a0f80d7b27c 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -974,7 +974,7 @@ class Dolresource extends CommonObject $linkstart = ''; $linkend = ''; - /*$linkstart = ''; + /*$linkstart = ''; $linkend = '';*/ $result .= $linkstart; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 4d0736c5f64..4a51f1dfbb3 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -502,7 +502,7 @@ if (!$ret) { $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/salaries/card.php b/htdocs/salaries/card.php index 699b0ec35ba..e06f55fc523 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -628,12 +628,12 @@ if ($action == 'create') { } } ); - + } else { alert("'.$langs->trans("FillFieldFirst").'"); } }); - + })'; print ''; } @@ -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 ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) { 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 ""; } 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/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 '
'.$langs->trans('Modify').'
'; + print '
'.$langs->trans('Modify').'
'; } // 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 '
global->MAIN_JUMP_TAG) ? '' : '#reopen').'"'; print '>'.$langs->trans('ReOpen').'
'; } @@ -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 '
'.$langs->trans('SendMail').'
'; + print '
'.$langs->trans('SendMail').'
'; } else { print '
'.$langs->trans('SendMail').'
'; } @@ -1889,12 +1889,12 @@ if ($action == 'create') { // Clone if ($usercancreate) { - print '
'.$langs->trans("ToClone").'
'; + print '
'.$langs->trans("ToClone").'
'; } // Delete if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) { - print '
'.$langs->trans('Delete').'
'; } } 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); } ?> getLibStatut(3); ?> - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> 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 '
'.$langs->trans('TicketAddIntervention').'
'; } if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) { - print '
'.$langs->trans('TicketAddIntervention').'
'; + print '
'.$langs->trans('TicketAddIntervention').'
'; } /* This is useless. We can already modify each field individually if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) { - print '
'.$langs->trans('Modify').'
'; + print '
'.$langs->trans('Modify').'
'; } */ // Close ticket if statut is read if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { - print '
'.$langs->trans('CloseTicket').'
'; + print '
'.$langs->trans('CloseTicket').'
'; } // Abadon ticket if statut is read if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { - print '
'.$langs->trans('AbandonTicket').'
'; + print '
'.$langs->trans('AbandonTicket').'
'; } // Re-open ticket if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) { - print '
'.$langs->trans('ReOpen').'
'; + print '
'.$langs->trans('ReOpen').'
'; } // 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/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 186d8463549..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"; 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