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

This commit is contained in:
Laurent Destailleur
2025-10-24 19:39:15 +02:00
11 changed files with 34 additions and 26 deletions

View File

@@ -25,15 +25,15 @@ jobs:
# uses: ./.github/workflows/windows-ci.yml
# with:
# gh_event: ${{ github.event_name }}
gh-travis: # Runs travis script on github runner (not on travis)
if: false
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}
#gh-travis: # Runs travis script on github runner (not on travis)
# if: false
# # needs: [pre-commit, phan]
# # needs: [windows-ci]
# secrets: inherit
# needs: [pre-commit, phan, phpstan]
# uses: ./.github/workflows/gh-travis.yml
# with:
# gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help

View File

@@ -238,7 +238,7 @@ $sql .= " bd.rowid as boxid";
$sql .= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as bd";
$sql .= " WHERE b.box_id = bd.rowid";
$sql .= " AND b.entity IN (0,".$conf->entity.")";
$sql .= " AND b.fk_user=0";
$sql .= " AND b.fk_user = 0";
$sql .= " ORDER by b.position, b.box_order";
//print $sql;

View File

@@ -429,7 +429,7 @@ if ($usergroup > 0) {
$sql .= " DISTINCT";
}
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location, a.entity,";
$sql .= " a.fk_user_author, a.fk_user_action,";
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";

View File

@@ -2294,7 +2294,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style1 .= 'peruser_busy ';
}
foreach ($cases1[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style1 = 'onclickopenref peruser_busy';
}
if (!empty($ev['css'])) {
@@ -2314,7 +2314,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style2 .= 'peruser_busy ';
}
foreach ($cases2[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style2 = 'onclickopenref peruser_busy';
}
if (!empty($ev['css'])) {
@@ -2334,7 +2334,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style3 .= 'peruser_busy ';
}
foreach ($cases3[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style3 = 'onclickopenref peruser_busy';
}
if (!empty($ev['css'])) {
@@ -2354,7 +2354,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style4 .= 'peruser_busy ';
}
foreach ($cases4[$h] as $id => $ev) {
if ($ev['busy']) {
if (!empty($ev['busy'])) {
$style4 = 'onclickopenref peruser_busy';
}
if (!empty($ev['css'])) {

View File

@@ -132,7 +132,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$HEIGHT = '192';
$stats = new FactureStats($this->db, $socid, $mode, 0);
$stats->where = "f.fk_statut > 0";
$stats->where = "f.entity IN (".getEntity('supplier_invoice').") AND f.fk_statut > 0";
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($shownb) {

View File

@@ -109,7 +109,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
if ($user->hasRight('ticket', 'read')) {
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
$sql .= " WHERE CAST(t.datec AS DATE) > '".$this->db->idate($minimumdatec)."'";
$sql .= " WHERE t.entity IN (".getEntity('ticket').")";
$sql .= " AND CAST(t.datec AS DATE) > '".$this->db->idate($minimumdatec)."'";
$sql .= " GROUP BY CAST(t.datec AS DATE)";
$resql = $this->db->query($sql);

View File

@@ -84,7 +84,8 @@ class box_graph_nb_tickets_type extends ModeleBoxes
if ($user->hasRight('ticket', 'read')) {
$sql = "SELECT ctt.rowid, ctt.label, ctt.code";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_type as ctt";
$sql .= " WHERE ctt.active = 1";
$sql .= " WHERE ctt.entity IN (".getEntity('c_ticket_type').")";
$sql .= " AND ctt.active = 1";
$sql .= $this->db->order('ctt.rowid', 'ASC');
$resql = $this->db->query($sql);
@@ -116,7 +117,8 @@ class box_graph_nb_tickets_type extends ModeleBoxes
$data = array();
$sql = "SELECT t.type_code, COUNT(t.type_code) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " WHERE t.fk_statut <> 8";
$sql .= " WHERE t.entity IN (".getEntity('ticket').")";
$sql .= " AND t.fk_statut <> 8";
$sql .= " GROUP BY t.type_code";
$resql = $this->db->query($sql);
if ($resql) {

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
*/
class box_graph_ticket_by_severity extends ModeleBoxes
{
public $boxcode = "box_ticket_by_severity";
public $boxcode = "box_graph_ticket_by_severity";
public $boximg = "ticket";
/**
* @var string
@@ -96,7 +96,8 @@ class box_graph_ticket_by_severity extends ModeleBoxes
if ($user->hasRight('ticket', 'read')) {
$sql = "SELECT cts.rowid, cts.label, cts.code";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_severity as cts";
$sql .= " WHERE cts.active = 1";
$sql .= " WHERE cts.entity IN (".getEntity('c_ticket_severity').")";
$sql .= " AND cts.active = 1";
$sql .= $this->db->order('cts.rowid', 'ASC');
$resql = $this->db->query($sql);
@@ -133,7 +134,8 @@ class box_graph_ticket_by_severity extends ModeleBoxes
$data = array();
$sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
$sql .= " WHERE t.fk_statut <> 8";
$sql .= " WHERE t.entity IN (".getEntity('ticket').")";
$sql .= " AND t.fk_statut <> 8";
$sql .= " GROUP BY t.severity_code";
$resql = $this->db->query($sql);
if ($resql) {

View File

@@ -15654,12 +15654,12 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null,
if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
$contactList = '';
foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) {
if (empty($conf->cache['contact'][$histo[$key]['contact_id']])) {
if (empty($conf->cache['contact'][$cid])) {
$contact = new Contact($db);
$contact->fetch($cid);
$conf->cache['contact'][$histo[$key]['contact_id']] = $contact;
$conf->cache['contact'][$cid] = $contact;
} else {
$contact = $conf->cache['contact'][$histo[$key]['contact_id']];
$contact = $conf->cache['contact'][$cid];
}
if ($contact) {

View File

@@ -211,7 +211,7 @@ class modTicket extends DolibarrModules
$this->boxes = array(
0 => array('file' => 'box_last_ticket.php', 'enabledbydefaulton' => 'Home'),
1 => array('file' => 'box_last_modified_ticket.php', 'enabledbydefaulton' => 'Home'),
2 => array('file' => 'box_ticket_by_severity.php', 'enabledbydefaulton' => 'ticketindex'),
2 => array('file' => 'box_graph_ticket_by_severity.php', 'enabledbydefaulton' => 'ticketindex'),
3 => array('file' => 'box_graph_nb_ticket_last_x_days.php', 'enabledbydefaulton' => 'ticketindex'),
4 => array('file' => 'box_graph_nb_tickets_type.php', 'enabledbydefaulton' => 'ticketindex'),
5 => array('file' => 'box_new_vs_close_ticket.php', 'enabledbydefaulton' => 'ticketindex')

View File

@@ -457,6 +457,9 @@ if (empty($reshook)) {
if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $permissiontoadd) {
$object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha'));
if (GETPOSTISSET('contactid')) {
$object->context['contact_id'] = GETPOSTINT('contactid');
}
if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) { // Test on pemrission already done
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');