29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
"/core/lib/company.lib.php";
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
38 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
39 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
43 $langs->loadLangs(array(
"companies",
"other",
"ticket",
"mails"));
46 $socid =
GETPOST(
'socid',
'int');
48 $track_id =
GETPOST(
'track_id',
'alpha');
49 $action =
GETPOST(
'action',
'alpha');
50 $confirm =
GETPOST(
'confirm',
'alpha');
53 $url_page_current = DOL_URL_ROOT.
'/ticket/document.php';
56 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
57 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
60 if (empty($page) || $page == -1) {
63 $offset = $limit * $page;
64 $pageprev = $page - 1;
65 $pagenext = $page + 1;
70 $sortfield =
"position_name";
74 $result = $object->fetch($id, $ref, $track_id);
82 $permissiontoadd = $user->rights->ticket->write;
88 if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
92 if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id && empty($user->rights->ticket->manage)) {
102 include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
113 llxHeader(
'', $langs->trans(
"TicketDocumentsLinked").
' - '.$langs->trans(
"Files"),
$help_url);
120 $object->fetch_thirdparty();
123 dol_banner_tab($object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
127 if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
128 $object->next_prev_filter =
"te.fk_user_assign = '".$user->id.
"'";
129 } elseif ($user->socid > 0) {
130 $object->next_prev_filter =
"te.fk_soc = '".$user->socid.
"'";
135 print
dol_get_fiche_head($head,
'tabTicketDocument', $langs->trans(
"Ticket"), 0,
'ticket');
137 $morehtmlref =
'<div class="refidno">';
138 $morehtmlref .= $object->subject;
140 if ($object->fk_user_create > 0) {
141 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
143 $fuser =
new User($db);
144 $fuser->fetch($object->fk_user_create);
145 $morehtmlref .= $fuser->getNomUrl(-1);
146 } elseif (!empty($object->email_msgid)) {
147 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
148 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
149 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.
$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $langs->trans(
"EmailMsgID").
': '.$object->email_msgid).
')</small>';
150 } elseif (!empty($object->origin_email)) {
151 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
152 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
153 $morehtmlref .=
dol_escape_htmltag($object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$langs->trans(
"CreatedByPublicPortal").
')</small>';
158 $morehtmlref .=
'<br>';
159 $morehtmlref .=
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth"');
160 if ($action !=
'editcustomer' && 0) {
161 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.
newToken().
'&track_id='.$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetThirdParty'), 0).
'</a> ';
163 $morehtmlref .=
$form->form_thirdparty($url_page_current.
'?track_id='.$object->track_id, $object->socid, $action ==
'editcustomer' ?
'editcustomer' :
'none',
'', 1, 0, 0, array(), 1);
168 $langs->load(
"projects");
170 $morehtmlref .=
'<br>';
171 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
172 if ($action !=
'classify') {
173 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
175 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
177 if (!empty($object->fk_project)) {
178 $morehtmlref .=
'<br>';
180 $proj->fetch($object->fk_project);
181 $morehtmlref .= $proj->getNomUrl(1);
183 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
189 $morehtmlref .=
'</div>';
191 $linkback =
'<a href="'.dol_buildpath(
'/ticket/list.php', 1).
'"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
193 dol_banner_tab($object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
198 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'\.meta$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
200 foreach ($filearray as $key => $file) {
201 $totalsize += $file[
'size'];
205 $modulepart =
'ticket';
206 $permissiontoadd = $user->rights->ticket->write;
207 $permtoedit = $user->rights->ticket->write;
208 $param =
'&id='.$object->id;
210 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Class to manage projects.
Class to manage Dolibarr users.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(isset($_GET["hashp"]) &&!defined("NOLOGIN")) if((isset($_GET["modulepart"]) && $_GET["modulepart"]=='medias')) llxHeader()
Header empty.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
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='')
Show tabs of a record.
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_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
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.