30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/ticket.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
35require_once DOL_DOCUMENT_ROOT.
"/core/lib/company.lib.php";
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37if (isModEnabled(
'project')) {
38 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
40 include_once DOL_DOCUMENT_ROOT.
'/core/lib/project.lib.php';
52$langs->loadLangs(array(
"companies",
"other",
"ticket",
"mails"));
57$track_id =
GETPOST(
'track_id',
'alpha');
58$action =
GETPOST(
'action',
'alpha');
59$confirm =
GETPOST(
'confirm',
'alpha');
62$url_page_current = DOL_URL_ROOT.
'/ticket/document.php';
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page == -1) {
72$offset = $limit * $page;
79 $sortfield =
"position_name";
82$hookmanager->initHooks(array(
'documentticketcard',
'globalcard'));
84$result =
$object->fetch($id, $ref, $track_id);
96if ($user->socid > 0 && (
$object->fk_soc != $user->socid)) {
100if (!$user->socid &&
getDolGlobalString(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY') &&
$object->fk_user_assign != $user->id && !$user->hasRight(
'ticket',
'manage')) {
104$permissiontoadd = $user->hasRight(
'ticket',
'write');
111include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
120if ($action ==
'set_thirdparty' && $user->hasRight(
'ticket',
'write')) {
123 $url = $_SERVER[
"PHP_SELF"].
'?track_id='.
GETPOST(
'track_id',
'alpha');
124 header(
"Location: ".$url);
134$form =
new Form($db);
137llxHeader(
'', $langs->trans(
"TicketDocumentsLinked").
' - '.$langs->trans(
"Files"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-ticket page-card_documents');
147 dol_banner_tab(
$object->thirdparty,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom');
152 $object->next_prev_filter =
"te.fk_user_assign:=:".((int) $user->id);
153 } elseif ($user->socid > 0) {
154 $object->next_prev_filter =
"te.fk_soc:=:".((int) $user->socid);
159 print
dol_get_fiche_head($head,
'tabTicketDocument', $langs->trans(
"Ticket"), 0,
'ticket');
161 $morehtmlref =
'<div class="refidno">';
162 $morehtmlref .=
$object->subject;
164 if (
$object->fk_user_create > 0) {
165 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
167 $fuser =
new User($db);
168 $fuser->fetch(
$object->fk_user_create);
169 $morehtmlref .= $fuser->getNomUrl(-1);
170 } elseif (!empty(
$object->email_msgid)) {
171 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
172 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
173 $morehtmlref .=
dol_escape_htmltag(
$object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans(
"CreatedByEmailCollector"), $langs->trans(
"EmailMsgID").
': '.
$object->email_msgid).
')</small>';
174 } elseif (!empty(
$object->origin_email)) {
175 $morehtmlref .=
'<br>'.$langs->trans(
"CreatedBy").
' : ';
176 $morehtmlref .=
img_picto(
'',
'email',
'class="paddingrightonly"');
177 $morehtmlref .=
dol_escape_htmltag(
$object->origin_email).
' <small class="hideonsmartphone opacitymedium">('.$langs->trans(
"CreatedByPublicPortal").
')</small>';
181 if (isModEnabled(
"societe")) {
182 $morehtmlref .=
'<br>';
183 $morehtmlref .=
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth"');
184 if ($action !=
'editcustomer' && $permissiontoadd) {
185 $morehtmlref .=
'<a class="editfielda" href="'.$url_page_current.
'?action=editcustomer&token='.
newToken().
'&track_id='.
$object->track_id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetThirdParty'), 0).
'</a> ';
187 $morehtmlref .= $form->form_thirdparty($url_page_current.
'?track_id='.
$object->track_id,
$object->socid, $action ==
'editcustomer' ?
'editcustomer' :
'none',
'', 1, 0, 0, array(), 1);
191 if (isModEnabled(
'project')) {
192 $langs->load(
"projects");
194 $morehtmlref .=
'<br>';
195 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
196 if ($action !=
'classify') {
197 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
199 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
201 if (!empty(
$object->fk_project)) {
202 $morehtmlref .=
'<br>';
204 $proj->fetch(
$object->fk_project);
205 $morehtmlref .= $proj->getNomUrl(1);
207 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
213 $morehtmlref .=
'</div>';
215 $linkback =
'<a href="'.dol_buildpath(
'/ticket/list.php', 1).
'"><strong>'.$langs->trans(
"BackToList").
'</strong></a> ';
217 dol_banner_tab($object,
'ref', $linkback, ($user->socid ? 0 : 1),
'ref',
'ref', $morehtmlref,
'', 0,
'',
'', 1);
222 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'\.meta$', $sortfield, (strtolower($sortorder) ==
'desc' ? SORT_DESC : SORT_ASC), 1);
253 foreach ($filearray as $key => $file) {
254 $totalsize += $file[
'size'];
258 $modulepart =
'ticket';
259 $permissiontoadd = $user->hasRight(
'ticket',
'write');
260 $permtoedit = $user->hasRight(
'ticket',
'write');
261 $param =
'&id='.$object->id;
263 include DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
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.
dol_dir_list($utf8_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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.