26 require_once DOL_DOCUMENT_ROOT.
"/core/boxes/modules_boxes.php";
33 public $boxcode =
"box_last_modified_ticket";
34 public $boximg =
"ticket";
36 public $depends = array(
"ticket");
46 $langs->load(
"boxes");
49 $this->boxlabel = $langs->transnoentitiesnoconv(
"BoxLastModifiedTicket");
60 global $conf, $user, $langs;
64 require_once DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php";
66 $text = $langs->trans(
"BoxLastModifiedTicketDescription", $max);
67 $this->info_box_head = array(
72 $this->info_box_contents[0][0] = array(
73 'td' =>
'class="left"',
74 'text' => $langs->trans(
"BoxLastModifiedTicketContent"),
77 if ($user->hasRight(
'ticket',
'read')) {
78 $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 as status, t.type_code, t.category_code, t.severity_code, t.datec, t.tms as datem, t.date_read, t.date_close, t.origin_email ";
79 $sql .=
", type.label as type_label, category.label as category_label, severity.label as severity_label";
80 $sql .=
", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
81 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket as t";
82 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_type as type ON type.code=t.type_code";
83 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as category ON category.code=t.category_code";
84 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_severity as severity ON severity.code=t.severity_code";
85 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid=t.fk_soc";
87 $sql .=
" WHERE t.entity IN (".getEntity(
'ticket').
')';
91 $sql .=
" AND t.fk_soc = ".((int) $user->socid);
94 $sql .=
" ORDER BY t.tms DESC, t.rowid DESC";
95 $sql .= $this->db->plimit($max, 0);
97 $resql = $this->db->query(
$sql);
99 $num = $this->db->num_rows($resql);
104 $objp = $this->db->fetch_object($resql);
105 $datec = $this->db->jdate($objp->datec);
106 $datem = $this->db->jdate($objp->datem);
108 $ticket =
new Ticket($this->db);
109 $ticket->id = $objp->id;
110 $ticket->track_id = $objp->track_id;
111 $ticket->ref = $objp->ref;
112 $ticket->subject = $objp->subject;
113 $ticket->date_creation = $datec;
114 $ticket->date_modification = $datem;
117 $ticket->status = $objp->status;
118 $ticket->statut = $objp->status;
119 if ($objp->fk_soc > 0) {
120 $thirdparty =
new Societe($this->db);
121 $thirdparty->id = $objp->fk_soc;
122 $thirdparty->email = $objp->socemail;
123 $thirdparty->client = $objp->client;
124 $thirdparty->fournisseur = $objp->fournisseur;
125 $thirdparty->name = $objp->company_name;
126 $link = $thirdparty->getNomUrl(1);
135 $this->info_box_contents[$i][0] = array(
136 'td' =>
'class="nowraponall"',
137 'text' => $ticket->getNomUrl(1),
143 $this->info_box_contents[$i][$r] = array(
144 'td' =>
'class="nowrap tdoverflowmax150"',
145 'text' => $objp->subject,
146 'url' => DOL_URL_ROOT.
"/ticket/card.php?track_id=".$objp->track_id,
151 $this->info_box_contents[$i][$r] = array(
152 'td' =>
'class="tdoverflowmax150"',
159 $this->info_box_contents[$i][$r] = array(
166 $this->info_box_contents[$i][$r] = array(
167 'td' =>
'class="right nowraponall"',
168 'text' => $ticket->getLibStatut(3)
176 $this->info_box_contents[$i][0] = array(
178 'text'=>
'<span class="opacitymedium">'.$langs->trans(
"BoxLastModifiedTicketNoRecordedTickets").
'</span>'
185 $this->info_box_contents[0][0] = array(
187 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>',
200 public function showBox($head =
null, $contents =
null, $nooutput = 0)
202 return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage the box to show last modified tickets.
loadBox($max=5)
Load data into info_box_contents array to show array later.
showBox($head=null, $contents=null, $nooutput=0)
Method to show box.
__construct($db, $param='')
Constructor.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link formatted for HTML output.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
Class to generate the form for creating a new ticket.