26 require_once DOL_DOCUMENT_ROOT.
"/core/boxes/modules_boxes.php";
34 public $boxcode =
"box_last_modified_ticket";
35 public $boximg =
"ticket";
37 public $depends = array(
"ticket");
45 public $info_box_head = array();
46 public $info_box_contents = array();
56 $langs->load(
"boxes");
59 $this->boxlabel = $langs->transnoentitiesnoconv(
"BoxLastModifiedTicket");
70 global $conf, $user, $langs;
74 require_once DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php";
76 $text = $langs->trans(
"BoxLastModifiedTicketDescription", $max);
77 $this->info_box_head = array(
82 $this->info_box_contents[0][0] = array(
83 'td' =>
'class="left"',
84 'text' => $langs->trans(
"BoxLastModifiedTicketContent"),
87 if ($user->hasRight(
'ticket',
'read')) {
88 $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.tms as datem, t.date_read, t.date_close, t.origin_email ";
89 $sql .=
", type.label as type_label, category.label as category_label, severity.label as severity_label";
90 $sql .=
", s.nom as company_name, s.email as socemail, s.client, s.fournisseur";
91 $sql .=
" FROM ".MAIN_DB_PREFIX.
"ticket as t";
92 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_type as type ON type.code=t.type_code";
93 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_category as category ON category.code=t.category_code";
94 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_ticket_severity as severity ON severity.code=t.severity_code";
95 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid=t.fk_soc";
97 $sql .=
" WHERE t.entity IN (".getEntity(
'ticket').
')';
101 $sql .=
" AND t.fk_soc = ".((int) $user->socid);
104 $sql .=
" ORDER BY t.tms DESC, t.rowid DESC";
105 $sql .= $this->
db->plimit($max, 0);
114 $objp = $this->
db->fetch_object(
$resql);
115 $datec = $this->
db->jdate($objp->datec);
116 $datem = $this->
db->jdate($objp->datem);
119 $ticket->id = $objp->id;
120 $ticket->track_id = $objp->track_id;
121 $ticket->ref = $objp->ref;
122 $ticket->fk_statut = $objp->fk_statut;
123 $ticket->subject = $objp->subject;
124 $ticket->date_creation = $datec;
125 $ticket->date_modification = $datem;
126 $ticket->fk_statut = $objp->fk_statut;
127 $ticket->fk_statut = $objp->fk_statut;
128 if ($objp->fk_soc > 0) {
130 $thirdparty->id = $objp->fk_soc;
131 $thirdparty->email = $objp->socemail;
132 $thirdparty->client = $objp->client;
133 $thirdparty->fournisseur = $objp->fournisseur;
134 $thirdparty->name = $objp->company_name;
135 $link = $thirdparty->getNomUrl(1);
144 $this->info_box_contents[$i][0] = array(
145 'td' =>
'class="nowraponall"',
146 'text' => $ticket->getNomUrl(1),
152 $this->info_box_contents[$i][$r] = array(
153 'td' =>
'class="nowrap tdoverflowmax150"',
154 'text' => $objp->subject,
155 'url' => DOL_URL_ROOT.
"/ticket/card.php?track_id=".$objp->track_id,
160 $this->info_box_contents[$i][$r] = array(
161 'td' =>
'class="tdoverflowmax150"',
168 $this->info_box_contents[$i][$r] = array(
175 $this->info_box_contents[$i][$r] = array(
176 'td' =>
'class="right nowraponall"',
177 'text' => $ticket->getLibStatut(3)
185 $this->info_box_contents[$i][0] = array(
'td' =>
'',
'text'=>
'<span class="opacitymedium">'.$langs->trans(
"BoxLastModifiedTicketNoRecordedTickets").
'</span>');
191 $this->info_box_contents[0][0] = array(
193 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>',
206 public function showBox($head =
null, $contents =
null, $nooutput = 0)
208 return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
Class to manage third parties objects (customers, suppliers, prospects...)
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('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link formatted for HTML output.
Class to generate the form for creating a new ticket.
$conf db
API class for accounts.