28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
"/core/lib/company.lib.php";
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37 $langs->loadLangs(array(
"companies",
"other",
"ticket",
"mails"));
41 $track_id =
GETPOST(
'track_id',
'alpha');
42 $action =
GETPOST(
'action',
'alpha');
43 $confirm =
GETPOST(
'confirm',
'alpha');
46 if (!$user->rights->ticket->read) {
51 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
52 $sortfield =
GETPOST(
"sortfield",
'alpha');
53 $sortorder =
GETPOST(
"sortorder",
'alpha');
55 if (empty($page) || $page == -1) { $page = 0; }
56 $offset = $limit * $page;
57 $pageprev = $page - 1;
58 $pagenext = $page + 1;
59 if (!$sortorder) $sortorder =
"ASC";
60 if (!$sortfield) $sortfield =
"position_name";
63 $result = $object->fetch($id, $ref, $track_id);
76 include_once DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
84 $form =
new Form($db);
87 llxHeader(
'', $langs->trans(
"TicketDocumentsLinked").
' - '.$langs->trans(
"Files"), $help_url);
95 $object->fetch_thirdparty();
98 dol_banner_tab($object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
102 if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
103 $object->next_prev_filter =
"te.fk_user_assign = '".$user->id.
"'";
104 } elseif ($user->socid > 0) {
105 $object->next_prev_filter =
"te.fk_soc = '".$user->socid.
"'";
112 $morehtmlref =
'<div class="refidno">';
113 $morehtmlref .= $object->subject;
115 if ($object->fk_user_create > 0) {
116 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
118 $langs->load(
"users");
119 $fuser =
new User($db);
120 $fuser->fetch($object->fk_user_create);
121 $morehtmlref .= $fuser->getNomUrl(0);
123 if (!empty($object->origin_email)) {
124 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
125 $morehtmlref .= $object->origin_email.
' <small>('.$langs->trans(
"TicketEmailOriginIssuer").
')</small>';
129 if (!empty($conf->societe->enabled))
131 $morehtmlref .=
'<br>'.$langs->trans(
'ThirdParty');
135 $morehtmlref .=
' : ';
136 if ($action ==
'editcustomer') {
137 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid,
'editcustomer',
'', 1, 0, 0, array(), 1);
139 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid,
'none',
'', 1, 0, 0, array(), 1);
144 if (!empty($conf->projet->enabled))
146 $langs->load(
"projects");
147 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
148 if ($user->rights->ticket->write)
150 if ($action !=
'classify') {
152 $morehtmlref .=
' : ';
154 if ($action ==
'classify') {
156 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
157 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
158 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
159 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', 0, 0, 1, 0, 1, 0, 0,
'', 1);
160 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
161 $morehtmlref .=
'</form>';
163 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
166 if (!empty($object->fk_project)) {
168 $proj->fetch($object->fk_project);
169 $morehtmlref .= $proj->getNomUrl(1);
176 $morehtmlref .=
'</div>';
178 $linkback =
'<a href="'.dol_buildpath(
'/ticket/list.php', 1).
'"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
180 dol_banner_tab($object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
185 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'\.meta$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
187 foreach ($filearray as $key => $file) {
188 $totalsize += $file[
'size'];
192 $modulepart =
'ticket';
193 $permission = $user->rights->ticket->write;
194 $permtoedit = $user->rights->ticket->write;
195 $param =
'&id='.$object->id;
197 include_once DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
ticket_prepare_head($object)
Build tabs for a Ticket object.
Class to manage Dolibarr users.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage projects.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.