25require
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/ticket/class/actions_ticket.class.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formticket.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
33if (isModEnabled(
'project')) {
34 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
36 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
40$langs->loadLangs(array(
'companies',
'other',
'ticket'));
45$track_id =
GETPOST(
'track_id',
'alpha', 3);
46$socid =
GETPOST(
'socid',
'int');
47$action =
GETPOST(
'action',
'aZ09');
50$url_page_current = DOL_URL_ROOT.
'/ticket/agenda.php';
52$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
53$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
54$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
55$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
56$page = is_numeric($page) ? $page : 0;
57$page = $page == -1 ? 0 : $page;
59 $sortfield =
"a.datep,a.id";
64$offset = $limit * $page;
68if (
GETPOST(
'actioncode',
'array')) {
69 $actioncode =
GETPOST(
'actioncode',
'array', 3);
70 if (!count($actioncode)) {
77$search_rowid =
GETPOST(
'search_rowid');
78$search_agenda_label =
GETPOST(
'search_agenda_label');
81$object->fetch($id, $ref, $track_id);
85$extrafields->fetch_name_optionals_label($object->table_element);
94if ($user->socid > 0) {
95 $socid = $user->socid;
100if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
104if (!$user->socid && (
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY') && $object->fk_user_assign != $user->id) && !$user->hasRight(
'ticket',
'manage')) {
108$permissiontoadd = $user->rights->ticket->write;
115$parameters = array(
'id'=>$socid);
116$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
121if (empty($reshook)) {
123 $_SESSION[
'ticket-view-type'] =
"list";
127if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
129 $search_agenda_label =
'';
133if ($action ==
'set_thirdparty' && $user->hasRight(
'ticket',
'write')) {
134 if ($object->fetch(
GETPOST(
'id',
'int'),
'',
GETPOST(
'track_id',
'alpha')) >= 0) {
135 $result = $object->setCustomer(
GETPOST(
'editcustomer',
'int'));
136 $url = $_SERVER[
"PHP_SELF"].
'?track_id='.
GETPOST(
'track_id',
'alpha');
137 header(
"Location: ".$url);
147$form =
new Form($db);
148$userstat =
new User($db);
151$title = $langs->trans(
"Ticket").
' - '.$object->ref.
' '.$object->name;
153 $title = $object->ref.
' '.$object->name.
' - '.$langs->trans(
"Info");
155$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|DE:Modul_Terminplanung';
160 $object->fetch_thirdparty();
165 dol_banner_tab($object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
171 $object->next_prev_filter =
"te.fk_user_assign = ".((int) $user->id);
172} elseif ($user->socid > 0) {
173 $object->next_prev_filter =
"te.fk_soc = ".((int) $user->socid);
177print
dol_get_fiche_head($head,
'tabTicketLogs', $langs->trans(
"Ticket"), 0,
'ticket');
179$morehtmlref =
'<div class="refidno">';
180$morehtmlref .= $object->subject;
182if ($object->fk_user_create > 0) {
183 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
185 $langs->load(
"users");
186 $fuser =
new User($db);
187 $fuser->fetch($object->fk_user_create);
188 $morehtmlref .= $fuser->getNomUrl(-1);
189} elseif (!empty($object->email_msgid)) {
190 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
191 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
192 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $langs->trans(
"EmailMsgID").
': '.$object->email_msgid).
')</small>';
193} elseif (!empty($object->origin_email)) {
194 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
195 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
196 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$langs->trans(
"CreatedByPublicPortal").
')</small>';
200if (isModEnabled(
"societe")) {
201 $morehtmlref .=
'<br>';
202 $morehtmlref .=
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth"');
203 if ($action !=
'editcustomer' && $permissiontoadd) {
204 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.newToken().
'&track_id='.$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetThirdParty'), 0).
'</a> ';
206 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid, $action ==
'editcustomer' ?
'editcustomer' :
'none',
'', 1, 0, 0, array(), 1);
210if (isModEnabled(
'project')) {
211 $langs->load(
"projects");
213 $morehtmlref .=
'<br>';
214 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
215 if ($action !=
'classify') {
216 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
218 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
220 if (!empty($object->fk_project)) {
221 $morehtmlref .=
'<br>';
223 $proj->fetch($object->fk_project);
224 $morehtmlref .= $proj->getNomUrl(1);
226 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
232$morehtmlref .=
'</div>';
234$linkback =
'<a href="'.DOL_URL_ROOT.
'/ticket/list.php"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
236dol_banner_tab($object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
243if (!empty($object->id)) {
244 $param =
'&id='.$object->id;
245 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
246 $param .=
'&contextpage='.$contextpage;
248 if ($limit > 0 && $limit != $conf->liste_limit) {
249 $param .=
'&limit='.$limit;
254 $messagingUrl = DOL_URL_ROOT.
'/ticket/messaging.php?track_id='.$object->track_id;
255 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'ShowAsConversation'),
'',
'fa fa-comments imgforviewmode', $messagingUrl,
'', 1);
256 $messagingUrl = DOL_URL_ROOT.
'/ticket/agenda.php?track_id='.$object->track_id;
257 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'MessageListViewType'),
'',
'fa fa-bars imgforviewmode', $messagingUrl,
'', 1, array(
'morecss'=>
'btnTitleSelected'));
260 $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage";
261 $url =
'card.php?track_id='.$object->track_id.
'&action=presend_addmessage&mode=init&private_message=0&send_email=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?track_id='.$object->track_id).
'#formmailbeforetitle';
262 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'SendMail'),
'',
'fa fa-paper-plane', $url,
'email-title-button', $btnstatus);
265 $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage";
266 $url =
'card.php?track_id='.$object->track_id.
'&action=presend_addmessage&mode=init&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?track_id='.$object->track_id).
'#formmailbeforetitle';
267 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'TicketAddMessage'),
'',
'fa fa-comment-dots', $url,
'add-new-ticket-title-button', $btnstatus);
270 $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action !=
"presend" && $action !=
"presend_addmessage";
271 $url = DOL_URL_ROOT.
'/comm/action/card.php?action=create&datep=now&origin=ticket&originid='.$object->id.
'&projectid='.$object->fk_project.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?id='.$object->id);
272 $morehtmlright .=
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'add-new-ticket-even-button', $btnstatus);
274 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
275 $cachekey =
'count_events_ticket_'.$object->id;
278 $titlelist = $langs->trans(
"ActionsOnTicket").(is_numeric($nbEvent) ?
'<span class="opacitymedium colorblack paddingleft">('.$nbEvent.
')</span>' :
'');
280 print_barre_liste($titlelist, 0, $_SERVER[
"PHP_SELF"],
'', $sortfield, $sortorder,
'', 0, -1,
'', 0, $morehtmlright,
'', 0, 1, 0);
284 $filters[
'search_agenda_label'] = $search_agenda_label;
285 $filters[
'search_rowid'] = $search_rowid;
287 show_actions_done($conf, $langs, $db, $object,
null, 0, $actioncode,
'', $filters, $sortfield, $sortorder);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
Class to manage Dolibarr users.
show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC', $module='')
Show html area with actions (done or not, ignore the name of function).
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
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...
dol_getcache($memoryid)
Read a memory area shared by all users, all sessions on server.
Class to generate the form for creating a new ticket.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
ticket_prepare_head($object)
Build tabs for a Ticket object.