26 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
55 public $errors = array();
100 if (!is_object($this->dao)) {
113 public function fetch($id = 0, $ref =
'', $track_id =
'')
116 return $this->dao->fetch($id, $ref, $track_id);
128 $this->dao->fk_statut = $this->fk_statut;
129 return $this->dao->getLibStatut($mode);
141 $this->dao->fetch($id,
'', $track_id);
143 $this->label = $this->dao->label;
157 if ($action ==
'create') {
158 return $langs->trans(
"CreateTicket");
159 } elseif ($action ==
'edit') {
160 return $langs->trans(
"EditTicket");
161 } elseif ($action ==
'view') {
162 return $langs->trans(
"TicketCard");
163 } elseif ($action ==
'add_message') {
164 return $langs->trans(
"AddMessage");
166 return $langs->trans(
"TicketsManagement");
180 global $conf, $langs;
182 print '<!-- initial message of ticket -->'.
"\n";
183 if (!empty($user->rights->ticket->manage) && $action ==
'edit_message_init') {
186 print '<form action="'.$_SERVER[
'PHP_SELF'].
'" method="post">';
187 print '<input type="hidden" name="token" value="'.newToken().
'">';
188 print '<input type="hidden" name="track_id" value="'.$object->track_id.
'">';
189 print '<input type="hidden" name="action" value="set_message">';
193 print '<div class="underbanner clearboth"></div>';
194 print '<div class="div-table-responsive-no-min">';
195 print '<table class="noborder centpercent margintable">';
196 print '<tr class="liste_titre trforfield"><td class="nowrap titlefield">';
197 print $langs->trans(
"InitialMessage");
199 if ($user->rights->ticket->manage) {
200 print '<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=edit_message_init&track_id='.$object->track_id.
'">'.
img_edit($langs->trans(
'Modify')).
'</a>';
205 print '<td colspan="2">';
206 if (!empty($user->rights->ticket->manage) && $action ==
'edit_message_init') {
208 $msg =
GETPOST(
'message_initial',
'alpha') ?
GETPOST(
'message_initial',
'alpha') : $object->message;
209 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
210 $uselocalbrowser =
true;
211 $ckeditorenabledforticket = $conf->global->FCKEDITOR_ENABLE_TICKET;
212 $doleditor =
new DolEditor(
'message_initial', $msg,
'100%', 250,
'dolibarr_details',
'In',
true, $uselocalbrowser, $ckeditorenabledforticket, ROWS_9,
'95%');
213 $doleditor->Create();
217 print '<div class="longmessagecut">';
218 print $object->message;
224 print '<div class="longmessagecut">';
234 if (!empty($user->rights->ticket->manage) && $action ==
'edit_message_init') {
235 print '<div class="center">';
236 print ' <input type="submit" class="button" value="'.$langs->trans(
'Modify').
'">';
237 print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
245 if (!empty($user->rights->ticket->manage) && $action ==
'edit_message_init') {
261 global $conf, $langs, $user;
264 $ret = $this->dao->loadCacheMsgsTicket();
267 $action =
GETPOST(
'action',
'aZ09');
271 if (is_array($this->dao->cache_msgs_ticket) && count($this->dao->cache_msgs_ticket) > 0)
273 print '<table class="border" style="width:100%;">';
275 print '<tr class="liste_titre">';
278 print $langs->trans(
'TicketMessagesList');
283 print $langs->trans(
'User');
288 foreach ($this->dao->cache_msgs_ticket as $id => $arraymsgs) {
289 if (!$arraymsgs[
'private']
290 || ($arraymsgs[
'private'] ==
"1" && $show_private)
293 print '<tr class="oddeven">';
294 print '<td><strong>';
295 print img_picto(
'',
'object_action',
'class="paddingright"').dol_print_date($arraymsgs[
'datec'],
'dayhour');
296 print '<strong></td>';
299 if ($arraymsgs[
'fk_user_author'] > 0) {
300 $userstat =
new User($this->
db);
301 $res = $userstat->fetch($arraymsgs[
'fk_user_author']);
303 print $userstat->getNomUrl(0);
306 print $langs->trans(
'Customer');
311 print '<tr class="oddeven">';
312 print '<td colspan="2">';
313 print $arraymsgs[
'message'];
321 print '<div class="info">'.$langs->trans(
'NoMsgForThisTicket').
'</div>';
335 global $conf, $langs, $user;
341 if (is_array($object->cache_msgs_ticket) && count($object->cache_msgs_ticket) > 0) {
342 print '<section id="cd-timeline">';
344 foreach ($object->cache_msgs_ticket as $id => $arraymsgs) {
345 if (!$arraymsgs[
'private']
346 || ($arraymsgs[
'private'] ==
"1" && $show_private)
348 print '<div class="cd-timeline-block">';
349 print '<div class="cd-timeline-img">';
350 print '<img src="img/messages.png" alt="">';
351 print '</div> <!-- cd-timeline-img -->';
353 print '<div class="cd-timeline-content">';
354 print $arraymsgs[
'message'];
356 print '<span class="cd-date">';
360 if ($arraymsgs[
'fk_user_action'] > 0) {
361 $userstat =
new User($this->
db);
362 $res = $userstat->fetch($arraymsgs[
'fk_user_action']);
365 print $userstat->getNomUrl(1);
369 print $langs->trans(
'Customer');
373 print '</div> <!-- cd-timeline-content -->';
374 print '</div> <!-- cd-timeline-block -->';
379 print '<div class="info">'.$langs->trans(
'NoMsgForThisTicket').
'</div>';
393 print '<div class="div-table-responsive-no-min margintoponly">';
394 print '<div class="centpercent right">';
396 $exclude_status = array(Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED);
398 $exclude_status = array_merge($exclude_status, array(intval($object->fk_statut)));
403 foreach ($object->statuts_short as $status => $status_label) {
404 if (!in_array($status, $exclude_status)) {
405 print '<div class="inline-block center marginbottomonly">';
408 $urlforbutton =
$_SERVER[
'PHP_SELF'].
'?track_id='.$object->track_id.
'&action=mark_ticket_read';
410 $urlforbutton =
$_SERVER[
'PHP_SELF'].
'?track_id='.$object->track_id.
'&action=set_status&token='.
newToken().
'&new_status='.$status;
413 print '<a class="butAction butStatus marginbottomonly" href="'.$urlforbutton.
'">';
416 print $langs->trans($object->statuts_short[$status]);
421 print '</div></div><br>';
439 if (in_array(
'admin', explode(
':', $parameters[
'context']))) {
440 $this->results = array(
'ticket_send' => $langs->trans(
'MailToSendTicketMessage'));
446 $this->errors[] =
'Error message';
viewTicketMessages($show_private, $show_user, $object)
View html list of message for ticket.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
LibStatut($status, $mode=0, $notooltip=0)
Return status label of object.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Class to manage Dolibarr users.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
$conf db
API class for accounts.
viewTicketTimelineMessages($show_private, $show_user, Ticket $object)
View list of message for ticket with timeline display.
getLibStatut($mode=0)
Print statut.
emailElementlist($parameters, &$object, &$action, $hookmanager)
Hook to add email element template.
viewStatusActions(Ticket $object)
Print html navbar with link to set ticket status.
getTitle($action= '')
Get action title.
__construct($db)
Constructor.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
viewTicketOriginalMessage($user, $action, $object)
Show ticket original message.
getInstanceDao()
Instantiation of DAO class.
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Class Actions of the module ticket.
fetch($id=0, $ref= '', $track_id= '')
Fetch object.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Class to manage a WYSIWYG editor.
$errno
Numero de l'erreur.
loadCacheMsgsTicket()
Load the list of event on ticket into ->cache_msgs_ticket.
getInfo($id)
Get ticket info.
dol_textishtml($msg, $option=0)
Return if a text is a html content.