From 5ed01f67336769d867de5a900200e6cbcdb5ebb6 Mon Sep 17 00:00:00 2001 From: Givriz Date: Sat, 3 Apr 2021 17:09:14 +0200 Subject: [PATCH 001/177] Fix errors phpv8 --- htdocs/admin/company.php | 2 +- htdocs/admin/delais.php | 2 +- htdocs/admin/mails.php | 36 ++++++++++--------- .../core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/core/lib/admin.lib.php | 4 +-- htdocs/core/modules/modDataPolicy.class.php | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d8af6ac1b4f..15f4a27c8c7 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print (isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') : '').''; print ""; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 4fe21a8460b..71783b2a319 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if ($conf->global->MAIN_DISABLE_METEO != 1) { +if (isset($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 72d16569b25..ac23480bd4d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -48,7 +48,7 @@ $substitutionarrayfortest = array( '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails - '__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && is_object($object->thirdparty)) ? '' : '', '__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', @@ -554,7 +554,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,26 +737,28 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + if (isset($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)) { + if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { + print $langs->trans('RobotEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { + print $langs->trans('UserEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } else { + $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); + if ($id > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + } } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + print ''.(isset($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { print img_warning($langs->trans("ErrorBadEMail")); } @@ -776,7 +778,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).''; + print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.(isset($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) ? yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) : '').''; print ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 7d4a290f0bc..0d2356c00ac 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3088db079e3..6769fa9ccad 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1885,14 +1885,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if ($conf->mailing->enabled) { + if (isset($conf->mailing->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if ($conf->ticket->enabled) { + if (isset($conf->ticket->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 0e2027494e7..05eaf9920bd 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + if (isset($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 1bac38eef29f1688572df63648fe99ab6c9d1b7d Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:24:58 +0200 Subject: [PATCH 002/177] Update company.php --- htdocs/admin/company.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 15f4a27c8c7..138cfdad4e0 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print (isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') : '').''; +print $formother->select_month(isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print ""; print '
'; From ac2cca51c0b41098d8b1d7493a287a8a09038f3d Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:37:17 +0200 Subject: [PATCH 003/177] Update delais.php --- htdocs/admin/delais.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 71783b2a319..b0c1cc5398b 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if (isset($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO != 1) { +if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; From 7a54e5d346de63526518c3f0c331d4e5304f2980 Mon Sep 17 00:00:00 2001 From: Givriz Date: Mon, 12 Apr 2021 16:03:56 +0200 Subject: [PATCH 004/177] Using empty instead of isset I used empty instead of isset, and I fixed some problems of my previous pull request --- htdocs/admin/company.php | 2 +- htdocs/admin/delais.php | 4 +-- htdocs/admin/mails.php | 36 +++++++++---------- .../core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/core/lib/admin.lib.php | 4 +-- htdocs/core/modules/modDataPolicy.class.php | 3 +- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 138cfdad4e0..0c6da346285 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print $formother->select_month(isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print ""; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index b0c1cc5398b..00f05152a86 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { +if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; @@ -302,7 +302,7 @@ if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_MET $str_mode_enabled = $str_mode_percentage; } print ''.$str_mode_enabled.''; - print ''; + print ''; print '

'; } else { diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ac23480bd4d..78b4012a6a2 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -48,7 +48,7 @@ $substitutionarrayfortest = array( '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails - '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '' : '', '__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', @@ -554,7 +554,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,28 +737,26 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if (isset($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)) { - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); - } + if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'robot') { + print $langs->trans('RobotEmail'); + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'user') { + print $langs->trans('UserEmail'); + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'company') { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } else { + $id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : ''); + if ($id > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.(isset($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); + print ''.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { print img_warning($langs->trans("ErrorBadEMail")); } @@ -778,7 +776,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.(isset($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) ? yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) : '').''; + print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn(!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)).''; print ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 0d2356c00ac..3ff31a0df96 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); + $this->hidden = !(!empty($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6769fa9ccad..93d09fa2255 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1885,14 +1885,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if (isset($conf->mailing->enabled)) { + if (!empty($conf->mailing->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if (isset($conf->ticket->enabled)) { + if (!empty($conf->ticket->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 05eaf9920bd..34388540831 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,8 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - if (isset($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + $country = array(); + if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 9abc7a5b0dfc5431c14450cb788c2c057a35849f Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Mon, 12 Apr 2021 16:16:48 +0200 Subject: [PATCH 005/177] Update modDataPolicy.class.php --- htdocs/core/modules/modDataPolicy.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 34388540831..adccd49ba37 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,8 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - $country = array(); - if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", !empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? $conf->global->MAIN_INFO_SOCIETE_COUNTRY : ''); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From bb74a8b1b52f4e4a5f52a0f27a47e4d0876f4a08 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 12 Apr 2021 22:01:46 +0200 Subject: [PATCH 006/177] NEW: Add constant MAIN_BUGTRACK_URL to add possibility to redirect to other service --- htdocs/main.inc.php | 67 +++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a4c54275041..3b60747bd01 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2743,38 +2743,41 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; - $bugbaseurl .= '&title='; - $bugbaseurl .= urlencode("Bug: "); - $bugbaseurl .= '&body='; - $bugbaseurl .= urlencode("# Instructions\n"); - $bugbaseurl .= urlencode("*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*\n"); - $bugbaseurl .= urlencode("*Please:*\n"); - $bugbaseurl .= urlencode("- *replace the bracket enclosed texts with meaningful information*\n"); - $bugbaseurl .= urlencode("- *remove any unused sub-section*\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("# Bug\n"); - $bugbaseurl .= urlencode("[*Short description*]\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("## Environment\n"); - $bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n"); - $bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n"); - $bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n"); - $bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n"); - $bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n"); - $bugbaseurl .= urlencode("- **URL(s)**: ".$_SERVER["REQUEST_URI"]."\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("## Expected and actual behavior\n"); - $bugbaseurl .= urlencode("[*Verbose description*]\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("## Steps to reproduce the behavior\n"); - $bugbaseurl .= urlencode("[*Verbose description*]\n"); - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n"); - $bugbaseurl .= urlencode("[*Files*]\n"); - $bugbaseurl .= urlencode("\n"); - + if (!empty($conf->global->MAIN_BUGTRACK_URL)) { + $bugbaseurl = $conf->global->MAIN_BUGTRACK_URL; + } else { + $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; + $bugbaseurl .= '&title='; + $bugbaseurl .= urlencode("Bug: "); + $bugbaseurl .= '&body='; + $bugbaseurl .= urlencode("# Instructions\n"); + $bugbaseurl .= urlencode("*This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*\n"); + $bugbaseurl .= urlencode("*Please:*\n"); + $bugbaseurl .= urlencode("- *replace the bracket enclosed texts with meaningful information*\n"); + $bugbaseurl .= urlencode("- *remove any unused sub-section*\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("# Bug\n"); + $bugbaseurl .= urlencode("[*Short description*]\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("## Environment\n"); + $bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n"); + $bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n"); + $bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n"); + $bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n"); + $bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n"); + $bugbaseurl .= urlencode("- **URL(s)**: " . $_SERVER["REQUEST_URI"] . "\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("## Expected and actual behavior\n"); + $bugbaseurl .= urlencode("[*Verbose description*]\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("## Steps to reproduce the behavior\n"); + $bugbaseurl .= urlencode("[*Verbose description*]\n"); + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n"); + $bugbaseurl .= urlencode("[*Files*]\n"); + $bugbaseurl .= urlencode("\n"); + } // Execute hook printBugtrackInfo $parameters = array('bugbaseurl'=>$bugbaseurl); From bc78b870208932174df02f485ddb567a4ae3d569 Mon Sep 17 00:00:00 2001 From: Givriz Date: Tue, 13 Apr 2021 16:32:19 +0200 Subject: [PATCH 007/177] pvpv8 continuous integration --- htdocs/admin/mails_senderprofile_list.php | 12 +-- htdocs/admin/mails_templates.php | 102 +++++++++++----------- htdocs/core/tpl/list_print_total.tpl.php | 2 +- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 8f781318995..ae190db715c 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -88,7 +88,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -102,7 +102,7 @@ foreach ($object->fields as $key => $val) { } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { $arrayfields["ef.".$key] = array( @@ -240,7 +240,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } if ($object->ismultientitymanaged == 1) { @@ -497,11 +497,11 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], empty($search[$key]) ? '' : $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print ''; } print ''; } @@ -552,7 +552,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cdb9c10ec87..73ebcc1d4be 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,10 +45,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langsArray=array("errors", "admin", "mails", "languages"); -if ($conf->adherent->enabled) { +if (!empty($conf->adherent->enabled)) { $langsArray[]='members'; } -if ($conf->eventorganization->enabled) { +if (!empty($conf->eventorganization->enabled)) { $langsArray[]='eventorganization'; } @@ -181,55 +181,55 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToUser')); -if ($conf->adherent->enabled && $user->rights->adherent->lire) { +if (!empty($conf->adherent->enabled) && !empty($user->rights->adherent->lire)) { $elementList['member'] = img_picto('', 'object_member', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToMember')); } -if ($conf->recruitment->enabled && $user->rights->recruitment->recruitmentjobposition->read) { +if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="paddingright"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); } -if ($conf->societe->enabled && $user->rights->societe->lire) { +if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { $elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty')); } -if ($conf->projet->enabled) { +if (!empty($conf->projet->enabled)) { $elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject')); } -if ($conf->propal->enabled && $user->rights->propal->lire) { +if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) { $elementList['propal_send'] = img_picto('', 'propal', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendProposal')); } -if ($conf->commande->enabled && $user->rights->commande->lire) { +if (!empty($conf->commande->enabled) && !empty($user->rights->commande->lire)) { $elementList['order_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendOrder')); } -if ($conf->facture->enabled && $user->rights->facture->lire) { +if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { $elementList['facture_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendInvoice')); } -if ($conf->expedition->enabled) { +if (!empty($conf->expedition->enabled)) { $elementList['shipping_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendShipment')); } -if ($conf->reception->enabled) { +if (!empty($conf->reception->enabled)) { $elementList['reception_send'] = img_picto('', 'dolly', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendReception')); } -if ($conf->ficheinter->enabled) { +if (!empty($conf->ficheinter->enabled)) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } -if ($conf->supplier_proposal->enabled) { +if (!empty($conf->supplier_proposal->enabled)) { $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); } -if (($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_order->enabled && $user->rights->supplier_order->lire)) { +if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire))) { $elementList['order_supplier_send'] = img_picto('', 'order', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierOrder')); } -if (($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ($conf->supplier_invoice->enabled && $user->rights->supplier_invoice->lire)) { +if ((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } -if ($conf->contrat->enabled && $user->rights->contrat->lire) { +if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) { $elementList['contract'] = img_picto('', 'contract', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendContract')); } -if ($conf->ticket->enabled && $user->rights->ticket->read) { +if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) { $elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket')); } -if ($conf->agenda->enabled) { +if (!empty($conf->agenda->enabled)) { $elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush')); } -if ($conf->eventorganization->enabled && $user->rights->eventorganization->read) { +if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { $elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } @@ -254,7 +254,7 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { +if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } @@ -1178,98 +1178,98 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $formadmin = new FormAdmin($db); foreach ($fieldlist as $field => $value) { - if ($fieldlist[$field] == 'fk_user') { + if ($value == 'fk_user') { print ''; if ($user->admin) { - print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200'); + print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200'); } else { if ($context == 'add') { // I am not admin and we show the add form print $user->getNomUrl(1); // Me $forcedvalue = $user->id; } else { - if ($obj && !empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0) { + if ($obj && !empty($obj->{$value}) && $obj->{$value} > 0) { $fuser = new User($db); - $fuser->fetch($obj->{$fieldlist[$field]}); + $fuser->fetch($obj->{$value}); print $fuser->getNomUrl(1); $forcedvalue = $fuser->id; } else { - $forcedvalue = $obj->{$fieldlist[$field]}; + $forcedvalue = $obj->{$value}; } } - $keyname = $fieldlist[$field]; + $keyname = $value; print ''; } print ''; - } elseif ($fieldlist[$field] == 'lang') { + } elseif ($value == 'lang') { print ''; if (!empty($conf->global->MAIN_MULTILANGS)) { $selectedlang = GETPOSTISSET('langcode') ?GETPOST('langcode', 'aZ09') : $langs->defaultlang; if ($context == 'edit') { - $selectedlang = $obj->{$fieldlist[$field]}; + $selectedlang = $obj->{$value}; } print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } else { - if (!empty($obj->{$fieldlist[$field]})) { - print $obj->{$fieldlist[$field]}.' - '.$langs->trans('Language_'.$obj->{$fieldlist[$field]}); + if (!empty($obj->{$value})) { + print $obj->{$value}.' - '.$langs->trans('Language_'.$obj->{$value}); } - $keyname = $fieldlist[$field]; + $keyname = $value; if ($keyname == 'lang') { $keyname = 'langcode'; // Avoid conflict with lang param } - print ''; + print ''; } print ''; - } elseif ($fieldlist[$field] == 'type_template') { + } elseif ($value == 'type_template') { // Le type de template print ''; - if ($context == 'edit' && !empty($obj->{$fieldlist[$field]}) && !in_array($obj->{$fieldlist[$field]}, array_keys($elementList))) { + if ($context == 'edit' && !empty($obj->{$value}) && !in_array($obj->{$value}, array_keys($elementList))) { // Current template type is an unknown type, so we must keep it as it is. - print ''; - print $obj->{$fieldlist[$field]}; + print ''; + print $obj->{$value}; } else { - print $form->selectarray('type_template', $elementList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); + print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); } print ''; - } elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) { + } elseif ($context == 'add' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { continue; - } elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) { + } elseif ($context == 'edit' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { continue; - } elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) { + } elseif ($context == 'hide' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { continue; } else { $size = ''; $class = ''; $classtd = ''; - if ($fieldlist[$field] == 'code') { + if ($value == 'code') { $class = 'maxwidth100'; } - if ($fieldlist[$field] == 'label') { + if ($value == 'label') { $class = 'maxwidth200'; } - if ($fieldlist[$field] == 'private') { + if ($value == 'private') { $class = 'maxwidth50'; $classtd = 'center'; } - if ($fieldlist[$field] == 'position') { + if ($value == 'position') { $class = 'maxwidth50'; $classtd = 'center'; } - if ($fieldlist[$field] == 'libelle') { + if ($value == 'libelle') { $class = 'quatrevingtpercent'; } - if ($fieldlist[$field] == 'topic') { + if ($value == 'topic') { $class = 'quatrevingtpercent'; } - if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') { + if ($value == 'sortorder' || $value == 'sens' || $value == 'category_type') { $size = 'size="2" '; } print ''; - if ($fieldlist[$field] == 'private') { + if ($value == 'private') { if (empty($user->admin)) { - print $form->selectyesno($fieldlist[$field], '1', 1); + print $form->selectyesno($value, '1', 1); } else { //print ''; - print $form->selectyesno($fieldlist[$field], (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1); + print $form->selectyesno($value, (isset($obj->{$value}) ? $obj->{$value}:''), 1); } } else { - print ''; + print ''; } print ''; } diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index d7252f891ae..62052b82cec 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -1,6 +1,6 @@ $valtotalizable) { $totalarray['pos'][$valtotalizable['pos']] = $keytotalizable; $totalarray['val'][$keytotalizable] = $valtotalizable['total']; From 75ed5e45f2f1a69ae2dd17059862ab08344fd385 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Tue, 13 Apr 2021 17:21:51 +0200 Subject: [PATCH 008/177] fix date closing option position --- htdocs/compta/facture/list.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ca2a8f6ae44..f427466c560 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1016,11 +1016,6 @@ if ($resql) print ''; print ''; } - if (!empty($arrayfields['f.date_closing']['checked'])) - { - print ''; - print ''; - } if (!empty($arrayfields['total_pa']['checked'])) { print ''; @@ -1061,6 +1056,12 @@ if ($resql) print ''; print ''; } + // Date closing + if (!empty($arrayfields['f.date_closing']['checked'])) + { + print ''; + print ''; + } if (!empty($arrayfields['f.note_public']['checked'])) { // Note public From 22d48c9cb60869aeba878f8c97b3ebd157b33235 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:03:33 +0200 Subject: [PATCH 009/177] Update list.php --- htdocs/comm/propal/list.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d45b17447d5..36b7de65842 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -217,7 +217,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -$permissiontoclose = $user->rights->propal->cloturer; +$permissiontovalidate = $user->rights->propale->propal_advance->validate; +$permissiontoclose = $user->rights->propale->propal_advance->close; @@ -298,7 +299,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } -if ($action == 'validate' && $permissiontoadd) { +if ($action == 'validate' && $permissiontovalidate) { if (GETPOST('confirm') == 'yes') { $tmpproposal = new Propal($db); $db->begin(); @@ -316,9 +317,10 @@ if ($action == 'validate' && $permissiontoadd) { setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors'); $error++; } + }else{ + dol_print_error($db); + $error++; } - dol_print_error($db); - $error++; } if ($error) { $db->rollback(); @@ -815,18 +817,20 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>$langs->trans("ReGeneratePDF"), - 'builddoc'=>$langs->trans("PDFMerge"), - 'presend'=>$langs->trans("SendByMail"), - 'prevalidate'=>$langs->trans("Validate"), + 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"), + 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"), + 'presend'=>img_picto('', 'email').' '.$langs->trans("SendByMail"), ); - if ($user->rights->propal->cloturer) { - $arrayofmassactions['presign']=$langs->trans("Sign"); - $arrayofmassactions['nopresign']=$langs->trans("NoSign"); - $arrayofmassactions['setbilled'] = $langs->trans("ClassifyBilled"); + if ($permissiontovalidate) { + $arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate"); } - if ($user->rights->propal->supprimer) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + if ($permissiontoclose) { + $arrayofmassactions['presign']=img_picto('', 'propal').' '.$langs->trans("Sign"); + $arrayofmassactions['nopresign']=img_picto('', 'propal').' '.$langs->trans("NoSign"); + $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled"); + } + if ($permissiontodelete) { + $arrayofmassactions['predelete'] = ''.img_picto('', 'fa-trash').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'closed'))) { From 29dd2e4b67edba0c6109997de62f91dbc90064db Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:07:29 +0200 Subject: [PATCH 010/177] Update list.php --- htdocs/comm/propal/list.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 36b7de65842..78cb69c9871 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -217,8 +217,14 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -$permissiontovalidate = $user->rights->propale->propal_advance->validate; -$permissiontoclose = $user->rights->propale->propal_advance->close; +if (!empty(MAIN_USE_ADVANCED_PERMS)){ + $permissiontovalidate = $user->rights->propale->propal_advance->validate; + $permissiontoclose = $user->rights->propale->propal_advance->close; +}else{ + $permissiontovalidate = $user->rights->propal->write; + $permissiontoclose = $user->rights->propal->write; +} + From 78b08586e3209a67f29cd8aa3df683f2e59be846 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 13 Apr 2021 22:11:04 +0000 Subject: [PATCH 011/177] Fixing style errors. --- htdocs/comm/propal/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 78cb69c9871..50572c637f7 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -217,10 +217,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -if (!empty(MAIN_USE_ADVANCED_PERMS)){ +if (!empty(MAIN_USE_ADVANCED_PERMS)) { $permissiontovalidate = $user->rights->propale->propal_advance->validate; $permissiontoclose = $user->rights->propale->propal_advance->close; -}else{ +} else { $permissiontovalidate = $user->rights->propal->write; $permissiontoclose = $user->rights->propal->write; } @@ -323,7 +323,7 @@ if ($action == 'validate' && $permissiontovalidate) { setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors'); $error++; } - }else{ + } else { dol_print_error($db); $error++; } From 9e40b8bf4c4a147b049c5840ddd77dc0cdea022d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:27:46 +0200 Subject: [PATCH 012/177] Update list.php --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 78cb69c9871..6c603da2602 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -836,7 +836,7 @@ if ($resql) { $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled"); } if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.img_picto('', 'fa-trash').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.img_picto('', 'fa-trash').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'closed'))) { From 992cf0a091ff567ed68c9d9ba61ff0cdc9bd5fd0 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:29:06 +0200 Subject: [PATCH 013/177] Update list.php --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 9ee4fb8a926..1efc0f998e5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -836,7 +836,7 @@ if ($resql) { $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled"); } if ($permissiontodelete) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.img_picto('', 'fa-trash').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete').' '$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'closed'))) { From c7d0ff94f95bda8a2522f1add6d8258a06b1e422 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 01:03:32 +0200 Subject: [PATCH 014/177] Update list.php --- htdocs/comm/propal/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1efc0f998e5..ff01a55b4ab 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -14,6 +14,7 @@ * Copyright (C) 2017-2018 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From e1557b15ee45e6f3ccb87791d419256a3abdec57 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 01:12:20 +0200 Subject: [PATCH 015/177] Update list.php --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ff01a55b4ab..6720af5a83b 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -14,7 +14,7 @@ * Copyright (C) 2017-2018 Charlene Benke * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Alexandre Spangaro - * Copyright (C) 2021 Anthony Berton + * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 5a68718eb2329b3b9418571bf8b5f63a4fb0bf47 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 02:32:39 +0200 Subject: [PATCH 016/177] Update list.php --- htdocs/comm/propal/list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 6720af5a83b..469489fa88e 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -218,9 +218,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $permissiontoread = $user->rights->propal->lire; $permissiontoadd = $user->rights->propal->write; $permissiontodelete = $user->rights->propal->supprimer; -if (!empty(MAIN_USE_ADVANCED_PERMS)) { +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $permissiontovalidate = $user->rights->propale->propal_advance->validate; $permissiontoclose = $user->rights->propale->propal_advance->close; + $permissiontosendbymail = $user->rights->propale->propal_advance->send; } else { $permissiontovalidate = $user->rights->propal->write; $permissiontoclose = $user->rights->propal->write; @@ -837,7 +838,7 @@ if ($resql) { $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled"); } if ($permissiontodelete) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').' '$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'closed'))) { From 3b2a27de1640b864339496b17eef27b0a012609e Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 02:35:39 +0200 Subject: [PATCH 017/177] Update list.php --- htdocs/comm/propal/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 469489fa88e..03b5730a390 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -827,8 +827,11 @@ if ($resql) { $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"), 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"), - 'presend'=>img_picto('', 'email').' '.$langs->trans("SendByMail"), + ); + if ($permissiontosendbymail) { + $arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail"); + } if ($permissiontovalidate) { $arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate"); } From 26767c15504fb39eb73b16b308ed98655f0db83f Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 14 Apr 2021 00:36:07 +0000 Subject: [PATCH 018/177] Fixing style errors. --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 03b5730a390..3c150e2aec8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -827,7 +827,7 @@ if ($resql) { $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"), 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"), - + ); if ($permissiontosendbymail) { $arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail"); From 7040330914be2ce84b4009c2d03b00d0fd7ef687 Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 14 Apr 2021 10:13:31 +0200 Subject: [PATCH 019/177] project select in edit or create warehouse --- htdocs/product/stock/card.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 7f2f8f58bb5..39c4c525696 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2016 Francis Appels + * Copyright (C) 2021 Noé Cendrier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +36,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (!empty($conf->projet->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +} + // Load translation files required by the page $langs->loadLangs(array('products', 'stocks', 'companies', 'categories')); @@ -238,6 +244,9 @@ $form = new Form($db); $formproduct = new FormProduct($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); +if (!empty($conf->projet->enabled)) { + $formproject = new FormProjets($db); +} $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("", $langs->trans("WarehouseCard"), $help_url); @@ -267,6 +276,15 @@ if ($action == 'create') { print img_picto('', 'stock').$formproduct->selectWarehouses((GETPOSTISSET('fk_parent') ? GETPOST('fk_parent', 'int') : 'ifone'), 'fk_parent', '', 1); print ''; + // Project + if (!empty($conf->projet->enabled)) { + $langs->load('projects'); + print ''.$langs->trans('Project').''; + print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); + print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; + print ''; + } + // Description print ''.$langs->trans("Description").''; // Editeur wysiwyg @@ -382,6 +400,11 @@ if ($action == 'create') { $morehtmlref = '
'; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; $morehtmlref .= '
'; + if ($object->project) { + $morehtmlref .= '
'; + $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; + $morehtmlref .= '
'; + } $shownav = 1; if ($user->socid && !in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { @@ -707,6 +730,15 @@ if ($action == 'create') { print $formproduct->selectWarehouses($object->fk_parent, 'fk_parent', '', 1); print ''; + // Project + if (!empty($conf->projet->enabled)) { + $langs->load('projects'); + print ''.$langs->trans('Project').''; + print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); + print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; + print ''; + } + // Description print ''.$langs->trans("Description").''; // Editeur wysiwyg From 4c8d37ce286c056aa012b8c57fa009eafd04677c Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 14 Apr 2021 13:45:25 +0200 Subject: [PATCH 020/177] warehouse can now be linked to a project with fk_project --- htdocs/product/stock/card.php | 45 ++++++++++++++++--- htdocs/product/stock/class/entrepot.class.php | 14 ++++-- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 39c4c525696..60690cedeeb 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -105,6 +105,7 @@ if (empty($reshook)) { if ($action == 'add' && $user->rights->stock->creer) { $object->ref = (string) GETPOST("ref", "alpha"); $object->fk_parent = (int) GETPOST("fk_parent", "int"); + $object->fk_project = GETPOST('projectid', 'int'); $object->label = (string) GETPOST("libelle", "alpha"); $object->description = (string) GETPOST("desc", "alpha"); $object->statut = GETPOST("statut"); @@ -168,6 +169,7 @@ if (empty($reshook)) { if ($object->fetch($id)) { $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); + $object->fk_project = GETPOST('projectid'); $object->description = GETPOST("desc"); $object->statut = GETPOST("statut"); $object->lieu = GETPOST("lieu"); @@ -221,6 +223,9 @@ if (empty($reshook)) { if ($error) { $action = 'edit_extras'; } + } elseif ($action == 'classin' && $usercancreate) { + // Link to a project + $object->setProject(GETPOST('projectid', 'int')); } if ($cancel == $langs->trans("Cancel")) { @@ -399,12 +404,39 @@ if ($action == 'create') { $morehtmlref = '
'; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; - $morehtmlref .= '
'; - if ($object->project) { - $morehtmlref .= '
'; - $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; - $morehtmlref .= '
'; + + // Project + if (!empty($conf->projet->enabled)) { + $langs->load("projects"); + $morehtmlref .= '
'.img_picto('', 'project').' '.$langs->trans('Project').' '; + if ($usercancreate) { + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + } + if ($action == 'classify') { + $projectid = $object->fk_project; + $morehtmlref .= '
'; + $morehtmlref .= ''; + $morehtmlref .= ''; + $morehtmlref .= $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); + $morehtmlref .= ''; + $morehtmlref .= '
'; + } else { + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= ''; + $morehtmlref .= $proj->ref; + $morehtmlref .= ''; + } else { + $morehtmlref .= ''; + } + } } + $morehtmlref .= ''; $shownav = 1; if ($user->socid && !in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) { @@ -511,7 +543,7 @@ if ($action == 'create') { $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - if (empty($action)) { + if (empty($action) || $action == 'classin') { if ($user->rights->stock->creer) { print ''.$langs->trans("Modify").''; } else { @@ -732,6 +764,7 @@ if ($action == 'create') { // Project if (!empty($conf->projet->enabled)) { + $projectid = $object->fk_project; $langs->load('projects'); print ''.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 214a12ead14..2f3131feba9 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -108,6 +108,11 @@ class Entrepot extends CommonObject */ public $fk_parent; + /** + * @var int ID of project + */ + public $fk_project; + /** * @var array List of short language codes for status */ @@ -124,6 +129,7 @@ class Entrepot extends CommonObject 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>1, 'searchall'=>1), 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), + 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), 'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1), 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1), @@ -198,8 +204,8 @@ class Entrepot extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)"; - $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent, fk_project)"; + $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").", ".($this->fk_project > 0 ? $this->fk_project : "NULL").")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); @@ -290,6 +296,7 @@ class Entrepot extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); + $sql .= ", fk_project = ".(($this->fk_project > 0) ? $this->fk_project : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", statut = ".$this->statut; $sql .= ", lieu = '".$this->db->escape($this->lieu)."'"; @@ -432,7 +439,7 @@ class Entrepot extends CommonObject return -1; } - $sql = "SELECT rowid, entity, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id, phone, fax,"; + $sql = "SELECT rowid, entity, fk_parent, fk_project, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id, phone, fax,"; $sql .= " model_pdf, import_key"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -452,6 +459,7 @@ class Entrepot extends CommonObject $this->id = $obj->rowid; $this->entity = $obj->entity; $this->fk_parent = $obj->fk_parent; + $this->fk_project = $obj->fk_project; $this->ref = $obj->label; $this->label = $obj->label; $this->libelle = $obj->label; // deprecated From a612831e28dde6a823fd6daf13c26cb3f0c3eb4d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 14:45:55 +0200 Subject: [PATCH 021/177] next_change --- htdocs/accountancy/customer/list.php | 8 ++++---- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/supplier/list.php | 8 ++++---- htdocs/adherents/list.php | 4 ++-- htdocs/adherents/subscription/list.php | 6 +++--- htdocs/admin/emailcollector_list.php | 6 +++--- htdocs/admin/mails_senderprofile_list.php | 6 +++--- htdocs/asset/list.php | 6 +++--- htdocs/bom/bom_list.php | 2 +- htdocs/bookmarks/list.php | 10 +++++----- htdocs/compta/bank/bankentries_list.php | 6 +++--- htdocs/compta/bank/list.php | 4 ++-- htdocs/compta/cashcontrol/cashcontrol_list.php | 6 +++--- htdocs/contact/list.php | 4 ++-- htdocs/contrat/services_list.php | 6 +++--- htdocs/cron/list.php | 10 +++++----- htdocs/eventorganization/conferenceorbooth_list.php | 8 ++++---- htdocs/fourn/facture/list.php | 10 +++++----- htdocs/fourn/product/list.php | 8 ++++---- htdocs/holiday/list.php | 8 ++++---- htdocs/partnership/partnership_list.php | 4 ++-- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_list.php | 6 +++--- htdocs/product/stock/productlot_list.php | 10 +++++----- htdocs/projet/list.php | 4 ++-- htdocs/salaries/list.php | 2 +- htdocs/societe/list.php | 6 +++--- htdocs/supplier_proposal/list.php | 4 ++-- htdocs/user/list.php | 2 +- 29 files changed, 84 insertions(+), 84 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index de160fe2b93..f52dfc6d589 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -400,11 +400,11 @@ if ($result) { } $arrayofmassactions = array( - 'ventil'=>$langs->trans("Ventilate") - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + 'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); - //if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); + //if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); //if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 98decf4d27a..4d2d5f7b88a 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -298,7 +298,7 @@ if ($result) { } $arrayofmassactions = array( - 'ventil' => $langs->trans("Ventilate") + 'ventil' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") ); $massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 1dcd17ea074..414cd624bee 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -407,11 +407,11 @@ if ($result) { } $arrayofmassactions = array( - 'ventil'=>$langs->trans("Ventilate") - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + 'ventil'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Ventilate") + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); - //if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); + //if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); //if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 50fd5a78c93..9560a284e2a 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -543,8 +543,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), - //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').' '.$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); if ($user->rights->adherent->creer) { $arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate"); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 6b76fc3d502..7322f92fccd 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -287,10 +287,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +//if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 09a790a9f68..2c6739e96dd 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -356,11 +356,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 8f781318995..7da20aa36c7 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -354,10 +354,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); //if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index e0beefd688f..1e906677e7d 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -346,11 +346,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 16172d8f037..ed1a0c3ab42 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -421,7 +421,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), 'enable'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Enable"), 'disable'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Disable"), ); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index e4405f0aea6..d94b5cbdd88 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -143,13 +143,13 @@ $moreforfilter = ''; // List of mass actions available $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 965e0f6c94b..f6b719515cc 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -736,10 +736,10 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); - //if ($user->rights->bank->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); + //if ($user->rights->bank->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 84c91384038..8c05ada67fb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -290,8 +290,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( -// 'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), -// 'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), +// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); if ($user->rights->banque->supprimer) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 79ac1e1b708..34264649ead 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -379,10 +379,10 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( -//'presend'=>$langs->trans("SendByMail"), -//'builddoc'=>$langs->trans("PDFMerge"), +//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 27e6343cbf4..b02856ceb3b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -653,8 +653,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( -// 'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), -// 'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), +// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->societe->supprimer) { diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 0d295357c09..245216d84d3 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -432,10 +432,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); +//if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); //if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 712b2ceb163..a88bcda9a66 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -359,13 +359,13 @@ if ($action == 'execute') { // List of mass actions available $arrayofmassactions = array( -//'presend'=>$langs->trans("SendByMail"), -//'builddoc'=>$langs->trans("PDFMerge"), - 'enable'=>$langs->trans("CronStatusActiveBtn"), - 'disable'=>$langs->trans("CronStatusInactiveBtn"), +//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'enable'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("CronStatusActiveBtn"), + 'disable'=>img_picto('', 'title_close', 'class="pictofixedwidth"').$langs->trans("CronStatusInactiveBtn"), ); if ($user->rights->cron->delete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 5bc3bee5d3c..c2bccfaa517 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -573,10 +573,10 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( - //'validate'=>img_picto('', 'check').$langs->trans("Validate"), - //'generate_doc'=>img_picto('', 'pdf').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e30e1798a52..4fd45d6cff0 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -852,10 +852,10 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - 'validate'=>$langs->trans("Validate"), - 'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($conf->paymentbybanktransfer->enabled) { $langs->load("withdrawals"); @@ -867,7 +867,7 @@ if ($resql) { $arrayofmassactions['banktransfertrequest'] = $langs->trans("MakeBankTransferOrder"); } if ($user->rights->fournisseur->facture->supprimer) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { $arrayofmassactions = array(); diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 32ddf769ce2..f411d70af25 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -131,12 +131,12 @@ if ($fourn_id) { $arrayofmassactions = array( - 'generate_doc'=>$langs->trans("ReGeneratePDF"), - 'builddoc'=>$langs->trans("PDFMerge"), - 'presend'=>$langs->trans("SendByMail"), + 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->rights->mymodule->supprimer) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f49a3145af9..b00abadb9c3 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -434,12 +434,12 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if (!empty($user->rights->holiday->delete)) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 2d7ffacf452..0e0ee3da9c3 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -432,8 +432,8 @@ $param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( 'cancel'=>img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"), - //'generate_doc'=>img_picto('', 'pdf').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index e408d37d527..d49db2f7b02 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -359,7 +359,7 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=img_picto('', 'delete').$langs->trans("Delete"); +//if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 50982e0e084..4a9a0bb9613 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -808,12 +808,12 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - // 'presend'=>$langs->trans("SendByMail"), - // 'builddoc'=>$langs->trans("PDFMerge"), + // 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); // By default, we should never accept deletion of stock movement. if (!empty($conf->global->STOCK_ALLOW_DELETE_OF_MOVEMENT) && $permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index e467aa80d95..00c8c186c66 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -346,13 +346,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( - //'validate'=>$langs->trans("Validate"), - //'generate_doc'=>$langs->trans("ReGeneratePDF"), - //'builddoc'=>$langs->trans("PDFMerge"), - //'presend'=>$langs->trans("SendByMail"), + //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 4d3de0494c8..a0888daee2a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -612,8 +612,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // List of mass actions available $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->projet->creer) { diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index d11d4584ad0..b35b890b994 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -367,7 +367,7 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'buildsepa'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("BuildSepa"), // TODO ); -//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7c2cfb63c64..9c5d261f996 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -848,14 +848,14 @@ if (GETPOST('delsoc')) { // List of mass actions available $arrayofmassactions = array( 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), -// 'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), +// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); if ($user->rights->societe->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if ($user->rights->societe->creer) { - $arrayofmassactions['preaffecttag'] = img_picto('', 'category').$langs->trans("AffectTag"); + $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { $arrayofmassactions = array(); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 4dee1705476..2c7ba7694dd 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -510,10 +510,10 @@ if ($resql) { $arrayofmassactions = array( 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), + //'presend'=>img_picto('', 'email',, 'class="pictofixedwidth"').' '.$langs->trans("SendByMail"), ); if ($user->rights->supplier_proposal->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').' '.$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c18b13a5bf8..1eecf26664c 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -533,7 +533,7 @@ if ($permissiontoadd) { if ($permissiontoadd) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } -//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').' '.$langs->trans("Delete"); if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { $arrayofmassactions = array(); From 32d401bed4d194b47ce49f04d0f68579fd76f64a Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 15:26:18 +0200 Subject: [PATCH 022/177] Update mails.php --- htdocs/admin/mails.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 78b4012a6a2..0252f149d10 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -737,11 +737,11 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'robot') { + if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { print $langs->trans('RobotEmail'); - } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'user') { + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { print $langs->trans('UserEmail'); - } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'company') { + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); } else { $id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : ''); From 9b668959458171d1de5493c0a8be81edc9eb050f Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 16:06:53 +0200 Subject: [PATCH 023/177] Update mails_templates.php --- htdocs/admin/mails_templates.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 73ebcc1d4be..86f1cc00063 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -55,6 +55,7 @@ if (!empty($conf->eventorganization->enabled)) { $langs->loadLangs($langsArray); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; +$massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $id = GETPOST('id', 'int'); @@ -254,7 +255,7 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') { +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } From 658e1de45d672e508474991a04c4ec05975b520f Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Wed, 14 Apr 2021 16:08:28 +0200 Subject: [PATCH 024/177] stickler adjust --- htdocs/product/stock/card.php | 4 ++-- htdocs/product/stock/class/entrepot.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 60690cedeeb..f7e833ea234 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -289,7 +289,7 @@ if ($action == 'create') { print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } - + // Description print ''.$langs->trans("Description").''; // Editeur wysiwyg @@ -771,7 +771,7 @@ if ($action == 'create') { print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } - + // Description print ''.$langs->trans("Description").''; // Editeur wysiwyg diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 2f3131feba9..8bd250bc76e 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -108,7 +108,7 @@ class Entrepot extends CommonObject */ public $fk_parent; - /** + /** * @var int ID of project */ public $fk_project; From 598156de0459b02266dd2f3de8897793cb544c79 Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 17:58:46 +0200 Subject: [PATCH 025/177] Update modDataPolicy.class.php There was useless condition --- htdocs/core/modules/modDataPolicy.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index adccd49ba37..047ff2b5a8d 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", !empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? $conf->global->MAIN_INFO_SOCIETE_COUNTRY : ''); + $country = explode(":", empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? '' : $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 8bfb69cdba10d8b9bd4b04fd3c3d03d3441b245f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Apr 2021 18:56:31 +0200 Subject: [PATCH 026/177] Fix security check --- htdocs/admin/system/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 6291486f54d..87b0d469893 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -156,7 +156,7 @@ print '
'; print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', 'folder'); print ''.$langs->trans("PermissionsOnFilesInWebRoot").': '; -$arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('custom\/'), 'name', SORT_ASC, 4, 1, '', 1); +$arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/custom'), 'name', SORT_ASC, 4, 1, '', 1); $fileswithwritepermission = array(); foreach ($arrayoffilesinroot as $fileinroot) { // Test permission on file From 59f1270264bc361bbac844166e91e42eaf4b509b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Apr 2021 19:12:25 +0200 Subject: [PATCH 027/177] Trans --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d52bfb0a6ee..7b0433d2410 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2119,3 +2119,4 @@ MailToSendEventOrganization=Event Organization AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form YouShouldDisablePHPFunctions=You should disable PHP functions IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions +NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) \ No newline at end of file From 195d3b578b7ad64f688b6007f0d6da49f269fb37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Apr 2021 20:44:34 +0200 Subject: [PATCH 028/177] Fix phpcs --- htdocs/admin/system/security.php | 8 ++++---- htdocs/langs/en_US/admin.lang | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 87b0d469893..c9a652cd4e4 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -67,10 +67,10 @@ print "
\n"; print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; print '
'; -print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."
\n"; -print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."
\n"; -print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0))."
\n"; -print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0))."
\n"; +print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
\n"; +print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath")).')')."
\n"; +print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
\n"; +print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
\n"; print "PHP disable_functions = "; $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 7b0433d2410..b103d0082ba 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2119,4 +2119,6 @@ MailToSendEventOrganization=Event Organization AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form YouShouldDisablePHPFunctions=You should disable PHP functions IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions -NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) \ No newline at end of file +NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) +RecommendedValueIs=Recommended: %s +ARestrictedPath=A restricted path \ No newline at end of file From 377c73036381d27b3197a0c5615724fe37d59397 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Wed, 14 Apr 2021 21:27:53 +0200 Subject: [PATCH 029/177] add missing group by hook in fichinter list --- htdocs/fichinter/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d054f5e5bcc..b142613f051 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -259,6 +259,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add GroupBy from hooks +$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); // Count total nb of records From 47cdfee1d2a1f44fba89714eb099d8a88fabdb08 Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 22:03:04 +0200 Subject: [PATCH 030/177] Compatibility pvpv8 --- htdocs/admin/dict.php | 8 ++++---- htdocs/admin/sms.php | 10 +++++----- htdocs/core/lib/admin.lib.php | 4 ++-- htdocs/core/modules/modPartnership.class.php | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9061fd150b7..6fc03a62189 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -606,7 +606,7 @@ complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqls // Defaut sortorder if (empty($sortfield)) { - $tmp1 = explode(',', $tabsqlsort[$id]); + $tmp1 = explode(',', empty($tabsqlsort[$id]) ? '' : $tabsqlsort[$id]); $tmp2 = explode(' ', $tmp1[0]); $sortfield = preg_replace('/^.*\./', '', $tmp2[0]); } @@ -1778,7 +1778,7 @@ if ($id) { while ($i < $num) { $obj = $db->fetch_object($resql); //print_r($obj); - print ''; + print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -2024,7 +2024,7 @@ if ($id) { if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable = 0; } - if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { + if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { $canbedisabled = 0; $canbedisabled = 0; } $canbemodified = $iserasable; @@ -2042,7 +2042,7 @@ if ($id) { if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { $rowidcol = 'rowid'; } - $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol}:(!empty($obj->code) ?urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); + $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); if (!empty($param)) { $url .= '&'.$param; } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index f84425eda4d..080f06c6fa3 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -172,7 +172,7 @@ if ($action == 'edit') { // Disable print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''; - print $form->selectyesno('MAIN_DISABLE_ALL_SMS', $conf->global->MAIN_DISABLE_ALL_SMS, 1); + print $form->selectyesno('MAIN_DISABLE_ALL_SMS', empty($conf->global->MAIN_DISABLE_ALL_SMS) ? '' : $conf->global->MAIN_DISABLE_ALL_SMS, 1); print ''; // Separator @@ -189,7 +189,7 @@ if ($action == 'edit') { // From print ''.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).''; - print ''; // Autocopy to @@ -213,14 +213,14 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn($conf->global->MAIN_DISABLE_ALL_SMS).''; + print ''.$langs->trans("MAIN_DISABLE_ALL_SMS").''.yn(empty($conf->global->MAIN_DISABLE_ALL_SMS) ? '' : $conf->global->MAIN_DISABLE_ALL_SMS).''; // Separator print ' '; // Method print ''.$langs->trans("MAIN_SMS_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE]; + $text = empty($conf->global->MAIN_SMS_SENDMODE) ? '' : $listofmethods[$conf->global->MAIN_SMS_SENDMODE]; if (empty($text)) { $text = $langs->trans("Undefined").' '.img_warning(); } @@ -229,7 +229,7 @@ if ($action == 'edit') { // From print ''.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).''; - print ''.$conf->global->MAIN_MAIL_SMS_FROM; + print ''.(empty($conf->global->MAIN_MAIL_SMS_FROM) ? '' : $conf->global->MAIN_MAIL_SMS_FROM); if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) { print ' '.img_warning($langs->trans("ErrorBadPhone")); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index ed01d9d6e9f..779d8b10912 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1228,10 +1228,10 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && !$conf->global->$const_name) { + if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && !$conf->global->$const_name) { + if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) { $modulequalified = 0; } //If module is not activated disqualified diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index 442e01b56f6..289300f5f29 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -177,7 +177,7 @@ class modPartnership extends DolibarrModules // Array to add new pages in new tabs $this->tabs = array(); - $tabtoadd = ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') ? 'member' : 'thirdparty'; + $tabtoadd = (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') ? 'member' : 'thirdparty'; if ($tabtoadd == 'member') { $this->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/partnership/partnership.php?socid=__ID__'); From d4420bbfd9e9be374eb6bda9078c67abfcb39282 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Apr 2021 22:31:44 +0200 Subject: [PATCH 031/177] Look and feel v14 --- htdocs/admin/dav.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 32b91ed7cea..e7983ae4b95 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -169,17 +169,32 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai // Show message $message = ''; $url = ''.$urlwithroot.'/dav/fileserver.php'; -$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', '{url}')); + +$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', '')); +$message .= ''; +$message .= ajax_autoselect('webdavpublicurl'); + $message .= '
'; if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) { $urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : ''); $url = ''.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.''; - $message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '{url}')); + + $message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', '')); + $message .= ''; + $message .= ajax_autoselect('webdavurl'); $message .= '
'; } print $message; -print '


'; +print '
'; require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php'; $version = Sabre\DAV\Version::VERSION; From e7d64d073a48f1da62316ffa85d9b28519d8994a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 14 Apr 2021 23:14:38 +0200 Subject: [PATCH 032/177] Look and feel v14 --- htdocs/compta/tva/card.php | 26 +++++++++++++++----------- htdocs/salaries/card.php | 14 ++++++++++---- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index da07472719b..91cf572b9c6 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -415,11 +415,6 @@ if ($action == 'create') { print ''; - print ''; - print ''; - print ''; @@ -435,6 +430,17 @@ if ($action == 'create') { // Amount print ''; + print ''; + + // Auto create payment + print ''; + print ''."\n"; + + print ''; + print ''; + // Type payment print ''; } - // Auto create payment - print ''; - print ''."\n"; - // Number print ''; @@ -500,7 +500,7 @@ if ($action == 'create') { // Type payment print ''; @@ -526,10 +526,10 @@ if ($action == 'create') { } // Bouton Save payment - print ''; - +*/ // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -543,6 +543,12 @@ if ($action == 'create') { print dol_get_fiche_end(); print '
'; + + print '
'; + print ''.$langs->trans("ClosePaidSalaryAutomatically"); + print '
'; + print '
'; + print ''; print '     '; print ''; From 140f098c79263e505f28f084799ce7a2e5c721c2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 14 Apr 2021 23:16:30 +0200 Subject: [PATCH 033/177] NEW: Add constant MAIN_BUGTRACK_URL to add possibility to redirect to other service --- htdocs/admin/ihm.php | 6 +++--- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 4 +++- htdocs/langs/en_US/admin.lang | 2 +- htdocs/main.inc.php | 15 +++++++++------ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 8b799c9c7de..8c504426195 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -211,11 +211,12 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity); - //dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities $varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/'; @@ -401,8 +402,7 @@ print ''; // Show bugtrack link print '
'; print ''; print ''; diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index 3f17d23b51f..df64b9915bf 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -423,4 +423,6 @@ ALTER TABLE llx_facture_fourn ADD COLUMN date_closing datetime DEFAULT NULL afte ALTER TABLE llx_facture_fourn ADD COLUMN fk_user_closing integer DEFAULT NULL after fk_user_valid; -ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any \ No newline at end of file +ALTER TABLE llx_entrepot ADD COLUMN fk_project INTEGER DEFAULT NULL AFTER entity; -- project associated to warehouse if any + +UPDATE llx_const SET value = 'github' WHERE __DECRYPT('name')__ = 'MAIN_BUGTRACK_ENABLELINK' AND __DECRYPT('value')__ = 1; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d52bfb0a6ee..6862a8b0384 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1159,7 +1159,7 @@ DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s BankModuleNotActive=Bank accounts module not enabled -ShowBugTrackLink=Show link "%s" +ShowBugTrackLink=Define link "%s (empty to not display the link / 'github' for the link to the Dolibarr project) Alerts=Alerts DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3032fc33170..0e13a072a39 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2743,9 +2743,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if (!empty($conf->global->MAIN_BUGTRACK_URL)) { - $bugbaseurl = $conf->global->MAIN_BUGTRACK_URL; - } else { + if ($conf->global->MAIN_BUGTRACK_ENABLELINK == 'github') { $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new?labels=Bug'; $bugbaseurl .= '&title='; $bugbaseurl .= urlencode("Bug: "); @@ -2777,10 +2775,17 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ $bugbaseurl .= urlencode("## [Attached files](https://help.github.com/articles/issue-attachments) (Screenshots, screencasts, dolibarr.log, debugging informations…)\n"); $bugbaseurl .= urlencode("[*Files*]\n"); $bugbaseurl .= urlencode("\n"); + + $bugbaseurl .= urlencode("\n"); + $bugbaseurl .= urlencode("## Report\n"); + } elseif (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { + $bugbaseurl = $conf->global->MAIN_BUGTRACK_ENABLELINK; + } else { + $bugbaseurl = ""; } // Execute hook printBugtrackInfo - $parameters = array('bugbaseurl'=>$bugbaseurl); + $parameters = array('bugbaseurl' => $bugbaseurl); $reshook = $hookmanager->executeHooks('printBugtrackInfo', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { $bugbaseurl .= $hookmanager->resPrint; @@ -2788,8 +2793,6 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ $bugbaseurl = $hookmanager->resPrint; } - $bugbaseurl .= urlencode("\n"); - $bugbaseurl .= urlencode("## Report\n"); print '
'; print ''.$langs->trans("FindBug").''; print '
'; From 957968eea2df7a92d01996d07c4e3a54b8fbfc45 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 14 Apr 2021 23:17:26 +0200 Subject: [PATCH 034/177] typo --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6862a8b0384..252067ee538 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1159,7 +1159,7 @@ DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s BankModuleNotActive=Bank accounts module not enabled -ShowBugTrackLink=Define link "%s (empty to not display the link / 'github' for the link to the Dolibarr project) +ShowBugTrackLink=Define link "%s" (empty to not display the link / 'github' for the link to the Dolibarr project) Alerts=Alerts DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. From b2a1b0673682e4f752992840fc477aadd1d02b8c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 14 Apr 2021 23:19:10 +0200 Subject: [PATCH 035/177] text --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 252067ee538..553a011514c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1159,7 +1159,7 @@ DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s BankModuleNotActive=Bank accounts module not enabled -ShowBugTrackLink=Define link "%s" (empty to not display the link / 'github' for the link to the Dolibarr project) +ShowBugTrackLink=Define link "%s" (empty to not display the link, 'github' for the link to the Dolibarr project of define an url) Alerts=Alerts DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. From 662caadd1801a5ecd0b73f934233b094e135e230 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 14 Apr 2021 23:32:08 +0200 Subject: [PATCH 036/177] Add DOL_PRINT_OBJECT_LINES_WITH_NOTES tag in TakePOS --- htdocs/core/class/dolreceiptprinter.class.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 6ac331167d3..6933cf2c597 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -50,6 +50,7 @@ * {dol_print_object_local_tax} Print object local tax * {dol_print_object_total} Print object total * {dol_print_order_lines} Print order lines for Printer + * {dol_print_object_lines_with_notes} Print object lines with notes * {dol_print_payment} Print payment method * * Code which can be placed everywhere @@ -191,6 +192,7 @@ class dolReceiptPrinter extends Printer 'dol_value_object_id' => 'InvoiceID', 'dol_value_object_ref' => 'InvoiceRef', 'dol_print_object_lines' => 'DOL_PRINT_OBJECT_LINES', + 'dol_print_object_lines_with_notes' => 'DOL_PRINT_OBJECT_LINES_WITH_NOTES', 'dol_print_object_tax' => 'TotalVAT', 'dol_print_object_local_tax1' => 'TotalLT1', 'dol_print_object_local_tax2' => 'TotalLT2', @@ -641,6 +643,23 @@ class dolReceiptPrinter extends Printer } } break; + case 'DOL_PRINT_OBJECT_LINES_WITH_NOTES': + foreach ($object->lines as $line) { + if ($line->fk_product) { + $spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1; + $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); + $this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); + $this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n"); + $spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - 10 - 1; + $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); + $this->printer->text($line->description."\n"); + } else { + $spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - 10 - 1; + $spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0); + $this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n"); + } + } + break; case 'DOL_PRINT_OBJECT_TAX': //var_dump($object); $vatarray = array(); From 5e2bec9cad49a133c071016d7bf3bd824ae2f88c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Apr 2021 02:09:29 +0200 Subject: [PATCH 037/177] Look and feel v14 --- htdocs/compta/tva/card.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 91cf572b9c6..daf5afb025e 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -357,6 +357,7 @@ if ($id) { // Form to enter VAT if ($action == 'create') { print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New")); + if (!empty($conf->use_javascript_ajax)) { print "\n".''; -print '
'.$langs->trans("DatePayment").''; - print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); - print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1); print '
'.$langs->trans("Amount").'

'.$langs->trans('AutomaticCreationPayment').'
'.$langs->trans("DatePayment").''; + print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); + print '
'.$langs->trans("PaymentMode").''; $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); @@ -448,10 +454,6 @@ if ($action == 'create') { print '
'.$langs->trans('AutomaticCreationPayment').'
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; @@ -473,9 +475,11 @@ if ($action == 'create') { print dol_get_fiche_end(); print '
'; - print ''; + print '
'; print ' '.$langs->trans("ClosePaidVATAutomatically").''; - print '
'; + print '
'; + print '
'; + print ''; print '     '; print ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index b9042ca6c21..ad28bcca999 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -492,7 +492,7 @@ if ($action == 'create') { // Bank if (!empty($conf->banque->enabled)) { print '
'; - print $form->editfieldkey('DefaultBankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; + print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="paddingrighonly"'); $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant print '
'; - print $form->editfieldkey('DefaultPaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; + print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).''; $form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", ''); print '
'; +/* print '
'; print $langs->trans("ClosePaidSalaryAutomatically"); print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; -print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0); -//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); +print ''; print ' 
'."\n"; + print '
'."\n"; -// Type -if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { - $listoftype = $adht->liste_array(); - $tmp = array_keys($listoftype); - $defaulttype = ''; - $isempty = 1; - if (count($listoftype) == 1) { - $defaulttype = $tmp[0]; - $isempty = 0; + // Type + if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { + $listoftype = $adht->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; + } + print ''."\n"; + } else { + $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); + print ''; } - print ''."\n"; -} else { - $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); - print ''; -} -// Moral/Physic attribute -$morphys["phy"] = $langs->trans("Physical"); -$morphys["mor"] = $langs->trans("Moral"); -if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''."\n"; -} else { - print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; - print ''; -} -// Civility -print ''."\n"; -// Lastname -print ''."\n"; -// Firstname -print ''."\n"; -// Gender -print ''; -print ''; -// Company -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print ''."\n"; + } else { + print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; + print ''; + } + // Civility + print ''."\n"; + // Lastname + print ''."\n"; + // Firstname + print ''."\n"; + // Gender + print ''; + print ''; + // Company + print ''."\n"; + // Address + print ''."\n"; + // Zip / Town + print ''; + // Country + print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; -} -// EMail -print ''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; -} -// Birthday -print ''."\n"; -// Photo -print ''."\n"; -// Public -print ''."\n"; -// Other attributes -$tpl_context = 'public'; // define template context to public -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; -// Comments -print ''; -print ''; -print ''; -print ''."\n"; + // State + if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; + } + // EMail + print ''."\n"; + // Login + if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + // Birthday + print ''."\n"; + // Photo + print ''."\n"; + // Public + print ''."\n"; + // Other attributes + $tpl_context = 'public'; // define template context to public + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; + // Comments + print ''; + print ''; + print ''; + print ''."\n"; -// Add specific fields used by Dolibarr foundation for example -if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); - print ''."\n"; -} -if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - - // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount - - // Set amount for the subscription - $amount = isset($amount) ? $amount : 0; - - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { - $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; + print ''."\n"; } + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount - if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); + // Set amount for the subscription + $amount = isset($amount) ? $amount : 0; + + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; + } + + if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); + } + // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' + print ''; } - // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' - print '
'.$langs->trans("Type").' *'; + print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print '
'.$langs->trans("Type").' *'; - print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); - print '
'.$langs->trans('MemberNature').' *'."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); - print '
'.$langs->trans('UserTitle').''; -print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; -$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); -print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); -print '
'.$langs->trans("Company").'
'.$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').''; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; + // Moral/Physic attribute + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { + print '
'.$langs->trans('MemberNature').' *'."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print '
'.$langs->trans('UserTitle').''; + print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; + $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); + print '
'.$langs->trans("Company").'
'.$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').''; + $country_id = GETPOST('country_id'); + if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); + } + if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } } } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } + $country_code = getCountry($country_id, 2, $db, $langs); + print $form->select_country($country_id, 'country_id'); print '
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; -print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); -print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } + print '
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; + print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); + print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
'.$langs->trans("TurnoverOrBudget").' *'; - print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); - print ' € or $'; + // Add specific fields used by Dolibarr foundation for example + if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { + $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); + print '
'.$langs->trans("TurnoverOrBudget").' *'; + print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); + print ' € or $'; - print ''; - print '
'.$langs->trans("Subscription").''; + if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + print ''; + } else { + print ''; + print ''; + } + print ' '.$langs->trans("Currency".$conf->currency); + print '
'.$langs->trans("Subscription").''; - if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; - } else { - print ''; - print ''; + print "
\n"; + + print dol_get_fiche_end(); + + // Save + print '
'; + print ''; + if (!empty($backtopage)) { + print '     '; } - print ' '.$langs->trans("Currency".$conf->currency); - print ''; -} -print "\n"; - -print dol_get_fiche_end(); - -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
'; + print '
'; -print "\n"; -print "
"; -print ''; + print "\n"; + print "
"; + print ''; -llxFooterVierge(); + llxFooterVierge(); -$db->close(); + $db->close(); From d6085fb68a1214dcfd116fe8bbf8bcb80dc0f99b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 17 Apr 2021 14:29:02 +0200 Subject: [PATCH 087/177] Update new.php --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 0920e5976b1..dcf64ed7634 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -218,7 +218,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (!GETPOST('firstname') { + if (!GETPOST('firstname')) ä{ $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } From d23e74660912b0b712f249d6eadc8c5089ba2e08 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 17 Apr 2021 12:29:23 +0000 Subject: [PATCH 088/177] Fixing style errors. --- htdocs/public/members/new.php | 172 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index dcf64ed7634..13705796ad5 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -218,17 +218,17 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (!GETPOST('firstname')) ä{ + if (!GETPOST('firstname')) { ä $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; -} -if (GETPOST('email') && !isValidEmail(GETPOST('email'))) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n"; -} + } + if (GETPOST('email') && !isValidEmail(GETPOST('email'))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n"; + } $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int')); - if GETPOSTISSET('birthmonth') && empty($birthday)) { + if GETPOSTISSET('birthmonth') { && empty($birthday)) $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; @@ -548,33 +548,33 @@ jQuery(document).ready(function () { print ''."\n"; // Type - if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { - $listoftype = $adht->liste_array(); - $tmp = array_keys($listoftype); - $defaulttype = ''; - $isempty = 1; - if (count($listoftype) == 1) { - $defaulttype = $tmp[0]; - $isempty = 0; - } - print ''."\n"; - } else { - $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); - print ''; +if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { + $listoftype = $adht->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; } + print ''."\n"; +} else { + $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); + print ''; +} // Moral/Physic attribute $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''."\n"; - } else { - print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; - print ''; - } +if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { + print ''."\n"; +} else { + print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; + print ''; +} // Civility print ''."\n"; @@ -602,39 +602,39 @@ jQuery(document).ready(function () { // Country print ''; // State - if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} // EMail print ''."\n"; // Login - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; - } +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} // Birthday print ''."\n"; // Add specific fields used by Dolibarr foundation for example - if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); - print ''."\n"; + print ''."\n"; +} +if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount + + // Set amount for the subscription + $amount = isset($amount) ? $amount : 0; + + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; } - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount - // Set amount for the subscription - $amount = isset($amount) ? $amount : 0; - - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { - $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; - } - - if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); - } - // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' - print ''; + if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); } + // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' + print ''; +} print "
'.$langs->trans("Type").' *'; - print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); - print '
'.$langs->trans("Type").' *'; + print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print '
'.$langs->trans('MemberNature').' *'."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); - print '
'.$langs->trans('MemberNature').' *'."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print '
'.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans('Country').''; $country_id = GETPOST('country_id'); - if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); - } - if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; - } +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; } } +} $country_code = getCountry($country_id, 2, $db, $langs); print $form->select_country($country_id, 'country_id'); print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } - print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); } + print '
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -653,13 +653,13 @@ jQuery(document).ready(function () { print '
'.$langs->trans("TurnoverOrBudget").' *'; - print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); - print ' € or $'; +if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { + $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); + print '
'.$langs->trans("TurnoverOrBudget").' *'; + print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); + print ' € or $'; - print ''; - print '
'.$langs->trans("Subscription").''; - if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; - } else { - print ''; - print ''; - } - print ' '.$langs->trans("Currency".$conf->currency); - print '
'.$langs->trans("Subscription").''; + if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + print ''; + } else { + print ''; + print ''; + } + print ' '.$langs->trans("Currency".$conf->currency); + print '
\n"; print dol_get_fiche_end(); @@ -726,9 +726,9 @@ jQuery(document).ready(function () { // Save print '
'; print ''; - if (!empty($backtopage)) { - print '     '; - } +if (!empty($backtopage)) { + print '     '; +} print '
'; From 16dfde112806d813c9c5718d2a63bb0756fa88fa Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 17 Apr 2021 14:39:14 +0200 Subject: [PATCH 089/177] Update new.php --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 13705796ad5..fa9c844288f 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -218,7 +218,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (!GETPOST('firstname')) { ä + if (!GETPOST('firstname')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } From b96d3cebda23f09b1581a56ca17143ccf01df672 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 17 Apr 2021 14:51:05 +0200 Subject: [PATCH 090/177] Update new.php --- htdocs/public/members/new.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index fa9c844288f..677e1e1b906 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -227,8 +227,8 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n"; } - $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int')); - if GETPOSTISSET('birthmonth') { && empty($birthday)) + $birthday = dol_mktime(GETPOST('birthhour', 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int')); + if (GETPOSTISSET('birthmonth') && empty($birthday)) { $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; From 17c2b4f0e8336731713250497adba37872da1f36 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 17 Apr 2021 23:58:00 +0200 Subject: [PATCH 091/177] Fix warning wrong date format for new member form Fix warning wrong date format for new member form when new membre submit no birthdate --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index e6b7a3e7a38..349943c7978 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -228,7 +228,7 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } $birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); - if (GETPOSTISSET("birthmonth") && empty($birthday)) { + if (GETPOST("birthmonth") && empty($birthday)) { $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; From fbc28795bc2bc84166448682ca1011870e5a289f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 12:51:37 +0200 Subject: [PATCH 092/177] Debug sitemap generation --- htdocs/website/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 93a2aebc346..7075bd770c9 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2251,6 +2251,7 @@ $tempdir = $conf->website->dir_output.'/'.$websitekey.'/'; if ($action == 'generatesitemaps' && $usercanedit) { $domtree = new DOMDocument('1.0', 'UTF-8'); $root = $domtree->createElementNS('http://www.sitemaps.org/schemas/sitemap/0.9', 'urlset'); + $domtree->createAttributeNS("http://www.w3.org/1999/xhtml", 'xmlns:xhtml'); $domtree->formatOutput = true; $xmlname = 'sitemap.'.$websitekey.'.xml'; @@ -2258,6 +2259,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w"; $sql .= " WHERE wp.type_container IN ('page', 'blogpost')"; $sql .= " AND wp.fk_website = w.rowid"; + $sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')"; $sql .= " AND w.ref = '".dol_escape_json($websitekey)."'"; $resql = $db->query($sql); if ($resql) { @@ -2274,7 +2276,12 @@ if ($action == 'generatesitemaps' && $usercanedit) { if ($objp->virtualhost) { $domainname = $objp->virtualhost; } - $loc = $domtree->createElement('loc', 'http://'.$domainname.'/'.$pageurl); + if (! preg_match('/^http/i', $domainname)) { + $domainname .= 'https://'.$domainname; + } + //$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php'; + + $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl.'.php'); $lastmod = $domtree->createElement('lastmod', $db->jdate($objp->tms)); $url->appendChild($loc); @@ -2295,6 +2302,8 @@ if ($action == 'generatesitemaps' && $usercanedit) { } else { dol_print_error($db); } + + // Add the entry Sitemap: into the robot file. $robotcontent = @file_get_contents($filerobot); $result = preg_replace('/\n/ims', '', $robotcontent); if ($result) { From 3502c4c269a9dad909c33d0170173e156028c9e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 13:45:46 +0200 Subject: [PATCH 093/177] Debug sitemap generation --- htdocs/core/lib/website2.lib.php | 10 ++-- htdocs/website/index.php | 95 ++++++++++++++++++++++++++++++-- 2 files changed, 96 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 6510d5fff8d..8824d9cc06d 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -203,10 +203,6 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } // Add translation reference (main language) if ($object->isMultiLang()) { - // Add myself - $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; - $tplcontent .= ''."\n"; - // Add page "translation of" $translationof = $objectpage->fk_page; if ($translationof) { @@ -225,6 +221,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } } } + // Add "has translation pages" $sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ', '.$translationof : '')).")"; $resql = $db->query($sql); @@ -244,6 +241,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, } else { dol_print_error($db); } + + // Add myself + $tplcontent .= 'fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n"; + $tplcontent .= ''."\n"; + $tplcontent .= ''."\n"; } // Add manifest.json. Do we have to add it only on home page ? diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 7075bd770c9..510f9b278dc 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2250,12 +2250,16 @@ $tempdir = $conf->website->dir_output.'/'.$websitekey.'/'; // Generate web site sitemaps if ($action == 'generatesitemaps' && $usercanedit) { $domtree = new DOMDocument('1.0', 'UTF-8'); + $root = $domtree->createElementNS('http://www.sitemaps.org/schemas/sitemap/0.9', 'urlset'); - $domtree->createAttributeNS("http://www.w3.org/1999/xhtml", 'xmlns:xhtml'); + $root->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:xhtml', 'http://www.w3.org/1999/xhtml'); + $domtree->formatOutput = true; + $xmlname = 'sitemap.'.$websitekey.'.xml'; - $sql = "SELECT wp.type_container , wp.pageurl, wp.lang, wp.tms as tms, w.virtualhost"; + $sql = "SELECT wp.rowid, wp.type_container , wp.pageurl, wp.lang, wp.fk_page, wp.tms as tms,"; + $sql .= " w.virtualhost, w.fk_default_home"; $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w"; $sql .= " WHERE wp.type_container IN ('page', 'blogpost')"; $sql .= " AND wp.fk_website = w.rowid"; @@ -2269,10 +2273,25 @@ if ($action == 'generatesitemaps' && $usercanedit) { while ($i < $num_rows) { $objp = $db->fetch_object($resql); $url = $domtree->createElement('url'); - $pageurl = $objp->pageurl; + + $shortlangcode = ''; if ($objp->lang) { - $pageurl = $objp->lang.'/'.$pageurl; + $shortlangcode = substr($objp->lang, 0, 2); // en_US or en-US -> en } + if (empty($shortlangcode)) { + $shortlangcode = substr($object->lang, 0, 2); // en_US or en-US -> en + } + + // Forge $pageurl, adding language prefix if it is an alternative language + $pageurl = $objp->pageurl; + if ($objp->fk_default_home == $objp->rowid) { + $pageurl = ''; + } else { + if ($shortlangcode != substr($object->lang, 0, 2)) { + $pageurl = $shortlangcode.'/'.$pageurl.'.php'; + } + } + if ($objp->virtualhost) { $domainname = $objp->virtualhost; } @@ -2281,11 +2300,77 @@ if ($action == 'generatesitemaps' && $usercanedit) { } //$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php'; - $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl.'.php'); + // URL of sitemaps must end with trailing slash if page is '' + $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl); $lastmod = $domtree->createElement('lastmod', $db->jdate($objp->tms)); + $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values + $priority = $domtree->createElement('priority', '1'); $url->appendChild($loc); $url->appendChild($lastmod); + // Add suggested frequency for refresh + if (!empty($conf->global->WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ)) { + $url->appendChild($changefreq); + } + // Add higher priority for home page + if ($objp->fk_default_home == $objp->rowid) { + $url->appendChild($priority); + } + + // Now add alternate language entries + if ($object->isMultiLang()) { + // Add page "translation of" + $translationof = $objp->fk_page; + if ($translationof) { + $tmppage = new WebsitePage($db); + $tmppage->fetch($translationof); + if ($tmppage->id > 0) { + $tmpshortlangcode = ''; + if ($tmppage->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en + } + if (empty($tmpshortlangcode)) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en + } + if ($tmpshortlangcode != $shortlangcode) { + $xhtmllink = $domtree->createElement('xhtml:link', ''); + $xhtmllink->setAttribute("rel", "alternante"); + $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); + $xhtmllink->setAttribute("href", "'.$pageurl.'"); + } + } + } + + // Add "has translation pages" + $sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objp->rowid.($translationof ? ', '.$translationof : '')).")"; + $resql = $db->query($sql); + if ($resql) { + $num_rows = $db->num_rows($resql); + if ($num_rows > 0) { + while ($objhastrans = $db->fetch_object($resql)) { + $tmpshortlangcode = ''; + if ($objhastrans->lang) { + $tmpshortlangcode = preg_replace('/[_-].*$/', '', $objhastrans->lang); // en_US or en-US -> en + } + if ($tmpshortlangcode != $shortlangcode) { + $xhtmllink = $domtree->createElement('xhtml:link', ''); + $xhtmllink->setAttribute("rel", "alternante"); + $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); + $xhtmllink->setAttribute("href", "'.$pageurl.'"); + } + } + } + } else { + dol_print_error($db); + } + + // Add myself + $xhtmllink = $domtree->createElement('xhtml:link', ''); + $xhtmllink->setAttribute("rel", "alternante"); + $xhtmllink->setAttribute("hreflang", "'.$shortlang.'"); + $xhtmllink->setAttribute("href", "'.$pageurl.'"); + } + $root->appendChild($url); $i++; } From 54c90059ff56cbc1cfedf98f68b56600bdfe7e09 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:11:22 +0200 Subject: [PATCH 094/177] Fix sitemaps --- htdocs/website/index.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 510f9b278dc..3e705ad33d0 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2337,17 +2337,18 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink->setAttribute("rel", "alternante"); $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $url->appendChild($xhtmllink); } } } // Add "has translation pages" $sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objp->rowid.($translationof ? ', '.$translationof : '')).")"; - $resql = $db->query($sql); - if ($resql) { - $num_rows = $db->num_rows($resql); - if ($num_rows > 0) { - while ($objhastrans = $db->fetch_object($resql)) { + $resqlhastrans = $db->query($sql); + if ($resqlhastrans) { + $num_rows_hastrans = $db->num_rows($resqlhastrans); + if ($num_rows_hastrans > 0) { + while ($objhastrans = $db->fetch_object($resqlhastrans)) { $tmpshortlangcode = ''; if ($objhastrans->lang) { $tmpshortlangcode = preg_replace('/[_-].*$/', '', $objhastrans->lang); // en_US or en-US -> en @@ -2357,6 +2358,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink->setAttribute("rel", "alternante"); $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $url->appendChild($xhtmllink); } } } @@ -2369,6 +2371,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink->setAttribute("rel", "alternante"); $xhtmllink->setAttribute("hreflang", "'.$shortlang.'"); $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $url->appendChild($xhtmllink); } $root->appendChild($url); From ae595d85451284ea623cee37f82bfeeb741156ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:18:05 +0200 Subject: [PATCH 095/177] Fix sitemap --- htdocs/website/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 3e705ad33d0..0c59d582872 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2335,8 +2335,8 @@ if ($action == 'generatesitemaps' && $usercanedit) { if ($tmpshortlangcode != $shortlangcode) { $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternante"); - $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); - $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); + $xhtmllink->setAttribute("href", $domainname.'/'.$tmppage->pageurl); $url->appendChild($xhtmllink); } } @@ -2356,8 +2356,8 @@ if ($action == 'generatesitemaps' && $usercanedit) { if ($tmpshortlangcode != $shortlangcode) { $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternante"); - $xhtmllink->setAttribute("hreflang", "'.$tmpshortlangcode.'"); - $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); + $xhtmllink->setAttribute("href", $domainname.'/'.$objhastrans->pageurl); $url->appendChild($xhtmllink); } } @@ -2369,8 +2369,8 @@ if ($action == 'generatesitemaps' && $usercanedit) { // Add myself $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternante"); - $xhtmllink->setAttribute("hreflang", "'.$shortlang.'"); - $xhtmllink->setAttribute("href", "'.$pageurl.'"); + $xhtmllink->setAttribute("hreflang", $shortlang); + $xhtmllink->setAttribute("href", $domainname.'/'.$pageurl); $url->appendChild($xhtmllink); } From ecadc03b7525c194c633486a64e60bd77b77c7a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:32:17 +0200 Subject: [PATCH 096/177] Fix sitemaps for multilang --- htdocs/website/index.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0c59d582872..7001e6d0499 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2283,12 +2283,12 @@ if ($action == 'generatesitemaps' && $usercanedit) { } // Forge $pageurl, adding language prefix if it is an alternative language - $pageurl = $objp->pageurl; + $pageurl = $objp->pageurl.'.php'; if ($objp->fk_default_home == $objp->rowid) { $pageurl = ''; } else { if ($shortlangcode != substr($object->lang, 0, 2)) { - $pageurl = $shortlangcode.'/'.$pageurl.'.php'; + $pageurl = $shortlangcode.'/'.$pageurl; } } @@ -2319,6 +2319,8 @@ if ($action == 'generatesitemaps' && $usercanedit) { // Now add alternate language entries if ($object->isMultiLang()) { + $alternatefound = 0; + // Add page "translation of" $translationof = $objp->fk_page; if ($translationof) { @@ -2336,8 +2338,10 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternante"); $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); - $xhtmllink->setAttribute("href", $domainname.'/'.$tmppage->pageurl); + $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'); $url->appendChild($xhtmllink); + + $alternatefound++; } } } @@ -2355,10 +2359,12 @@ if ($action == 'generatesitemaps' && $usercanedit) { } if ($tmpshortlangcode != $shortlangcode) { $xhtmllink = $domtree->createElement('xhtml:link', ''); - $xhtmllink->setAttribute("rel", "alternante"); + $xhtmllink->setAttribute("rel", "alternate"); $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); - $xhtmllink->setAttribute("href", $domainname.'/'.$objhastrans->pageurl); + $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php'); $url->appendChild($xhtmllink); + + $alternatefound++; } } } @@ -2366,12 +2372,14 @@ if ($action == 'generatesitemaps' && $usercanedit) { dol_print_error($db); } - // Add myself - $xhtmllink = $domtree->createElement('xhtml:link', ''); - $xhtmllink->setAttribute("rel", "alternante"); - $xhtmllink->setAttribute("hreflang", $shortlang); - $xhtmllink->setAttribute("href", $domainname.'/'.$pageurl); - $url->appendChild($xhtmllink); + if ($alternatefound) { + // Add myself + $xhtmllink = $domtree->createElement('xhtml:link', ''); + $xhtmllink->setAttribute("rel", "alternate"); + $xhtmllink->setAttribute("hreflang", $shortlangcode); + $xhtmllink->setAttribute("href", $domainname.'/'.$pageurl); + $url->appendChild($xhtmllink); + } } $root->appendChild($url); From 20fb70d493fffbdd6a66fd063fbed26cdd1b1980 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:34:08 +0200 Subject: [PATCH 097/177] Fix syntax error --- htdocs/website/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 7001e6d0499..0385c4d7c57 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2338,7 +2338,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternante"); $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); - $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'); + $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php')); $url->appendChild($xhtmllink); $alternatefound++; @@ -2361,7 +2361,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $xhtmllink = $domtree->createElement('xhtml:link', ''); $xhtmllink->setAttribute("rel", "alternate"); $xhtmllink->setAttribute("hreflang", $tmpshortlangcode); - $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php'); + $xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php')); $url->appendChild($xhtmllink); $alternatefound++; From 08deb3c0e9a721e81858597ee8716764476f1674 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:41:05 +0200 Subject: [PATCH 098/177] Fix selection of files to report into sitemap --- htdocs/website/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0385c4d7c57..10f6dc8c041 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2263,6 +2263,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w"; $sql .= " WHERE wp.type_container IN ('page', 'blogpost')"; $sql .= " AND wp.fk_website = w.rowid"; + $sql .= " AND status = ".WebsitePage::STATUS_VALIDATED; $sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')"; $sql .= " AND w.ref = '".dol_escape_json($websitekey)."'"; $resql = $db->query($sql); From 038b005e6a87cfede323e0a6b2b86a6208947bfb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:44:33 +0200 Subject: [PATCH 099/177] Fix sql error --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 10f6dc8c041..5b8495a6091 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2263,7 +2263,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w"; $sql .= " WHERE wp.type_container IN ('page', 'blogpost')"; $sql .= " AND wp.fk_website = w.rowid"; - $sql .= " AND status = ".WebsitePage::STATUS_VALIDATED; + $sql .= " AND wp.status = ".WebsitePage::STATUS_VALIDATED; $sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')"; $sql .= " AND w.ref = '".dol_escape_json($websitekey)."'"; $resql = $db->query($sql); From fd3f2f4e27ca4d808c7560affa695962bd06c039 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:46:14 +0200 Subject: [PATCH 100/177] Set order in sitemap --- htdocs/website/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 5b8495a6091..1512ae038cd 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2266,6 +2266,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $sql .= " AND wp.status = ".WebsitePage::STATUS_VALIDATED; $sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')"; $sql .= " AND w.ref = '".dol_escape_json($websitekey)."'"; + $sql .= " ORDER BY wp.fk_default_home DESC, wp.rowid DESC"; $resql = $db->query($sql); if ($resql) { $num_rows = $db->num_rows($resql); From 8067e1d70ad8ae6dea249a03fd7c3a141236ffd5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 14:48:38 +0200 Subject: [PATCH 101/177] Fix order --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1512ae038cd..2df1c6151a3 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2266,7 +2266,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { $sql .= " AND wp.status = ".WebsitePage::STATUS_VALIDATED; $sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')"; $sql .= " AND w.ref = '".dol_escape_json($websitekey)."'"; - $sql .= " ORDER BY wp.fk_default_home DESC, wp.rowid DESC"; + $sql .= " ORDER BY wp.tms DESC, wp.rowid DESC"; $resql = $db->query($sql); if ($resql) { $num_rows = $db->num_rows($resql); From 03f7ec13cff96458d6378c21a9a996ed2c2de7fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 15:00:23 +0200 Subject: [PATCH 102/177] Can sort on language on list of website pages --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2df1c6151a3..ce6990ab29f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4220,7 +4220,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); - print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); + print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); From cad7ea0b920e85cb866f1082720d0d8e3d0abc5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 15:07:22 +0200 Subject: [PATCH 103/177] css --- htdocs/core/class/translate.class.php | 4 ++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/website/index.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index f06bb32b62b..2a25652761d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -735,7 +735,7 @@ class Translate * @param string $str string root to translate * @param string $countrycode country code (FR, ...) * @return string translated string - * @see transcountrynoentities() + * @see transcountrynoentities(), picto_from_langcode() */ public function transcountry($str, $countrycode) { @@ -753,7 +753,7 @@ class Translate * @param string $str string root to translate * @param string $countrycode country code (FR, ...) * @return string translated string - * @see transcountry() + * @see transcountry(), picto_from_langcode() */ public function transcountrynoentities($str, $countrycode) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2b981530834..ce3b89d7805 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7996,7 +7996,7 @@ function dol_validElement($element) } /** - * Return img flag of country for a language code or country code + * Return img flag of country for a language code or country code. * * @param string $codelang Language code ('en_IN', 'fr_CA', ...) or ISO Country code on 2 characters in uppercase ('IN', 'FR') * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"' or 'class="saturatemedium"') diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ce6990ab29f..b3f46270c46 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4220,7 +4220,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']); - print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, '')."\n"; + print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']); @@ -4278,8 +4278,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = $param .= '&searchstring='.urlencode($searchkey); // Language - print ''; - print $answerrecord->lang; + print ''; + print picto_from_langcode($answerrecord->lang, $answerrecord->lang); print ''; // Number of words From 10f1443d4a82976ec8622b68bbdaaba0d5a1de15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 15:27:45 +0200 Subject: [PATCH 104/177] Debug sitemap generation. Bad format of date --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b3f46270c46..464a389836d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2304,7 +2304,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { // URL of sitemaps must end with trailing slash if page is '' $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl); - $lastmod = $domtree->createElement('lastmod', $db->jdate($objp->tms)); + $lastmod = $domtree->createElement('lastmod', dol_print_date($db->jdate($objp->tms), 'dayrfc', 'gmt'); $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values $priority = $domtree->createElement('priority', '1'); From 69aa5553f58f2f28fffca11036bf233394210961 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 15:28:52 +0200 Subject: [PATCH 105/177] Fix syntax error --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 464a389836d..f2ce403ef17 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2304,7 +2304,7 @@ if ($action == 'generatesitemaps' && $usercanedit) { // URL of sitemaps must end with trailing slash if page is '' $loc = $domtree->createElement('loc', $domainname.'/'.$pageurl); - $lastmod = $domtree->createElement('lastmod', dol_print_date($db->jdate($objp->tms), 'dayrfc', 'gmt'); + $lastmod = $domtree->createElement('lastmod', dol_print_date($db->jdate($objp->tms), 'dayrfc', 'gmt')); $changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values $priority = $domtree->createElement('priority', '1'); From f4fa16797b6b7c28bf45a4c20fee13b0325259f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 16:00:48 +0200 Subject: [PATCH 106/177] Complete information on tab for files on salary --- htdocs/salaries/document.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index fddb5259da9..4c88cefb8de 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -123,8 +123,23 @@ if ($object->id) { print '
'; print ''; - print ''; - print ''; + + print ""; + print ''; + + print ""; + print ''; + + print ''; + + print ''; + + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
' . $langs->trans("DateStartPeriod") . ''; + print dol_print_date($object->datesp, 'day'); + print '
' . $langs->trans("DateEndPeriod") . ''; + print dol_print_date($object->dateep, 'day'); + print '
' . $langs->trans("Amount") . '' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
'; print ''; From c4f27cc29f1376d90d0c73bdd1f334ccb8649fd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 16:43:09 +0200 Subject: [PATCH 107/177] Debug module salary --- htdocs/salaries/card.php | 13 +++++----- htdocs/salaries/class/salary.class.php | 10 ++++++-- htdocs/salaries/list.php | 4 +++ htdocs/user/bank.php | 35 ++++++++++++++++++-------- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ad28bcca999..5b6134d192d 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -213,10 +213,11 @@ if ($action == 'add' && empty($cancel)) { } if (!$error) { + $db->begin(); + $ret = $object->create($user); if ($ret < 0) $error++; if (!empty($auto_create_paiement) && !$error) { - $db->begin(); // Create a line of payments $paiement = new PaymentSalary($db); $paiement->chid = $object->id; @@ -243,15 +244,11 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($paiement->error, null, 'errors'); } } - - if (!$error) { - $db->commit(); - } else { - $db->rollback(); - } } if (empty($error)) { + $db->commit(); + if (GETPOST('saveandnew', 'alpha')) { setEventMessages($langs->trans("RecordSaved"), '', 'mesgs'); header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int')); @@ -260,6 +257,8 @@ if ($action == 'add' && empty($cancel)) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id); exit; } + } else { + $db->rollback(); } } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index 85ccfc0a1db..94ede5d7a4d 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -498,6 +498,12 @@ class Salary extends CommonObject $label = ''.$langs->trans("Salary").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; + if ($this->label) { + $label .= '
'.$langs->trans('Label').': '.$this->label; + } + if ($this->datesp && $this->dateep) { + $label .= '
'.$langs->trans('Period').': '.dol_print_date($this->datesp, 'day').' - '.dol_print_date($this->dateep, 'day'); + } $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; @@ -647,9 +653,9 @@ class Salary extends CommonObject /** * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee) * - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) - * @return string Libelle + * @return string Label */ public function getLibStatut($mode = 0, $alreadypaid = -1) { diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index b35b890b994..382e05e4f0d 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -532,6 +532,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $salstatic->id = $obj->rowid; $salstatic->ref = $obj->rowid; + $salstatic->label = $obj->label; + $salstatic->paye = $obj->paye; + $salstatic->datesp = $db->jdate($obj->datesp); + $salstatic->dateep = $db->jdate($obj->dateep); // Show here line of result print ''; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index df5757992f0..356e23a5de0 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -40,6 +40,7 @@ if (!empty($conf->expensereport->enabled)) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } if (!empty($conf->salaries->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; } @@ -354,16 +355,18 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac // Latest payments of salaries if (!empty($conf->salaries->enabled) && - $user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id) + (($user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)) || (!empty($user->rights->salaries->readall))) ) { $payment_salary = new PaymentSalary($db); + $salary = new Salary($db); - $sql = "SELECT ps.rowid, s.datesp, s.dateep, ps.amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps"; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON (s.rowid = ps.fk_salary)"; + $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, SUM(ps.amount) as alreadypaid"; + $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (s.rowid = ps.fk_salary)"; $sql .= " WHERE s.fk_user = ".$object->id; - $sql .= " AND ps.entity = ".$conf->entity; - $sql .= " ORDER BY ps.rowid DESC"; + $sql .= " AND s.entity IN (".getEntity('salary').")"; + $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye"; + $sql .= " ORDER BY s.dateep DESC"; $resql = $db->query($sql); if ($resql) { @@ -372,7 +375,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; - print '
'; + print ''; print ''; @@ -380,16 +383,26 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); + $payment_salary->id = $objp->rowid; + $payment_salary->ref = $objp->ref; + $payment_salary->datep = $db->jdate($objp->datep); + + $salary->id = $objp->sid; + $salary->ref = $objp->sref ? $objp->sref : $objp->sid; + $salary->label = $objp->label; + $salary->datesp = $db->jdate($objp->datesp); + $salary->dateep = $db->jdate($objp->dateep); + $salary->paye = $objp->paye; + print ''; print ''; print '\n"; print '\n"; - print ''; + //print ''; + print ''; print ''; $i++; From 55f114511cdaa166afe7da2fdd958e298b06821d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 16:56:55 +0200 Subject: [PATCH 108/177] Debug v14 --- htdocs/user/list.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 1eecf26664c..fe05c551945 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -595,7 +595,7 @@ $moreforfilter = ''; // Filter on categories if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('Categories').': '; + $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="paddingright"'); $moreforfilter .= $formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1); $moreforfilter .= '
'; } @@ -724,7 +724,7 @@ if (!empty($arrayfields['u.gender']['checked'])) { print_liste_field_titre("Gender", $_SERVER['PHP_SELF'], "u.gender", $param, "", "", $sortfield, $sortorder); } if (!empty($arrayfields['u.employee']['checked'])) { - print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder, 'center '); } if (!empty($arrayfields['u.fk_user']['checked'])) { print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder); @@ -822,6 +822,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $li = $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1); print '
'; + if (!empty($arrayfields['u.login']['checked'])) { print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.firstname']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -858,7 +859,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } } if (!empty($arrayfields['u.employee']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } From 7794927a64218d67849f0738557b4a6a6bec345d Mon Sep 17 00:00:00 2001 From: ATM john Date: Sun, 18 Apr 2021 20:12:24 +0200 Subject: [PATCH 109/177] New check update for modules --- htdocs/admin/modules.php | 33 ++++++----- htdocs/core/lib/functions.lib.php | 17 +++++- htdocs/core/modules/DolibarrModules.class.php | 58 ++++++++++++++++++- htdocs/langs/en_US/admin.lang | 5 +- htdocs/langs/en_US/errors.lang | 1 + htdocs/theme/eldy/btn.inc.php | 5 ++ htdocs/theme/eldy/info-box.inc.php | 8 ++- htdocs/theme/md/info-box.inc.php | 4 +- 8 files changed, 106 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index fbe1ae98619..8380756bee5 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -518,11 +518,13 @@ if ($mode == 'common' || $mode == 'commonkanban') { print $deschelp; - $moreforfilter = '
'; + $moreforfilter = '
'; - $moreforfilter .= '
'."\n"; if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) { @@ -894,15 +898,14 @@ if ($mode == 'common' || $mode == 'commonkanban') { // Version print '\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ce3b89d7805..1b12dd75d4d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9710,6 +9710,16 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = return '
<'.$tag.' '.$compiledAttributes.'>'.$html.'
'; } +/** + * Add space between dolGetButtonTitle + * + * @return string html of title separator + */ +function dolGetButtonTitleSeparator($moreClass = "") +{ + return ''; +} + /** * Function dolGetButtonTitle : this kind of buttons are used in title in list * @@ -9718,7 +9728,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = * @param string $iconClass class for icon element (Example: 'fa fa-file') * @param string $url the url for link * @param string $id attribute id of button - * @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip + * @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip * @param array $params various params for future : recommended rather than adding more function arguments * @return string html button */ @@ -9753,7 +9763,10 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $useclassfortooltip = 0; } - if ($status <= 0) { + if ($status == 2) { + $attr['class'] .= ' btnTitleSelected'; + } + elseif ($status <= 0) { $attr['class'] .= ' refused'; $attr['href'] = ''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index b92937cdada..44fc64e0fd8 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -192,6 +192,18 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it */ public $version; + /** + * Module last version + * @var string $lastVersion + */ + public $lastVersion = ''; + + /** + * true indicate this module need update + * @var bool $needUpdate + */ + public $needUpdate = false; + /** * @var string Module description (short text) * @@ -2215,10 +2227,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * @param string $codetoconfig HTML code to go to config page * @return string HTML code of Kanban view */ - public function getKanbanView($codeenabledisable = '', $codetoconfig = '') + public function getKanbanView($codeenabledisable = '', $codetoconfig = '', $checkUpdate = false) { global $conf, $langs; + if ($this->isCoreOrExternalModule() == 'external' && $checkUpdate) { + $this->checkForUpdate(); + } + // Define imginfo $imginfo = "info"; if ($this->isCoreOrExternalModule() == 'external') { @@ -2239,8 +2255,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $versiontrans .= 'warning'; } + $versiontrans .= ' --need-update classfortooltip'; print ' -
+
'; @@ -2258,7 +2279,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) { - print 'getVersion(1).'">'; + + $versionTitle = $langs->trans("Version").' '.$this->getVersion(1); + if ($this->needUpdate){ + $versionTitle.= '
'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion; + } + + print ''; print $this->getVersion(1); print ''; } @@ -2287,4 +2314,29 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
'; } + + /** + * check for module update + * @return int <0 if Error, 0 == no update needed, >0 if need update + */ + function checkForUpdate(){ + require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + if (!empty($this->url_last_version)) { + $lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only + if (isset($lastVersion['content'])) { + $this->lastVersion = $lastVersion['content']; + if (version_compare($lastVersion['content'], $this->version) > 0) { + $this->needUpdate = true; + return 1; + }else{ + $this->needUpdate = false; + return 0; + } + } + else{ + return -1; + } + } + return 0; + } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b103d0082ba..7f37655012c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2121,4 +2121,7 @@ YouShouldDisablePHPFunctions=You should disable PHP functions IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good) RecommendedValueIs=Recommended: %s -ARestrictedPath=A restricted path \ No newline at end of file +ARestrictedPath=A restricted path +CheckForModuleUpdate=Check for modules updates +CheckForModuleUpdateHelp=Check for modules updates.
This action will connect to modules editors to check if a new version is available. +ModuleUpdateAvailable=An update is available for this module diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 002aa63fa62..89aa9b77662 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -296,3 +296,4 @@ WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connec WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here. ErrorActionCommPropertyUserowneridNotDefined=User's owner is required ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary +CheckVersionFail=Version check fail diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 3e3ab1d3b01..92715b774ce 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -279,6 +279,11 @@ div.pagination li:first-child a.btnTitle{ margin-left: 10px; } +.button-title-separator{ + display: inline-block; + clear: both; + width: 20px; +} .imgforviewmode { color: #aaa; diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 3eda0c40ee7..dc2dbb3f4d3 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -9,10 +9,14 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { * ------------------- */ -.info-box-module-external span.info-box-icon-version { +.info-box-module.--external span.info-box-icon-version { background: #bbb; } +.info-box-module.--external.--need-update span.info-box-icon-version{ + background: #bc9525; +} + .info-box { display: block; position: relative; @@ -153,7 +157,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { -webkit-transition: opacity 0.5s, visibility 0s 0.5s; transition: opacity 0.5s, visibility 0s 0.5s; } -.box-flex-item.info-box-module.info-box-module-disabled { +.box-flex-item.info-box-module.--disabled { /* opacity: 0.6; */ } diff --git a/htdocs/theme/md/info-box.inc.php b/htdocs/theme/md/info-box.inc.php index 0946315391a..a363475c409 100644 --- a/htdocs/theme/md/info-box.inc.php +++ b/htdocs/theme/md/info-box.inc.php @@ -119,7 +119,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { } -.info-box-module-external span.info-box-icon-version { +.info-box-module.--external span.info-box-icon-version { background: #bbb; } @@ -250,7 +250,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle { transition: opacity 0.5s, visibility 0s 0.5s; } -.box-flex-item.info-box-module.info-box-module-disabled { +.box-flex-item.info-box-module.--disabled { /* opacity: 0.6; */ } From 2b894e8ab3378fa4c0a300e461a360413bd05477 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 20:13:18 +0200 Subject: [PATCH 110/177] css --- htdocs/install/default.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/default.css b/htdocs/install/default.css index eaefd6d5b2b..5363d9530e1 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -362,7 +362,7 @@ tr.choiceselected td .button { } a.button:link,a.button:visited,a.button:active { - color: #888; + color: #555; } .button { From 0c531984957095464f42d61904159ddc4b755773 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Apr 2021 20:18:38 +0200 Subject: [PATCH 111/177] Easier to click --- htdocs/install/step2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index d9321656355..2841ae8bdfe 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -572,7 +572,7 @@ dolibarr_install_syslog("- step2: end"); $out = ' '; -$out .= $langs->trans("MakeAnonymousPing"); +$out .= ''; $out .= ''; $out .= ''; - print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
'; - $payment_salary->id = $objp->rowid; - $payment_salary->ref = $objp->rowid; - print $payment_salary->getNomUrl(1); + print $salary->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->datesp), 'day')."'.dol_print_date($db->jdate($objp->dateep), 'day')."'.price($objp->amount).''.price($objp->amount).''.$salary->getLibStatut(5, $objp->alreadypaid).'
'; print $li; @@ -836,13 +837,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } } if (!empty($arrayfields['u.lastname']['checked'])) { - print ''.$obj->lastname.''.dol_escape_htmltag($obj->lastname).''.$obj->firstname.''.dol_escape_htmltag($obj->firstname).''.yn($obj->employee).''.yn($obj->employee).'
'; print $versiontrans; - if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application. - require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - if (!empty($objMod->url_last_version)) { - $newversion = getURLContent($objMod->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only - if (isset($newversion['content'])) { - if (version_compare($newversion['content'], $versiontrans) > 0) { - print " ".$newversion['content'].""; - } - } + if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE) || $action == 'checklastversion') { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application. + $checkRes = $objMod->checkForUpdate(); + if ($checkRes > 0) { + setEventMessage($objMod->getName().' : '.$versiontrans.' -> '.$objMod->lastVersion); + print ' '.$objMod->lastVersion.''; + } + elseif ($checkRes < 0) { + setEventMessage($objMod->getName().' '.$langs->trans('CheckVersionFail'), 'warnings'); } } print "
'."\n"; +print '
'."\n"; // Type if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { @@ -564,9 +564,10 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); print ''; } - // Moral/Physic attribute - $morphys["phy"] = $langs->trans("Physical"); - $morphys["mor"] = $langs->trans("Moral"); + +// Moral/Physic attribute +$morphys["phy"] = $langs->trans("Physical"); +$morphys["mor"] = $langs->trans("Moral"); if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''."\n"; - // Lastname - print ''."\n"; - // Firstname - print ''."\n"; - // Gender - print ''; - print ''; - // Company - print ''."\n"; - // Address - print ''."\n"; - // Zip / Town - print ''; - // Country - print ''."\n"; +// Lastname +print ''."\n"; +// Firstname +print ''."\n"; +// Gender +print ''; +print ''; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; - // State +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print ''; +// State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { print ''; } - // EMail - print ''."\n"; - // Login +// EMail +print ''."\n"; +// Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; print ''."\n"; print ''."\n"; } - // Birthday - print ''."\n"; - // Photo - print ''."\n"; - // Public - print ''."\n"; - // Other attributes - $tpl_context = 'public'; // define template context to public - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - // Comments - print ''; - print ''; - print ''; - print ''."\n"; +// Birthday +print ''."\n"; +// Photo +print ''."\n"; +// Public +print ''."\n"; +// Other attributes +$tpl_context = 'public'; // define template context to public +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; +// Comments +print ''; +print ''; +print ''; +print ''."\n"; // Add specific fields used by Dolibarr foundation for example if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { @@ -719,24 +721,24 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER print ' '.$langs->trans("Currency".$conf->currency); print ''; } - print "
'.$langs->trans('MemberNature').' *'."\n"; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); @@ -575,33 +576,34 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print ''; } - // Civility - print '
'.$langs->trans('UserTitle').''; - print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; - $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); - print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); - print '
'.$langs->trans("Company").'
'.$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').''; - $country_id = GETPOST('country_id'); + +// Civility +print '
'.$langs->trans('UserTitle').''; +print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Lastname").' *
'.$langs->trans("Firstname").' *
'.$langs->trans("Gender").''; +$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); +print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); +print '
'.$langs->trans("Company").'
'.$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').''; +$country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } @@ -616,10 +618,10 @@ if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { } } } - $country_code = getCountry($country_id, 2, $db, $langs); - print $form->select_country($country_id, 'country_id'); - print '
'.$langs->trans('State').''; if ($country_code) { @@ -627,30 +629,30 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print '
'.$langs->trans("Email").' *
'.$langs->trans("Email").' *
'.$langs->trans("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; - print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); - print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
'.$langs->trans("DateOfBirth").''; +print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); +print '
'.$langs->trans("URLPhoto").'
'.$langs->trans("Public").'
'.$langs->trans("Comments").'
\n"; +print "
\n"; - print dol_get_fiche_end(); +print dol_get_fiche_end(); - // Save - print '
'; - print ''; +// Save +print '
'; +print ''; if (!empty($backtopage)) { print '     '; } - print '
'; +print '
'; - print "\n"; - print "
"; - print ''; +print "\n"; +print "
"; +print ''; - llxFooterVierge(); +llxFooterVierge(); - $db->close(); +$db->close();