From 1d05531aa8f57a0e3483191c3f78347b41a18cdf Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 17 Mar 2020 10:10:54 +0100 Subject: [PATCH 01/27] fix wrong DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_ called --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1ed1327684c..318e6dec614 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1559,7 +1559,7 @@ else // Other attributes $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_create.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Assign a sale representative print ''; From cb43928a5d5659e0c25d247a915712f41ab07309 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 17 Mar 2020 12:29:14 +0100 Subject: [PATCH 02/27] Fix radio label target --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 611d7d791ec..c6220f647aa 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3017,7 +3017,7 @@ if ($action == 'create') // First situation invoice print '
'; $tmp = ' '; - $tmp = $tmp.''; + $tmp = $tmp.''; $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; From 075757eb3df5ec2412ef85166b1330bec4d79a27 Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 17 Mar 2020 16:49:05 +0100 Subject: [PATCH 03/27] Fix situation value transmission --- htdocs/compta/facture/card.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c6220f647aa..94298d14f29 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3304,14 +3304,28 @@ if ($action == 'create') } $retained_warranty = GETPOST('retained_warranty', 'int'); - $retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + if(empty($retained_warranty)){ + if(!empty($objectsrc->retained_warranty)){ // use previous situation value + $retained_warranty = $objectsrc->retained_warranty; + }else{ + $retained_warranty = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + } + } + print ''.$langs->trans('RetainedWarranty').''; print '%'; // Retained warranty payment term print ''.$langs->trans('PaymentConditionsShortRetainedWarranty').''; $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + if(empty($retained_warranty_fk_cond_reglement)){ + $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value + $retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement; + }else{ + $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; + } + } $form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1); print ''; From 1fe4e4415e07d428fa0e1e8bb2da1057c7c71722 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 18 Mar 2020 09:27:08 +0100 Subject: [PATCH 04/27] FIX: Bank movements color is not showing --- htdocs/compta/bank/bankentries_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 297f0dd91d4..d7951233f7b 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1157,14 +1157,14 @@ if ($resql) } else { $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR1; } - $backgroundcolor = 'style="background-color: '.$color.';"'; + $backgroundcolor = 'style="background: '.$color.';"'; } else { if (empty($conf->global->BANK_COLORIZE_MOVEMENT_COLOR2)) { $color = '#7fdb86'; } else { $color = '#'.$conf->global->BANK_COLORIZE_MOVEMENT_COLOR2; } - $backgroundcolor = 'style="background-color: '.$color.';"'; + $backgroundcolor = 'style="background: '.$color.';"'; } } print ''; From 2e1554def4be9c37232c9b4fe37242b8a966d97c Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 18 Mar 2020 10:18:52 +0100 Subject: [PATCH 05/27] FIX : wrong include - replace extrafields_create.tpl.php to extrafields_add.tpl.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1ed1327684c..318e6dec614 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1559,7 +1559,7 @@ else // Other attributes $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_create.tpl.php'; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Assign a sale representative print ''; From d3aeec0a7c773fe4c8356da60c863f73177ae9ba Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 18 Mar 2020 10:30:15 +0100 Subject: [PATCH 06/27] Fix situation value transmission --- htdocs/compta/facture/card.php | 13 ++++++++++++- htdocs/compta/facture/class/facture.class.php | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 94298d14f29..dc2eb2c5308 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1699,7 +1699,18 @@ if (empty($reshook)) $object->fk_facture_source = $_POST['situations']; $object->type = Facture::TYPE_SITUATION; - if (!empty($origin) && !empty($originid)) + + $object->retained_warranty = GETPOST('retained_warranty', 'int'); + $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + + $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); + if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) { + $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); + } + $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); +var_dump('la', $object->retained_warranty); + + if (!empty($origin) && !empty($originid)) { $object->origin = $origin; $object->origin_id = $originid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8c198b58a3e..c2c82424b77 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1052,6 +1052,11 @@ class Facture extends CommonInvoice $facture->situation_cycle_ref = $this->situation_cycle_ref; $facture->situation_final = $this->situation_final; + $facture->retained_warranty = $this->retained_warranty; + $facture->retained_warranty_fk_cond_reglement = $this->retained_warranty_fk_cond_reglement; + $facture->retained_warranty_date_limit = $this->retained_warranty_date_limit; + + // Loop on each line of new invoice foreach ($facture->lines as $i => $tmpline) { From 0a5f971eb514dda0f6cb1f42451a5f822f3c3d57 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 18 Mar 2020 09:32:34 +0000 Subject: [PATCH 07/27] Fixing style errors. --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dc2eb2c5308..26ea6a28f24 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1708,7 +1708,7 @@ if (empty($reshook)) $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); } $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); -var_dump('la', $object->retained_warranty); + var_dump('la', $object->retained_warranty); if (!empty($origin) && !empty($originid)) { From 7b8cafb710fce5979185df60aa5811cef03a3e3a Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 18 Mar 2020 10:34:44 +0100 Subject: [PATCH 08/27] remove var_dump --- htdocs/compta/facture/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index dc2eb2c5308..e75a8d35d7c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1708,7 +1708,6 @@ if (empty($reshook)) $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); } $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); -var_dump('la', $object->retained_warranty); if (!empty($origin) && !empty($originid)) { From c767e553d3bd5b78cb39e9f4354f7580134091ca Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 18 Mar 2020 10:59:13 +0100 Subject: [PATCH 09/27] fix import line from object default value for situations --- htdocs/compta/facture/card.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c6220f647aa..f30e858f7f2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2541,7 +2541,12 @@ if (empty($reshook)) $pa_ht = $originLine->pa_ht; $label = $originLine->label; $array_options = $originLine->array_options; - $situation_percent = 100; + if($object->type == Facture::TYPE_SITUATION){ + $situation_percent = 0; + } + else{ + $situation_percent = 100; + } $fk_prev_id = ''; $fk_unit = $originLine->fk_unit; $pu_ht_devise = $originLine->multicurrency_subprice; From 56e4fa1bb3c3e6131be211ff21a922afb3ce9614 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 14:01:11 +0100 Subject: [PATCH 10/27] Trans --- dev/translation/txpull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/translation/txpull.sh b/dev/translation/txpull.sh index 3f24bd0912d..fcccae98221 100755 --- a/dev/translation/txpull.sh +++ b/dev/translation/txpull.sh @@ -54,5 +54,5 @@ fi echo Think to launch also: echo "> dev/tools/fixaltlanguages.sh fix all" -echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with ''" +echo "For v11: Replace also regex \(.*(sponge|cornas|eratosthene|cyan).*\) with '' on *.lang files" From cc93a40c4582fe9105b17b91ecedebdee4e538cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 14:06:15 +0100 Subject: [PATCH 11/27] Fix label of local tax --- htdocs/core/modules/modFacture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 984e28f4e31..991cd571f3e 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -216,7 +216,7 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', 'none.rest'=>'Rest', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", @@ -303,7 +303,7 @@ class modFacture extends DolibarrModules 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer', 'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT", - 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LocalTax1', 'f.localtax2'=>'LocalTax2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', + 'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'f.localtax1'=>'LT1', 'f.localtax2'=>'LT2', 'f.paye'=>"InvoicePaidCompletely", 'f.fk_statut'=>'InvoiceStatus', 'f.close_code'=>'EarlyClosingReason', 'f.close_note'=>'EarlyClosingComment', 'none.rest'=>'Rest', 'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin', 'f.fk_user_valid'=>'ValidatedById', 'uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'pj.title'=>'ProjectLabel', 'p.rowid'=>'PaymentId', 'p.ref'=>'PaymentRef', From a3328c5ef3b238414cd198f1beaa58117c5a760e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 18:37:44 +0100 Subject: [PATCH 12/27] Fix div --- htdocs/core/tpl/contacts.tpl.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index b5df248b590..a9297d8c2e6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -66,11 +66,12 @@ $userstatic = new User($db); ?> -
-
-
-
'."\n"; +print '
'."\n"; +print '
'."\n"; + if ($permission) { ?>
From 54d3703c42af1b3837973a2ea58177655c180904 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Mar 2020 19:45:47 +0100 Subject: [PATCH 13/27] Prepare 11.0.3 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 59b02bad4be..97923801971 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ FIX: Remove unexisting link FIX: substitute lines dates values on doc generator (ODT, ...) FIX: Ticket - Load Cache Messages Ticket, wrong message's status FIX: Ticket Public - Private messages are displayed +FIX: wrong include - replace extrafields_create.tpl.php to extrafields_add.tpl.php ***** ChangeLog for 11.0.2 compared to 11.0.1 ***** FIX: #10309 From d38c6616e6a8dddb902346109128d1982d1fc9b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 09:53:20 +0100 Subject: [PATCH 14/27] Doc --- htdocs/core/class/commonobject.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f5553032a09..c193ae977dc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4086,7 +4086,7 @@ abstract class CommonObject */ public function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0, $defaulttpldir = '/core/tpl') { - global $conf, $hookmanager, $langs, $user, $object, $form, $extrafields; + global $conf, $hookmanager, $langs, $user, $form, $extrafields, $object; // TODO We should not use global var for this global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; @@ -4110,6 +4110,7 @@ abstract class CommonObject { // Output template part (modules that overwrite templates must declare this into descriptor) // Use global variables + $dateSelector + $seller and $buyer + // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { From 8e1ffa51444b87368915aea3aed81599fa01198a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 10:52:07 +0100 Subject: [PATCH 15/27] Fix management of token --- htdocs/compta/accounting-files.php | 12 +++++++++--- htdocs/core/lib/functions.lib.php | 13 ++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index af18b834edf..cb2c3d2fdff 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -16,11 +16,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/** + + /** * \file htdocs/compta/accounting-files.php * \ingroup compta * \brief Page to show portoflio and files of a thirdparty and download it */ + +if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file + if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +} + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -106,7 +112,7 @@ $error = 0; $filesarray = array(); $result = false; -if (($action == "searchfiles" || $action == "dl")) { +if (($action == 'searchfiles' || $action == 'dl')) { if (empty($date_start)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart")), null, 'errors'); @@ -459,7 +465,7 @@ if (!empty($date_start) && !empty($date_stop)) $param .= '&date_stopyear='.GETPOST('date_stopyear', 'int'); print ''."\n"; - print ''; + print ''; echo dol_print_date($date_start, 'day')." - ".dol_print_date($date_stop, 'day'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9842a3d59e0..6976b5fec40 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8574,7 +8574,8 @@ function isAFileWithExecutableContent($filename) } /** - * Return new session token + * Return the value of token currently saved into session with name 'newtoken'. + * This token must be send by any POST as it will be used by next page for comparison with value in session. * * @return string */ @@ -8582,3 +8583,13 @@ function newToken() { return $_SESSION['newtoken']; } + +/** + * Return the value of token currently saved into session with name 'token'. + * + * @return string + */ +function currentToken() +{ + return $_SESSION['token']; +} From 7eb45226364630cfe01d14bc15f5f835ada90219 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 11:59:57 +0100 Subject: [PATCH 16/27] FIX missing token and save of survey description --- htdocs/admin/modules.php | 2 +- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/opensurvey/card.php | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 21d54908cf1..72eb8240c10 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -930,7 +930,7 @@ if ($mode == 'marketplace') ?> - +
trans('Keyword') ?>:
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6976b5fec40..6e71125cbd5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -508,6 +508,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) { + $reg = array(); $maxloop = 20; $loopnb = 0; // Protection against infinite loop while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. { @@ -5579,7 +5580,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1) $allowed_tags_string = '<'.$allowed_tags_string.'>'; if ($cleanalsosomestyles) { - $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to avoid this, string should be encoded by the dol_htmlentitiesbr so be harmless + $stringtoclean = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/', '', $stringtoclean); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless } $temp = strip_tags($stringtoclean, $allowed_tags_string); diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 302ecf5f1ff..28b8f2a7640 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -113,8 +113,8 @@ if (empty($reshook)) if (!$error) { $object->titre = GETPOST('nouveautitre', 'nohtml'); - $object->commentaires = GETPOST('nouveauxcommentaires', 'nohtml'); - $object->description = GETPOST('nouveauxcommentaires', 'nohtml'); + $object->commentaires = GETPOST('nouveauxcommentaires', 'restricthtml'); + $object->description = GETPOST('nouveauxcommentaires', 'restricthtml'); $object->mail_admin = GETPOST('nouvelleadresse', 'alpha'); $object->date_fin = $expiredate; $object->allow_comments = GETPOST('cancomment', 'alpha') == 'on' ? true : false; @@ -208,6 +208,7 @@ $toutsujet = str_replace("@", "
", $toutsujet); $toutsujet = str_replace("°", "'", $toutsujet); print ''."\n"; +print ''; print ''; $head = opensurvey_prepare_head($object); @@ -395,6 +396,7 @@ print '
'; print ''."\n"; +print ''; print load_fiche_titre($langs->trans("CommentsOfVoters"), '', ''); From c71da5d0132a689314ebae38f13405116b563111 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 15:43:06 +0100 Subject: [PATCH 17/27] FIX mass action on stock movements --- htdocs/core/actions_massactions.inc.php | 2 + .../stock/class/mouvementstock.class.php | 13 +++ htdocs/product/stock/movement_list.php | 84 ++++++++++++------- 3 files changed, 70 insertions(+), 29 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index c3f046431b0..17e063244df 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1215,6 +1215,8 @@ if (!$error && $massaction == 'closed' && $objectclass == "Propal" && $permissio $db->rollback(); } } + + // Delete record from mass action (massaction = 'delete' for direct delete, action/confirm='delete'/'yes' with a confirmation step before) if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 9e8dcc3184e..7b92af43ef0 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1134,4 +1134,17 @@ class MouvementStock extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index dea7580aeb7..48806ce51b8 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -54,8 +54,11 @@ $ref = GETPOST('ref', 'alpha'); $msid = GETPOST('msid', 'int'); $product_id = GETPOST("product_id", 'int'); $action = GETPOST('action', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'movementlist'; +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list // Security check //$result=restrictedArea($user, 'stock', $id, 'entrepot&stock'); @@ -123,15 +126,19 @@ if (!$user->rights->stock->mouvement->lire) { accessforbidden(); } +$permissiontoread = $user->rights->stock->mouvement->lire; +$permissiontoadd = $user->rights->stock->mouvement->creer; +$permissiontodelete = $user->rights->stock->mouvement->creer; // There is no deletion permission for stock movement as we shoul dnever delete + +$usercanread = $user->rights->stock->mouvement->lire; +$usercancreate = $user->rights->stock->mouvement->creer; +$usercandelete = $user->rights->stock->mouvement->creer; + /* * Actions */ -$usercanread = (($user->rights->stock->mouvement->lire)); -$usercancreate = (($user->rights->stock->mouvement->creer)); -$usercandelete = (($user->rights->stock->mouvement->supprimer)); - if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } @@ -139,26 +146,35 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - -// Do we click on purge search criteria ? -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers +if (empty($reshook)) { - $year = ''; - $month = ''; - $search_ref = ''; - $search_movement = ""; - $search_type_mouvement = ""; - $search_inventorycode = ""; - $search_product_ref = ""; - $search_product = ""; - $search_warehouse = ""; - $search_user = ""; - $search_batch = ""; - $search_qty = ''; - $sall = ""; - $toselect = ''; - $search_array_options = array(); + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Do we click on purge search criteria ? + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // Both test are required to be compatible with all browsers + { + $year = ''; + $month = ''; + $search_ref = ''; + $search_movement = ""; + $search_type_mouvement = ""; + $search_inventorycode = ""; + $search_product_ref = ""; + $search_product = ""; + $search_warehouse = ""; + $search_user = ""; + $search_batch = ""; + $search_qty = ''; + $sall = ""; + $toselect = ''; + $search_array_options = array(); + } + + // Mass actions + $objectclass = 'MouvementStock'; + $objectlabel = 'MouvementStock'; + $uploaddir = $conf->stock->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } // Correct stock @@ -600,8 +616,8 @@ if ($resql) $resqlbis = $db->query($sql); if ($resqlbis) { - $obj = $db->fetch_object($resqlbis); - $lastmovementdate = $db->jdate($obj->datem); + $objbis = $db->fetch_object($resqlbis); + $lastmovementdate = $db->jdate($objbis->datem); } else { @@ -694,8 +710,9 @@ if ($resql) // 'presend'=>$langs->trans("SendByMail"), // 'builddoc'=>$langs->trans("PDFMerge"), ); - //if ($user->rights->stock->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); - if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); + // 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"); + if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); print ''; @@ -713,6 +730,13 @@ if ($resql) if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit); else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); + // Add code for pre mass action (confirmation or email presend form) + $topicmail = "SendStockMovement"; + $modelmail = "movementstock"; + $objecttmp = new MouvementStock($db); + $trackid = 'mov'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + if ($sall) { foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val); @@ -961,6 +985,8 @@ if ($resql) $arrayofuniqueproduct = array(); + $i = 0; + $totalarray = array(); while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); @@ -1126,8 +1152,8 @@ if ($resql) if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) $selected = 1; - print ''; + if (in_array($objp->mid, $arrayofselected)) $selected = 1; + print ''; } print ''; if (!$i) $totalarray['nbfield']++; From 9be4b28bea0d5a836051482cad3fabf68770aabc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 15:43:55 +0100 Subject: [PATCH 18/27] FIX mass action on stock movements --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 97923801971..fea73254f20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ FIX: missing global $conf FIX: Missing token in some forms (avoid unset POST errors) FIX: params of setEventMessage($langs->trans('ErrorProductClone')... FIX: Remove unexisting link +FIX: mass action on stock movements FIX: substitute lines dates values on doc generator (ODT, ...) FIX: Ticket - Load Cache Messages Ticket, wrong message's status FIX: Ticket Public - Private messages are displayed From d9f616d6e3c0ce9cd5ba15d4031fd7b1b46f9ba7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 15:59:49 +0100 Subject: [PATCH 19/27] Avoid file xxx_preview-1.png into export --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index cb2c3d2fdff..4eb368e72df 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -241,7 +241,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { { $result = true; - $files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', '', SORT_ASC, 1); + $files = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); //var_dump($upload_dir); //var_dump($files); From a413e2861e4f3bef054eb09fd8fdc4c55c6a4709 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 21:13:15 +0100 Subject: [PATCH 20/27] Fix edit html --- htdocs/compta/deplacement/card.php | 4 ++-- htdocs/opensurvey/card.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index cabc3510ea4..c08be32242b 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -281,7 +281,7 @@ if ($action == 'create') print ''.$langs->trans('NotePublic').''; print ''; - $doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%'); + $doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%'); print $doleditor->Create(1); print ''; @@ -293,7 +293,7 @@ if ($action == 'create') print ''.$langs->trans('NotePrivate').''; print ''; - $doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%'); + $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, '90%'); print $doleditor->Create(1); print ''; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 28b8f2a7640..64b270799a2 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -249,12 +249,12 @@ print ''; print ''.$langs->trans("Description").''; if ($action == 'edit') { - $doleditor = new DolEditor('nouveauxcommentaires', dol_htmlentities($object->commentaires), '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); + $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%'); $doleditor->Create(0, ''); } else { - print (dol_textishtml($object->commentaires) ? $object->commentaires : dol_nl2br($object->commentaires, 1, true)); + print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)); } print ''; @@ -264,7 +264,7 @@ if (!$object->fk_user_creat) { print ''.$langs->trans("EMail").''; if ($action == 'edit') { - print ''; + print ''; } else print dol_print_email($object->mail_admin, 0, 0, 1); print ''; From 87e808fec4d5116f4b5561fbd060bf85160603cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Mar 2020 22:07:20 +0100 Subject: [PATCH 21/27] Fix phpcs --- htdocs/compta/accounting-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 4eb368e72df..b8e10e7d0e3 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -24,7 +24,7 @@ */ if ($_GET['action'] == 'dl' || $_POST['action'] == 'dl') { // To not replace token when downloading file - if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); + if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); } require '../main.inc.php'; From f7b4e48d599844a532a5ee8e8d1b9e3dfb99c7cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 10:51:26 +0100 Subject: [PATCH 22/27] Code comment --- build/makepack-dolibarr.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f68ca6a77f5..c6b8cd330c8 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------- # \file build/makepack-dolibarr.pl # \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps) -# \author (c)2004-2015 Laurent Destailleur +# \author (c)2004-2020 Laurent Destailleur # # This is list of constant you can set to have generated packages moved into a specific dir: #DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild' @@ -430,12 +430,14 @@ if ($nboftargetok) { $ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`; print 'Run git push -f --tags'."\n"; $ret=`git push -f --tags`; + #$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`; } } else { print 'Run git push --tags'."\n"; $ret=`git push --tags`; + #$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`; } chdir("$olddir"); } From d28eaf5824df48d59da0f14c162ec2e39c58c93f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 15:47:50 +0100 Subject: [PATCH 23/27] FIX Backto link --- htdocs/website/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ac255693b0d..88a369efdf2 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3397,6 +3397,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''.$answerrecord->description.''; print ''; $param = '?action=replacesiteconfirm'; + $param .= '&websiteid='.$website->id; $param .= '&optioncontent='.GETPOST('optioncontent'); $param .= '&optionmeta='.GETPOST('optionmeta'); $param .= '&optionsitefiles='.GETPOST('optionsitefiles'); From 5d9e713a1c6a52e31fdd67ad1f74ff6e22d6c1de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 20:36:26 +0100 Subject: [PATCH 24/27] Fix better default sort order --- htdocs/comm/mailing/cibles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 41e49ed09b3..b9f6396578e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -48,8 +48,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) $sortfield = "email"; -if (!$sortorder) $sortorder = "ASC"; +if (!$sortfield) $sortfield = "mc.statut,email"; +if (!$sortorder) $sortorder = "DESC,ASC"; $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); From 599bf89f60e2a28973ac86926fa12d8d78068f77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 20:46:21 +0100 Subject: [PATCH 25/27] Fix can edit emailing after sending has started --- htdocs/comm/mailing/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 0900c5b032c..a21ea9d7d0a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -992,7 +992,7 @@ else print ''.$langs->trans("SetToDraft").''; } - if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer) + if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) { if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) { From 3e807b00ba9dd3e998176b85b10f5bbe81bf2f87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 21:16:52 +0100 Subject: [PATCH 26/27] FIX Look and feel v11 --- htdocs/opensurvey/fonctions.php | 69 +++++++++++++++++++----- htdocs/opensurvey/results.php | 2 +- htdocs/opensurvey/wizard/choix_autre.php | 2 +- htdocs/public/opensurvey/studs.php | 7 ++- 4 files changed, 60 insertions(+), 20 deletions(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 69dd0d4e0a7..22cd78ae8d7 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -67,31 +67,70 @@ function opensurvey_prepare_head(Opensurveysondage $object) * @param int $disablehead More content into html header * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files + * @param string $numsondage Num survey * @return void */ -function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $numsondage = '') { - global $conf, $mysoc; + global $conf, $langs, $mysoc; + global $dolibarr_main_url_root; + + //$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - print ''; + print ''; - // Print logo - if ($mysoc->logo) { - if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } - } - if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))) + + print ''."\n"; + print '
'."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print "\n"; + + + // Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) + $width = 0; + // Define logo and logosmall + $logosmall = $mysoc->logo_small; + $logo = $mysoc->logo; + $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; + if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo; + elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; + //print ''."\n"; + // Define urllogo + $urllogo = ''; + $urllogofull = ''; + if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $width = 150; + } + elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) + { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $width = 150; } - print '
Logo
'; - print '
'; + // Output html code for logo + if ($urllogo) + { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } - print '
'; + print '

'; } /** @@ -102,6 +141,8 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ function llxFooterSurvey() { print '
'; + print ''; + print '
'; printCommonFooter('public'); diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index a9b726a646b..beed90e3fdd 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1093,6 +1093,6 @@ print ''."\n"; print ''."\n"; -llxFooterSurvey(); +llxFooter(); $db->close(); diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index cb3ed346a52..7a31e21c843 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -110,7 +110,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss if (empty($_SESSION['titre'])) { dol_print_error('', $langs->trans('ErrorOpenSurveyFillFirstSection')); - llxFooterSurvey(); + llxFooter(); exit; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index ab011dd219a..c9697e2e1e4 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -250,7 +250,8 @@ $form = new Form($db); $arrayofjs = array(); $arrayofcss = array('/opensurvey/css/style.css'); -llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); + +llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss, $numsondage); if (empty($object->ref)) // For survey, id is a hex string { @@ -274,6 +275,7 @@ foreach ($toutsujet as $value) $toutsujet = str_replace("°", "'", $toutsujet); + print '
'.$langs->trans("YouAreInivitedToVote").'
'; print $langs->trans("OpenSurveyHowTo").'

'; @@ -301,9 +303,6 @@ if (!$canbemodified) { exit; } -print '
'."\n"; -print ''; - print '
'."\n"; print '

'."\n"; From ade07865d6367d400d2c13738d336b30228189d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Mar 2020 21:19:43 +0100 Subject: [PATCH 27/27] FIX Look and feel v11 --- htdocs/opensurvey/fonctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 22cd78ae8d7..eb1a20800ce 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -130,7 +130,7 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; } - print '

'; + print '

'; } /**