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

Conflicts:
	htdocs/core/class/extrafields.class.php
This commit is contained in:
Laurent Destailleur 2021-09-10 20:50:34 +02:00
commit 9dcf3e49d0
4 changed files with 33 additions and 11 deletions

View File

@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) {
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
if ($user->rights->categorie->creer) {
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>';
}
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
if ($user->rights->categorie->supprimer) {
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>';
}
$entry .= '</td>';
$entry .= '</tr>';

View File

@ -1359,7 +1359,7 @@ class Form
$sql .= " AND s.status <> 0";
}
if (!empty($excludeids)) {
$sql .= " AND rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
$sql .= " AND s.rowid NOT IN (".$this->db->sanitize(join(',', $excludeids)).")";
}
// Add criteria
if ($filterkey && $filterkey != '') {

View File

@ -1548,7 +1548,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= "OR (";
}
if (!empty($code)) {
addEventTypeSQL($sql, $code, $donetodo, $now, $filters, "");
addEventTypeSQL($sql, $code);
}
if ($key != 0) {
$sql .= ")";
@ -1556,9 +1556,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$sql .= ')';
} elseif (!empty($actioncode)) {
addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
addEventTypeSQL($sql, $actioncode);
}
addOtherFilterSQL($sql, $donetodo, $now, $filters);
if (is_array($actioncode)) {
foreach ($actioncode as $code) {
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
@ -2021,13 +2023,10 @@ function show_subsidiaries($conf, $langs, $db, $object)
*
* @param string $sql $sql modified
* @param string $actioncode Action code
* @param string $donetodo donetodo
* @param string $now now
* @param string $filters array
* @param string $sqlANDOR "AND", "OR" or "" sql condition
* @return string sql request
*/
function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDOR = "AND")
function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
{
global $conf, $db;
// Condition on actioncode
@ -2054,6 +2053,23 @@ function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDO
}
}
return $sql;
}
/**
* Add Event Type SQL
*
* @param string $sql $sql modified
* @param string $donetodo donetodo
* @param string $now now
* @param string $filters array
* @return string sql request
*/
function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
{
global $conf, $db;
// Condition on actioncode
if ($donetodo == 'todo') {
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
} elseif ($donetodo == 'done') {

View File

@ -119,10 +119,12 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) {
}
if (!empty($excludeids)) {
$filter .= 'rowid NOT IN ('.$db->sanitize($excludeids).')';
$excludeids = explode(',', $excludeids);
} else {
$excludeids = array();
}
$arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson);
$arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0, 'minwidth100', '', false, $excludeids);
$db->close();