Skip to content

Commit

Permalink
Debug v21
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 3, 2025
1 parent 11eee91 commit 113a59a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions htdocs/comm/action/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@
$showbirthday = empty($conf->use_javascript_ajax) ? GETPOSTINT("showbirthday") : 1;
$search_categ_cus = GETPOST("search_categ_cus", 'intcomma', 3) ? GETPOST("search_categ_cus", 'intcomma', 3) : 0;

// If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user.
// If no choice done on calendar owner (like on left menu link "Agenda"), we filter on current user by default.
if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) {
$filtert = "".$user->id;
$filtert = (string) $user->id;
}
//TODO : debug : if filtert ON : no bookcal -> nothing is altering filtert ???
$filtert="-1";

$newparam = '';

Expand Down Expand Up @@ -110,7 +108,7 @@
$canedit = 0;
}
if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // If no permission to see all, we show only affected to me
$filtert = $user->id;
$filtert = (string) $user->id;
}

$action = GETPOST('action', 'aZ09');
Expand Down Expand Up @@ -601,9 +599,9 @@
$sql .= " ON bc.rowid = ba.fk_bookcal_calendar";
$sql .= " WHERE bc.status = 1";
$sql .= " AND ba.status = 1";
$sql .= " AND bc.entity IN (".getEntity('agenda').")";
if (!empty($filtert) && $filtert != -1) {
$sql .= " AND bc.visibility = ".(int) $filtert ;
$sql .= " AND bc.entity IN (".getEntity('bookcal_calendar').")";
if (!empty($filtert) && $filtert != '-1') {
$sql .= " AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).")";
}
$resql = $db->query($sql);
if ($resql) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/db/DoliDB.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function lasterrno()
/**
* Sanitize a string for SQL forging
*
* @param string $stringtosanitize String to escape
* @param string $stringtosanitize String to sanitize
* @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...)
* @param int $allowsequals 1=Allow equals sign
* @param int $allowsspace 1=Allow space char
Expand Down

0 comments on commit 113a59a

Please sign in to comment.