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->rights->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.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 = ".$conf->entity;
101 $sql .=
" AND t.fk_soc= ".$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 $dateterm = $this->
db->jdate($objp->fin_validite);
117 $dateclose = $this->
db->jdate($objp->date_cloture);
121 $ticket->id = $objp->id;
122 $ticket->track_id = $objp->track_id;
123 $ticket->ref = $objp->ref;
124 $ticket->fk_statut = $objp->fk_statut;
125 $ticket->subject = $objp->subject;
126 if ($objp->fk_soc > 0) {
128 $thirdparty->id = $objp->fk_soc;
129 $thirdparty->email = $objp->socemail;
130 $thirdparty->client = $objp->client;
131 $thirdparty->fournisseur = $objp->fournisseur;
132 $thirdparty->name = $objp->company_name;
133 $link = $thirdparty->getNomUrl(1);
142 $this->info_box_contents[$i][0] = array(
143 'td' =>
'class="nowraponall"',
144 'text' => $ticket->getNomUrl(1),
150 $this->info_box_contents[$i][$r] = array(
151 'td' =>
'class="nowrap"',
152 'text' => $objp->subject,
153 'url' => DOL_URL_ROOT.
"/ticket/card.php?track_id=".$objp->track_id,
158 $this->info_box_contents[$i][$r] = array(
159 'td' =>
'class="tdoverflowmax150 maxwidth300onsmartphone"',
167 $this->info_box_contents[$i][$r] = array(
168 'td' =>
'class="right"',
174 $this->info_box_contents[$i][$r] = array(
175 'td' =>
'class="right nowraponall"',
176 'text' => $ticket->getLibStatut(3)
184 $this->info_box_contents[$i][0] = array(
'td' =>
'class="center"',
'text'=>$langs->trans(
"BoxLastModifiedTicketNoRecordedTickets"));
190 $this->info_box_contents[0][0] = array(
191 'td' =>
'class="left"',
192 'text' => $langs->trans(
"ReadPermissionNotAllowed"),
205 public function showBox($head = null, $contents = null, $nooutput = 0)
207 return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
showBox($head=null, $contents=null, $nooutput=0)
Method to show box.
$conf db
API class for accounts.
loadBox($max=5)
Load data into info_box_contents array to show array later.
Class to manage third parties objects (customers, suppliers, prospects...)
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).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link formatted for HTML output.
__construct($db, $param= '')
Constructor.