Browse Source

Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/compta/bank/bankentries_list.php
	htdocs/opensurvey/card.php
	htdocs/opensurvey/index.php
	htdocs/opensurvey/results.php
Laurent Destailleur 4 years ago
parent
commit
d2ef4b0506

+ 3 - 3
htdocs/compta/bank/bankentries_list.php

@@ -10,7 +10,6 @@
  * Copyright (C) 2018       Ferran Marcet        <fmarcet@2byte.es>
  * Copyright (C) 2018       Frédéric France         <frederic.france@netlogic.fr>
  * Copyright (C) 2021       Gauthier VERDOL         <gauthier.verdol@atm-consulting.fr>
-
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -644,11 +643,12 @@ if ($search_description) {
 	}
 	$sql .= natural_search("b.label", $search_description_to_use); // Warning some text are just translation keys, not translated strings
 }
+
 if ($search_bid > 0) {
-	$sql .= " AND b.rowid=l.lineid AND l.fk_categ=".$search_bid;
+	$sql .= " AND b.rowid = l.lineid AND l.fk_categ = ".((int) $search_bid);
 }
 if (!empty($search_type)) {
-	$sql .= " AND b.fk_type = '".$db->escape($search_type)."' ";
+	$sql .= " AND b.fk_type = '".$db->escape($search_type)."'";
 }
 // Search criteria amount
 if ($search_debit) {

+ 1 - 1
htdocs/opensurvey/card.php

@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
 
 
 // Security check
-if (!$user->rights->opensurvey->read) {
+if (empty($user->rights->opensurvey->read)) {
 	accessforbidden();
 }
 

+ 5 - 0
htdocs/opensurvey/exportcsv.php

@@ -40,6 +40,11 @@ if ($result <= 0) {
 	dol_print_error('', 'Failed to get survey id '.$numsondage);
 }
 
+// Security check
+if (empty($user->rights->opensurvey->read)) {
+	accessforbidden();
+}
+
 
 /*
  * Actions

+ 0 - 1
htdocs/opensurvey/fonctions.php

@@ -31,7 +31,6 @@
  */
 function opensurvey_prepare_head(Opensurveysondage $object)
 {
-
 	global $langs, $conf;
 
 	$h = 0;

+ 1 - 1
htdocs/opensurvey/index.php

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
 $langs->load("opensurvey");
 
 // Security check
-if (!$user->rights->opensurvey->read) {
+if (empty($user->rights->opensurvey->read)) {
 	accessforbidden();
 }
 

+ 5 - 4
htdocs/opensurvey/results.php

@@ -29,13 +29,11 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
 require_once DOL_DOCUMENT_ROOT."/opensurvey/class/opensurveysondage.class.php";
 require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php";
 
-
 // Security check
-if (!$user->rights->opensurvey->read) {
+if (empty($user->rights->opensurvey->read)) {
 	accessforbidden();
 }
 
-
 // Init vars
 $action = GETPOST('action', 'aZ09');
 $numsondage = GETPOST("id");
@@ -594,7 +592,10 @@ if (GETPOST('ajoutsujet')) {
 }
 
 if ($user->rights->opensurvey->write) {
-	print '<span class="opacitymedium">'.$langs->trans("PollAdminDesc", img_picto('', 'delete'), $langs->trans("Add")).'</span><br>';
+	print '<span class="opacitymedium">';
+	$s = $langs->trans("PollAdminDesc", '{s1}', $langs->trans("Add"));
+	print str_replace('{s1}', img_picto('', 'delete'), $s);
+	print '</span><br>';
 }
 
 $nbcolonnes = substr_count($object->sujet, ',') + 1;