mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Merge pull request #12112 from frederic34/patch-17
Update box_last_modified_ticket.php
This commit is contained in:
@@ -47,7 +47,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
@@ -71,7 +71,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
|
||||
$this->max = $max;
|
||||
|
||||
dol_include_once("/ticket/class/ticket.class.php");
|
||||
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
|
||||
|
||||
$text = $langs->trans("BoxLastModifiedTicketDescription", $max);
|
||||
$this->info_box_head = array(
|
||||
@@ -87,7 +87,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
if ($user->rights->ticket->read) {
|
||||
$sql = "SELECT t.rowid as id, t.ref, t.track_id, t.fk_soc, t.fk_user_create, t.fk_user_assign, t.subject, t.message, t.fk_statut, t.type_code, t.category_code, t.severity_code, t.datec, t.date_read, t.date_close, t.origin_email ";
|
||||
$sql.= ", type.label as type_label, category.label as category_label, severity.label as severity_label";
|
||||
$sql.= ", s.nom as company_name";
|
||||
$sql.= ", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."ticket as t";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
|
||||
@@ -107,7 +107,6 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$now=gmmktime();
|
||||
|
||||
$i = 0;
|
||||
|
||||
@@ -119,23 +118,31 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
$late = '';
|
||||
|
||||
$ticket = new Ticket($this->db);
|
||||
$ticket->id = $objp->id;
|
||||
$ticket->track_id = $objp->track_id;
|
||||
$ticket->ref = $objp->ref;
|
||||
$ticket->fk_statut = $objp->fk_statut;
|
||||
$ticket->subject = $objp->subject;
|
||||
if ($objp->fk_soc > 0) {
|
||||
$thirdparty = new Societe($this->db);
|
||||
$thirdparty->id = $objp->fk_soc;
|
||||
$thirdparty->email = $objp->socemail;
|
||||
$thirdparty->client = $objp->client;
|
||||
$thirdparty->fournisseur = $objp->fournisseur;
|
||||
$thirdparty->name = $objp->company_name;
|
||||
$link = $thirdparty->getNomUrl(1);
|
||||
} else {
|
||||
$link = dol_print_email($objp->origin_email);
|
||||
}
|
||||
|
||||
|
||||
$r=0;
|
||||
|
||||
// Picto
|
||||
// Ticket
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'class="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1),
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Id
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $objp->ref,
|
||||
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1),
|
||||
'text' => $ticket->getNomUrl(1),
|
||||
'asis' => 1,
|
||||
);
|
||||
$r++;
|
||||
|
||||
@@ -143,16 +150,15 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="left"',
|
||||
'text' => $objp->subject, // Some event have no ref
|
||||
'url' => dol_buildpath("/ticket/card.php?track_id=".$objp->track_id, 1),
|
||||
'url' => DOL_URL_ROOT."/ticket/card.php?track_id=".$objp->track_id,
|
||||
);
|
||||
$r++;
|
||||
|
||||
// Customer
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="left"',
|
||||
'logo' => ($objp->fk_soc>0?'company':''),
|
||||
'text' => ($objp->company_name?$objp->company_name:$objp->origin_email),
|
||||
'url' => ($objp->fk_soc>0?DOL_URL_ROOT."/comm/card.php?socid=".$objp->fk_soc:'')
|
||||
'text' => $link,
|
||||
'asis' => 1,
|
||||
);
|
||||
$r++;
|
||||
|
||||
@@ -165,11 +171,9 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
$r++;
|
||||
|
||||
// Statut
|
||||
$ticketstat = new Ticket($this->db);
|
||||
$ticketstat->fk_statut = $objp->fk_statut;
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => $ticketstat->getLibStatut(3)
|
||||
'text' => $ticket->getLibStatut(3)
|
||||
);
|
||||
$r++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user