mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-22 09:21:30 +01:00
Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 22.0
This commit is contained in:
18
.github/workflows/ci-on-pull_request.yml
vendored
18
.github/workflows/ci-on-pull_request.yml
vendored
@@ -25,15 +25,15 @@ jobs:
|
|||||||
# uses: ./.github/workflows/windows-ci.yml
|
# uses: ./.github/workflows/windows-ci.yml
|
||||||
# with:
|
# with:
|
||||||
# gh_event: ${{ github.event_name }}
|
# gh_event: ${{ github.event_name }}
|
||||||
gh-travis: # Runs travis script on github runner (not on travis)
|
#gh-travis: # Runs travis script on github runner (not on travis)
|
||||||
if: false
|
# if: false
|
||||||
# needs: [pre-commit, phan]
|
# # needs: [pre-commit, phan]
|
||||||
# needs: [windows-ci]
|
# # needs: [windows-ci]
|
||||||
secrets: inherit
|
# secrets: inherit
|
||||||
needs: [pre-commit, phan, phpstan]
|
# needs: [pre-commit, phan, phpstan]
|
||||||
uses: ./.github/workflows/gh-travis.yml
|
# uses: ./.github/workflows/gh-travis.yml
|
||||||
with:
|
# with:
|
||||||
gh_event: ${{ github.event_name }}
|
# gh_event: ${{ github.event_name }}
|
||||||
|
|
||||||
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
|
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
|
||||||
# To cancel jobs if one fails, the following action may help
|
# To cancel jobs if one fails, the following action may help
|
||||||
|
|||||||
@@ -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 .= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as bd";
|
||||||
$sql .= " WHERE b.box_id = bd.rowid";
|
$sql .= " WHERE b.box_id = bd.rowid";
|
||||||
$sql .= " AND b.entity IN (0,".$conf->entity.")";
|
$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";
|
$sql .= " ORDER by b.position, b.box_order";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ if ($usergroup > 0) {
|
|||||||
$sql .= " DISTINCT";
|
$sql .= " DISTINCT";
|
||||||
}
|
}
|
||||||
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
|
$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_user_author, a.fk_user_action,";
|
||||||
$sql .= " a.fk_contact, a.note, a.percent as percent,";
|
$sql .= " a.fk_contact, a.note, a.percent as percent,";
|
||||||
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
|
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
|
||||||
|
|||||||
@@ -2294,7 +2294,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$style1 .= 'peruser_busy ';
|
$style1 .= 'peruser_busy ';
|
||||||
}
|
}
|
||||||
foreach ($cases1[$h] as $id => $ev) {
|
foreach ($cases1[$h] as $id => $ev) {
|
||||||
if ($ev['busy']) {
|
if (!empty($ev['busy'])) {
|
||||||
$style1 = 'onclickopenref peruser_busy';
|
$style1 = 'onclickopenref peruser_busy';
|
||||||
}
|
}
|
||||||
if (!empty($ev['css'])) {
|
if (!empty($ev['css'])) {
|
||||||
@@ -2314,7 +2314,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$style2 .= 'peruser_busy ';
|
$style2 .= 'peruser_busy ';
|
||||||
}
|
}
|
||||||
foreach ($cases2[$h] as $id => $ev) {
|
foreach ($cases2[$h] as $id => $ev) {
|
||||||
if ($ev['busy']) {
|
if (!empty($ev['busy'])) {
|
||||||
$style2 = 'onclickopenref peruser_busy';
|
$style2 = 'onclickopenref peruser_busy';
|
||||||
}
|
}
|
||||||
if (!empty($ev['css'])) {
|
if (!empty($ev['css'])) {
|
||||||
@@ -2334,7 +2334,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$style3 .= 'peruser_busy ';
|
$style3 .= 'peruser_busy ';
|
||||||
}
|
}
|
||||||
foreach ($cases3[$h] as $id => $ev) {
|
foreach ($cases3[$h] as $id => $ev) {
|
||||||
if ($ev['busy']) {
|
if (!empty($ev['busy'])) {
|
||||||
$style3 = 'onclickopenref peruser_busy';
|
$style3 = 'onclickopenref peruser_busy';
|
||||||
}
|
}
|
||||||
if (!empty($ev['css'])) {
|
if (!empty($ev['css'])) {
|
||||||
@@ -2354,7 +2354,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$style4 .= 'peruser_busy ';
|
$style4 .= 'peruser_busy ';
|
||||||
}
|
}
|
||||||
foreach ($cases4[$h] as $id => $ev) {
|
foreach ($cases4[$h] as $id => $ev) {
|
||||||
if ($ev['busy']) {
|
if (!empty($ev['busy'])) {
|
||||||
$style4 = 'onclickopenref peruser_busy';
|
$style4 = 'onclickopenref peruser_busy';
|
||||||
}
|
}
|
||||||
if (!empty($ev['css'])) {
|
if (!empty($ev['css'])) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
$HEIGHT = '192';
|
$HEIGHT = '192';
|
||||||
|
|
||||||
$stats = new FactureStats($this->db, $socid, $mode, 0);
|
$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),...)
|
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||||
if ($shownb) {
|
if ($shownb) {
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||||||
if ($user->hasRight('ticket', 'read')) {
|
if ($user->hasRight('ticket', 'read')) {
|
||||||
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
|
$sql = "SELECT CAST(t.datec AS DATE) as datec, COUNT(t.datec) as nb";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
$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)";
|
$sql .= " GROUP BY CAST(t.datec AS DATE)";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||||||
if ($user->hasRight('ticket', 'read')) {
|
if ($user->hasRight('ticket', 'read')) {
|
||||||
$sql = "SELECT ctt.rowid, ctt.label, ctt.code";
|
$sql = "SELECT ctt.rowid, ctt.label, ctt.code";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_type as ctt";
|
$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');
|
$sql .= $this->db->order('ctt.rowid', 'ASC');
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
@@ -116,7 +117,8 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||||||
$data = array();
|
$data = array();
|
||||||
$sql = "SELECT t.type_code, COUNT(t.type_code) as nb";
|
$sql = "SELECT t.type_code, COUNT(t.type_code) as nb";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
|
$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";
|
$sql .= " GROUP BY t.type_code";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
|||||||
*/
|
*/
|
||||||
class box_graph_ticket_by_severity extends ModeleBoxes
|
class box_graph_ticket_by_severity extends ModeleBoxes
|
||||||
{
|
{
|
||||||
public $boxcode = "box_ticket_by_severity";
|
public $boxcode = "box_graph_ticket_by_severity";
|
||||||
public $boximg = "ticket";
|
public $boximg = "ticket";
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
@@ -96,7 +96,8 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||||||
if ($user->hasRight('ticket', 'read')) {
|
if ($user->hasRight('ticket', 'read')) {
|
||||||
$sql = "SELECT cts.rowid, cts.label, cts.code";
|
$sql = "SELECT cts.rowid, cts.label, cts.code";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticket_severity as cts";
|
$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');
|
$sql .= $this->db->order('cts.rowid', 'ASC');
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
@@ -133,7 +134,8 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||||||
$data = array();
|
$data = array();
|
||||||
$sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb";
|
$sql = "SELECT t.severity_code, COUNT(t.severity_code) as nb";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "ticket as t";
|
$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";
|
$sql .= " GROUP BY t.severity_code";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
|
|||||||
@@ -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) {
|
if (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
|
||||||
$contactList = '';
|
$contactList = '';
|
||||||
foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) {
|
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 = new Contact($db);
|
||||||
$contact->fetch($cid);
|
$contact->fetch($cid);
|
||||||
$conf->cache['contact'][$histo[$key]['contact_id']] = $contact;
|
$conf->cache['contact'][$cid] = $contact;
|
||||||
} else {
|
} else {
|
||||||
$contact = $conf->cache['contact'][$histo[$key]['contact_id']];
|
$contact = $conf->cache['contact'][$cid];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact) {
|
if ($contact) {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class modTicket extends DolibarrModules
|
|||||||
$this->boxes = array(
|
$this->boxes = array(
|
||||||
0 => array('file' => 'box_last_ticket.php', 'enabledbydefaulton' => 'Home'),
|
0 => array('file' => 'box_last_ticket.php', 'enabledbydefaulton' => 'Home'),
|
||||||
1 => array('file' => 'box_last_modified_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'),
|
3 => array('file' => 'box_graph_nb_ticket_last_x_days.php', 'enabledbydefaulton' => 'ticketindex'),
|
||||||
4 => array('file' => 'box_graph_nb_tickets_type.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')
|
5 => array('file' => 'box_new_vs_close_ticket.php', 'enabledbydefaulton' => 'ticketindex')
|
||||||
|
|||||||
@@ -457,6 +457,9 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $permissiontoadd) {
|
if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $permissiontoadd) {
|
||||||
$object->fetch(GETPOSTINT('id'), '', GETPOST('track_id', 'alpha'));
|
$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
|
if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) { // Test on pemrission already done
|
||||||
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
||||||
|
|||||||
Reference in New Issue
Block a user