Spade
Mini Shell
PK��[6c>Z��Article/Html.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
namespace OSSolution\HelpdeskPro\Site\View\Article;
use HelpdeskProHelperBootstrap;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use OSL\Utils\Database as DatabaseUtils;
use OSL\View\HtmlView;
use OSSolution\HelpdeskPro\Site\Helper\Helper as HelpdeskproHelper;
use OSSolution\HelpdeskPro\Site\Helper\Html as HelpdeskproHelperHtml;
defined('_JEXEC') or die;
/**
* Class Html
*
* @property \OSSolution\HelpdeskPro\Site\Model\Article $model
*/
class Html extends HtmlView
{
protected function beforeRender()
{
$this->item = $this->model->getData();
if (empty($this->item->id))
{
throw new \Exception(Text::_('HDP_ARTICLE_NOT_FOUND'), 404);
}
$config = HelpdeskproHelper::getConfig();
// Update hits
$this->model->hits();
if ($config->highlight_code)
{
HelpdeskproHelper::loadHighlighter();
}
// Pathway
$pathway = $this->container->app->getPathway();
// Get category title
$fieldSuffix = HelpdeskproHelper::getFieldSuffix();
$db = $this->model->getDbo();
$query = $db->getQuery(true);
$query->select('title')
->from('#__helpdeskpro_categories')
->where('id = ' . $this->item->category_id);
if ($fieldSuffix)
{
DatabaseUtils::getMultilingualFields($query, array('title'),
$fieldSuffix);
}
$db->setQuery($query);
$categoryTitle = $db->loadResult();
$pathway->addItem($categoryTitle,
Route::_('index.php?option=com_helpdeskpro&view=articles&filter_category_id='
. $this->item->category_id . '&Itemid=' .
$this->Itemid));
$pathway->addItem($this->item->title);
// Handle page title
$active = $this->container->app->getMenu()->getActive();
$params = HelpdeskproHelperHtml::getViewParams($active,
array('categories', 'articles', 'article'));
if (!$params->get('page_title'))
{
$params->set('page_title', $this->item->title);
}
HelpdeskproHelperHtml::prepareDocument($params, $this->item);
$this->bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
}
}PK��[�he::Article/tmpl/default.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
// no direct access
defined( '_JEXEC' ) or die ;
?>
<div id="hdp_container" class="container-fluid">
<h1 class="hdp_title"><?php echo
$this->item->title; ?></h1>
<div class="hdp-article-detail <?php echo
$this->bootstrapHelper->getClassMapping('clearfix');
?>">
<?php echo $this->item->text; ?>
</div>
</div>PK��[�����Articles/Html.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
namespace OSSolution\HelpdeskPro\Site\View\Articles;
use HelpdeskProHelperBootstrap;
use OSL\Utils\Database as DatabaseUtils;
use OSL\View\ListView;
use OSSolution\HelpdeskPro\Site\Helper\Database as
HelpdeskproHelperDatabase;
use OSSolution\HelpdeskPro\Site\Helper\Helper as HelpdeskproHelper;
use OSSolution\HelpdeskPro\Site\Helper\Html as HelpdeskproHelperHtml;
use OSSolution\HelpdeskPro\Site\Helper\Route as RouteHelper;
defined('_JEXEC') or die;
class Html extends ListView
{
protected function beforeRender()
{
parent::beforeRender();
// Add articles to route
RouteHelper::addArticles($this->items);
$fieldSuffix = HelpdeskproHelper::getFieldSuffix();
$rows = HelpdeskproHelperDatabase::getAllCategories('title',
array(), $fieldSuffix, 2);
$this->lists['id'] =
HelpdeskproHelperHtml::buildCategoryDropdown($this->state->id,
'id', 'class="input-large form-select"
onchange="submit();"', $rows);
// Handle page title
$active = $this->container->app->getMenu()->getActive();
$params = HelpdeskproHelperHtml::getViewParams($active,
array('categories', 'articles'));
$category = null;
if ($this->state->filter_category_id)
{
$db = $this->model->getDbo();
$query = $db->getQuery(true);
$query->select('title')
->from('#__helpdeskpro_categories')
->where('id = ' .
$this->state->filter_category_id);
if ($fieldSuffix)
{
DatabaseUtils::getMultilingualFields($query, array('title'),
$fieldSuffix);
}
$db->setQuery($query);
$categoryTitle = $db->loadResult();
if (!$params->get('page_title') && $categoryTitle)
{
$params->set('page_title', $categoryTitle);
}
// Pathway
$pathway = $this->container->app->getPathway();
$pathway->addItem($categoryTitle);
}
HelpdeskproHelperHtml::prepareDocument($params);
$this->bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
}
}PK��[�
�q��Articles/tmpl/default.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die ;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
$ordering = $this->state->filter_order == 'tbl.ordering';
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip',
array('placement' => 'top'));
?>
<div id="hdp_container" class="container-fluid">
<h1 class="hdp_title"><?php echo
Text::_('HDP_ARTICLES'); ?></h1>
<form action="<?php echo
htmlspecialchars(Uri::getInstance()->toString()); ?>"
method="post" name="adminForm" id="adminForm"
class="form-inline">
<fieldset class="filters btn-toolbar <?php echo
$this->bootstrapHelper->getClassMapping('clearfix');
?>">
<div class="btn-group">
<input type="text" name="filter_search"
id="filter_search" value="<?php echo
$this->escape($this->state->filter_search); ?>"
class="search-query input-xlarge"
onchange="document.adminForm.submit();"
placeholder="<?php echo
Text::_('HDP_ARTICLES_SEARCH_PLACEHOLDER'); ?>" />
</div>
<div class="btn-group pull-right">
<?php echo $this->lists['id']; ?>
</div>
</fieldset>
</form>
<table class="table table-striped table-bordered
table-condensed">
<thead>
<tr>
<th>
<?php echo Text::_('HDP_TITLE'); ?>
</th>
<th>
<?php echo Text::_('HDP_HITS'); ?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach($this->items as $item)
{
?>
<tr>
<td>
<a href="<?php echo
Route::_('index.php?option=com_helpdeskpro&view=article&id='.$item->id.'&Itemid='.$this->Itemid);
?>"><?php echo $item->title;?></a>
</td>
<td>
<spsn class="badge badge-info"><?php echo
$item->hits; ?></spsn>
</td>
</tr>
<?php
}
?>
</tbody>
<?php
if ($this->pagination->total > $this->pagination->limit)
{
?>
<tfoot>
<tr>
<td colspan="2"><?php echo
$this->pagination->getPagesLinks();?></td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>PK��[�q{��Categories/Html.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
namespace OSSolution\HelpdeskPro\Site\View\Categories;
use HelpdeskProHelperBootstrap;
use OSL\View\ListView;
use OSSolution\HelpdeskPro\Site\Helper\Html as HelpdeskproHelperHtml;
use OSSolution\HelpdeskPro\Site\Helper\Route as RouteHelper;
defined('_JEXEC') or die;
class Html extends ListView
{
protected function beforeRender()
{
parent::beforeRender();
foreach ($this->items as $item)
{
RouteHelper::addArticles($item->articles);
}
// Handle page title
$active = $this->container->app->getMenu()->getActive();
$params = HelpdeskproHelperHtml::getViewParams($active,
array('categories'));
HelpdeskproHelperHtml::prepareDocument($params);
$this->bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
}
}PK��[A�V��Categories/tmpl/default.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die ;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use OSSolution\HelpdeskPro\Site\Helper\Route as RouteHelper;
$params = Factory::getApplication()->getParams();
$numberColumns = $params->get('number_columns', 2);
$spanClass = 'span' . intval(12 / $numberColumns);
?>
<div id="hdp_container" class="container-fluid">
<h1 class="hdp_title"><?php echo
Text::_('HDP_ARTICLE_CATEGORIES'); ?></h1>
<div class="hdp-categories-list clearfix">
<div class="row-fluid">
<?php
$i = 0;
$numberCategories = count($this->items);
foreach ($this->items as $item)
{
$i++;
$link = Route::_(RouteHelper::getArticlesRoute($item->id,
$this->Itemid, Factory::getLanguage()->getTag()));
?>
<div class="hpd-category-wrapper <?php echo $spanClass;
?>">
<h3>
<i class="icon-folder-open"></i><a
title="<?php echo
Text::sprintf('HDP_VIEW_ALL_ARTICLES_IN_CATEGORY',
$item->title);?>" href="<?php echo $link;
?>"><?php echo $item->title; ?></a><span
class="hdp-articles-count badge badge-info"><?php echo
$item->total_articles; ?></span>
</h3>
<?php
if ($item->description)
{
?>
<div class="hdp-category-description
clearfix"><?php echo $item->description; ?></div>
<?php
}
?>
<ul class="hp-category-posts">
<?php
foreach($item->articles as $article)
{
?>
<li class="format-standard">
<i class="icon-list-alt"></i><a
title="<?php echo $article->title; ?>"
href="<?php echo
Route::_(RouteHelper::getArticleRoute($article->id,
$article->category_id, $this->Itemid,
JFactory::getLanguage()->getTag()));?>"><?php echo
$article->title; ?></a>
</li>
<?php
}
?>
</ul>
</div>
<?php
if ($i % $numberColumns == 0 && $i < $numberCategories)
{
?>
</div>
<div class="clearfix row-fluid">
<?php
}
}
?>
</div>
</div>
</div>PK��[VJ�
�
"common/tmpl/ticket_add_comment.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die;
if (!$canComment)
{
return;
}
if ($captchaInvalid)
{
$style = '';
}
else
{
$style = ' style="display:none;"';
}
if ($config->enable_attachment)
{
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_upload_attachments.php');
}
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
$btnClass =
$bootstrapHelper->getClassMapping('btn');
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn
btn-primary');
?>
<tr id="tr_message_id" <?php echo $style; ?>>
<td>
<?php
if ($config->use_html_editor)
{
echo $editor->display( 'message', $message,
'100%', '250', '75', '10' );
}
else
{
?>
<textarea rows="10" class="hdp_fullwidth
form-control" cols="75" class="hdp_fullwidth"
name="message" id="message"><?php echo $message;
?></textarea>
<?php
}
if ($config->enable_attachment)
{
?>
<div class="clearfix"></div>
<table width="100%">
<tr>
<th><?php echo
Text::_('HDP_ATTACHMENTS'); ?></th>
</tr>
<tr>
<td>
<div id="hdp_ticket_attachments"
class="dropzone needsclick dz-clickable">
</div>
</td>
</tr>
</table>
<?php
}
if ($config->enable_captcha && !empty($captcha))
{
?>
<table>
<tr>
<td class="title_cell">
<?php echo Text::_('HDP_CAPTCHA');
?><span class="required">*</span>
</td>
<td>
<?php echo $captcha; ?>
</td>
</tr>
</table>
<?php
}
?>
<div class="clearfix"></div>
<input type="button" name="btnSubmit"
class="<?php echo $btnPrimaryClass; ?>"
value="<?php echo Text::_('HDP_SUBMIT_COMMENT');
?>" onclick="addComment(this.form);" />
<input type="button" name="btnSubmit"
class="<?php echo $btnPrimaryClass; ?>"
value="<?php echo Text::_('HDP_COMMENT_AND_CLOSE');
?>" onclick="addCommentAndClose(this.form);" />
</td>
</tr>
PK��[�&�b��common/tmpl/ticket_comments.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die;
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
$iconEdit =
$bootstrapHelper->getClassMapping('icon-edit');
$iconTrash =
$bootstrapHelper->getClassMapping('icon-trash');
$btn = $bootstrapHelper->getClassMapping('btn');
$btnSmall =
$bootstrapHelper->getClassMapping('btn-small');
if (count($messages))
{
$imageFileTypes = array('gif', 'jpg',
'jpeg', 'png', 'csv', 'bmp',
'txt');
$attachmentsPath = JPATH_ROOT .
'/media/com_helpdeskpro/attachments';
?>
<tr>
<td>
<div class="hdp_ticket_comments">
<ul>
<?php
foreach($messages as $message)
{
?>
<li id="mesage-<?php echo $message->id;
?>">
<table class="admintable <?php echo
$bootstrapHelper->getClassMapping('table table-striped
table-bordered'); ?> table-condensed">
<tr>
<td class="hdp_ticket_icon_user">
<div class="hdp_ticket-images">
<?php
$avatarUrl = $rootUri .
'/media/com_helpdeskpro/assets/images/icons/icon-user.jpeg';
if ($message->user_id)
{
$avatar =
HelpdeskproHelper::getUserAvatar($message->user_id);
if ($avatar)
{
$avatarUrl = $rootUri . '/' . $avatar;
}
}
?>
<img width="60" height="60"
src="<?php echo $avatarUrl; ?>" title="<?php echo
$message->name; ?>">
</div>
</td>
<td class="hdp_ticket_comments">
<div class="hdp_ticket_comments_body">
<div class="hdp_ticket_arrow"></div>
<div class="hdp_ticket_commenter-name">
<span class="hdp_ticket_name">
<?php
if ($message->user_id)
{
echo $message->name;
}
else
{
echo $item->name;
}
?>
- <a
href="#<?php echo $message->id; ?>">[#<?php echo
$message->id; ?>]</a>
</span>
<span class="hdp_ticket_date_time">
<?php
if ($message->user_id)
{
echo HTMLHelper::_('date',
$message->date_added, $config->date_format);
}
else
{
echo HTMLHelper::_('date',
$message->date_added, $config->date_format);
}
if (HelpdeskproHelper::canUpdateComment($user,
$message->id))
{
?>
<button type="button" class="<?php echo
$btn . ' ' . $btnSmall; ?> edit_comment"
id="<?php echo $message->id; ?>" title="<?php
echo Text::_('HDP_EDIT_THIS_COMMENT'); ?>"><i
class="<?php echo $iconEdit;
?>"></i></button>
<?php
}
if (HelpdeskproHelper::canDeleteComment($user,
$message->id))
{
?>
<button type="button" class="<?php echo
$btn . ' ' . $btnSmall; ?> remove_comment"
id="<?php echo $message->id; ?>" title="<?php
echo Text::_('HDP_DELETE_THIS_COMMENT'); ?>"><i
class="<?php echo $iconTrash;
?>"></i></button>
<?php
}
?>
</span>
</div>
<div class="hdp_ticket_comment-text">
<div data-title="Enter Your Comment"
class="hd-edit-table" id="hdp_ticket_edit-text-<?php echo
$message->id; ?>">
<?php
if ($config->process_bb_code)
{
echo HelpdeskproHelper::processBBCode($message->message);
}
else
{
if ($config->use_html_editor)
{
echo $message->message;
}
else
{
echo nl2br($message->message);
}
}
?>
</div>
<?php
if ($message->attachments)
{
$originalFileNames = explode('|',
$message->original_filenames);
$attachments = explode('|',
$message->attachments);;
?>
<div class="hdp_ticket_comment-file">
<ul>
<?php
$i = 0 ;
foreach($originalFileNames as $fileName)
{
$actualFileName = $attachments[$i++];
if (!file_exists($attachmentsPath . '/' .
$actualFileName))
{
continue;
}
$icon = substr($fileName, strrpos($fileName,
'.') + 1);
$icon = strtolower($icon);
if (!file_exists(JPATH_SITE .
"/media/com_helpdeskpro/assets/images/icons/$icon.png"))
{
$icon = "default";
}
if (in_array($icon, $imageFileTypes))
{
?>
<li><a class="hdp-modal"
href="<?php echo
Route::_('index.php?option=com_helpdeskpro&task=ticket.download_attachment&filename='.$actualFileName.'&original_filename='.$fileName);
?>"><img height="16" width="16"
src="<?php echo $rootUri .
"/media/com_helpdeskpro/assets/images/icons/$icon.png"
?>" ><?php echo $fileName ?></a></li>
<?php
}
else
{
?>
<li><a href="<?php echo
Route::_('index.php?option=com_helpdeskpro&task=ticket.download_attachment&filename='.$actualFileName.'&original_filename='.$fileName);
?>"><img height="16" width="16"
src="<?php echo $rootUri .
"/media/com_helpdeskpro/assets/images/icons/$icon.png"
?>" ><?php echo $fileName ?></a></li>
<?php
}
}
?>
</ul>
</div>
<?php
}
?>
</div>
</div>
</td>
</tr>
</table>
</li>
<?php
}
?>
</ul>
</div>
</td>
</tr>
<?php
}PK��[*ځv�
�
$common/tmpl/ticket_customer_info.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die;
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
$config = HelpdeskproHelper::getConfig();
?>
<table class="admintable <?php echo
$bootstrapHelper->getClassMapping('table table-striped
table-bordered'); ?> table-condensed">
<tr>
<th colspan="2"><?php echo
Text::_('HPD_TICKET_DETAIL'); ?></th>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_TICKET_ID'); ?>
</td>
<td>
<?php echo $item->id; ?>
</td>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_CATEGORY'); ?>
</td>
<td>
<?php echo $item->category_title ; ?>
</td>
</tr>
<?php
if ($item->user_id > 0)
{
?>
<tr>
<td>
<?php echo Text::_('HDP_USER'); ?>
</td>
<td>
<?php echo $item->username; ?>[<?php echo
$item->user_id; ?>]
</td>
</tr>
<?php
}
?>
<tr>
<td>
<?php echo Text::_('HDP_NAME'); ?>
</td>
<td>
<?php echo $item->name; ?>
</td>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_EMAIl'); ?>
</td>
<td>
<a href="mailto:<?php echo $item->email;
?>"><?php echo $item->email; ?></a>
</td>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_TICKET_STATUS'); ?>
</td>
<td>
<?php echo $item->status ; ?>
</td>
</tr>
<?php
if ($config->get('enable_rating', 1) &&
$item->rating)
{
switch ($item->rating)
{
case 1:
$img = 'unsatisfactory.png';
$title = Text::_('HDP_VERY_POOR');
break ;
case 2:
$img = 'poor.png';
$title = Text::_('HDP_FAIR');
break ;
case 3:
$img = 'average.png';
$title = Text::_('HDP_AVERAGE');
break ;
case 4:
$img = 'good.png';
$title = Text::_('HDP_GOOD');
break ;
case 5:
$img = 'great.png';
$title = Text::_('HDP_EXCELLENT');
break ;
}
?>
<tr>
<td>
<?php echo Text::_('HDP_RATING'); ?>
</td>
<td>
<img src="<?php echo $rootUri .
'/media/com_helpdeskpro/feedback/' . $img; ?>"
title="<?php echo $title; ?>" />
</td>
</tr>
<?php
}
?>
<tr>
<td>
<?php echo Text::_('HDP_TICKET_PRIORITY'); ?>
</td>
<td>
<?php echo $item->priority ; ?>
</td>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_CREATED_DATE'); ?>
</td>
<td>
<?php echo HTMLHelper::_('date', $item->created_date,
$config->date_format); ?>
</td>
</tr>
<tr>
<td>
<?php echo Text::_('HDP_MODIFIED_DATE'); ?>
</td>
<td>
<?php echo HTMLHelper::_('date', $item->modified_date,
$config->date_format); ?>
</td>
</tr>
<?php
if (count($fields))
{
?>
<tr><th colspan="2"><?php echo
Text::_('HPD_EXTRA_INFORMATION'); ?></th></tr>
<?php
foreach($fields as $field)
{
if (in_array($field->fieldtype, ['Heading',
'Message']))
{
continue;
}
?>
<tr>
<td>
<?php echo $field->title ; ?>
</td>
<td>
<?php echo @$fieldValues[$field->id]; ?>
</td>
</tr>
<?php
}
}
if (!empty($results))
{
foreach($results as $result)
{
echo $result ;
}
}
?>
</table>
PK��[v��`��common/tmpl/ticket_detail.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Router\Route;
$imageFileTypes = array('gif', 'jpg', 'jpeg',
'png', 'csv', 'bmp', 'txt');
$attachmentsPath = JPATH_ROOT .
'/media/com_helpdeskpro/attachments';
?>
<div class="hdp_ticket_description-body">
<?php
if ($config->process_bb_code)
{
echo HelpdeskproHelper::processBBCode($item->message);
}
else
{
if ($config->use_html_editor)
{
echo $item->message;
}
else
{
echo nl2br($item->message);
}
}
if ($item->attachments)
{
$originalFileNames = explode('|',
$item->original_filenames);
$attachments = explode('|', $item->attachments);;
?>
<div class="hdp_ticket_description-file">
<ul>
<?php
$i = 0 ;
foreach($originalFileNames as $fileName)
{
$actualFileName = $attachments[$i++];
if (!file_exists($attachmentsPath . '/' . $actualFileName))
{
continue;
}
$icon = substr($fileName, strrpos($fileName, '.') + 1);
$icon = strtolower($icon);
if
(!file_exists(JPATH_SITE."/media/com_helpdeskpro/assets/images/icons/$icon.png"))
{
$icon="default";
}
if (in_array($icon, $imageFileTypes))
{
?>
<li><a class="hdp-modal" href="<?php echo
Route::_('index.php?option=com_helpdeskpro&task=ticket.download_attachment&filename='.$actualFileName.'&original_filename='.$fileName);
?>"><img height="16" width="16"
src="<?php echo $rootUri .
"/media/com_helpdeskpro/assets/images/icons/$icon.png";
?>" ><?php echo $fileName ?></a></li>
<?php
}
else
{
?>
<li><a href="<?php echo
Route::_('index.php?option=com_helpdeskpro&task=ticket.download_attachment&filename='.$actualFileName.'&original_filename='.$fileName);
?>"><img height="16" width="16"
src="<?php echo $rootUri .
"/media/com_helpdeskpro/assets/images/icons/$icon.png";
?>" ><?php echo $fileName ?></a></li>
<?php
}
}
?>
</ul>
</div>
<?php
}
?>
</div>
PK��[2F��)common/tmpl/ticket_upload_attachments.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
$config = HelpdeskproHelper::getConfig();
$allowedExtensions = $config->allowed_file_types;
$maxNumberOfFiles = (int) $config->max_number_attachments ?: 1;
if (!$allowedExtensions)
{
$allowedExtensions =
'doc|docx|ppt|pptx|pdf|zip|rar|bmp|gif|jpg|jepg|png|swf|zipx';
}
$allowedExtensions = explode('|', $allowedExtensions);
for ($i = 0, $n = count($allowedExtensions); $i < $n; $i++)
{
$allowedExtensions[$i] = '.' .
strtolower(trim($allowedExtensions[$i]));
}
$token = JSession::getFormToken() . '=' . 1;
$maxFileSize = 'null';
if ($config->max_file_size > 0)
{
switch ($config->max_filesize_type)
{
case 1:
$maxFileSize = (int) ($config->max_file_size / 1024 * 1024);
break;
case 2:
$maxFileSize = (int) ($config->max_file_size / 1024);
break;
case 3:
$maxFileSize = (int) $config->max_file_size;
break;
}
}
$document = Factory::getDocument();
$rootUri = Uri::root(true);
$document->addScript($rootUri .
'/media/com_helpdeskpro/js/ticket-upload-attachments.js');
$document->addScriptOptions('maxFiles', $maxNumberOfFiles);
$document->addScriptOptions('acceptedFiles',
implode(',', $allowedExtensions));
$document->addScriptOptions('maxFilesize', $maxFileSize);
Text::script('HDP_DROP_FILES_TO_UPLOAD', true);
$document->addScriptOptions('uploadProcessUrl',
Uri::base(true) .
'/index.php?option=com_helpdeskpro&task=ticket.upload&' .
$token);PK��[�#�common/tmpl/toolbar.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
$btnPrimary = $bootstrapHelper->getClassMapping('btn
btn-primary');
$config = HelpdeskproHelper::getConfig();
?>
<div class="btn-toolbar hdp_toolbar">
<?php
if ($user->authorise('helpdeskpro.changeticketcategory',
'com_helpdeskpro') && count($categories) > 1)
{
?>
<div class="btn-group">
<button class="<?php echo $btnPrimary; ?>
dropdown-toggle" data-toggle="dropdown"><?php echo
Text::_('HDP_CHANGE_TICKET_CATEGORY'); ?> <span
class="caret"></span></button>
<ul class="dropdown-menu">
<?php
foreach ($categories as $category)
{
?>
<li><a
href="javascript:HDP.changeTicketCategory(<?php echo
$category->id; ?>)"><?php echo $category->treename;
?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
if ($user->authorise('helpdeskpro.changeticketstatus',
'com_helpdeskpro') && count($rowStatuses) > 1)
{
?>
<div class="btn-group">
<button class="<?php echo $btnPrimary; ?>
dropdown-toggle" data-toggle="dropdown"><?php echo
Text::_('HDP_CHANGE_TICKET_STATUS'); ?> <span
class="caret"></span></button>
<ul class="dropdown-menu">
<?php
foreach ($rowStatuses as $rowStatus)
{
?>
<li><a href="javascript:HDP.changeTicketStatus(<?php
echo $rowStatus->id; ?>);"><?php echo
$rowStatus->title; ?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
if (count($rowPriorities) && count($rowPriorities) > 1)
{
?>
<div class="btn-group">
<button class="<?php echo $btnPrimary; ?>
dropdown-toggle" data-toggle="dropdown"><?php echo
Text::_('HDP_CHANGE_TICKET_PRIORITY'); ?> <span
class="caret"></span></button>
<ul class="dropdown-menu">
<?php
foreach ($rowPriorities as $rowPriority)
{
?>
<li><a
href="javascript:HDP.changeTicketPriority(<?php echo
$rowPriority->id; ?>)"><?php echo $rowPriority->title;
?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
if ($config->get('enable_rating', 1) && $isCustomer
&& !$item->rating)
{
?>
<div class="btn-group">
<button class="<?php echo $btnPrimary; ?>
dropdown-toggle" data-toggle="dropdown"><?php echo
Text::_('HDP_TICKET_RATING'); ?> <span
class="caret"></span></button>
<ul class="dropdown-menu">
<li><a
href="javascript:HDP.ticketRating(1)"><?php echo
Text::_('HDP_VERY_POOR'); ?></a></li>
<li><a
href="javascript:HDP.ticketRating(2)"><?php echo
Text::_('HDP_FAIR'); ?></a></li>
<li><a
href="javascript:HDP.ticketRating(3)"><?php echo
Text::_('HDP_AVERAGE'); ?></a></li>
<li><a
href="javascript:HDP.ticketRating(4)"><?php echo
Text::_('HDP_GOOD'); ?></a></li>
<li><a
href="javascript:HDP.ticketRating(5)"><?php echo
Text::_('HDP_EXCELLENT'); ?></a></li>
</ul>
</div>
<?php
}
if (!empty($rowLabels))
{
?>
<div class="btn-group">
<button class="<?php echo $btnPrimary; ?>
dropdown-toggle" data-toggle="dropdown"><?php echo
Text::_('HDP_APPLY_LABEL'); ?><span
class="caret"></span></button>
<ul class="dropdown-menu">
<li><a
href="javascript:HDP.applyTicketLabel(0)"><?php echo
Text::_('HDP_NO_LABEL'); ?></a></li>
<?php
foreach ($rowLabels as $rowLabel)
{
?>
<li><a href="javascript:HDP.applyTicketLabel(<?php
echo $rowLabel->id; ?>)"><?php echo $rowLabel->title;
?></a></li>
<?php
}
?>
</ul>
</div>
<?php
}
if (!empty($convertToKb))
{
?>
<div class="btn-group">
<input type="button" class="<?php echo
$bootstrapHelper->getClassMapping('btn'); ?>
btn-success" value="<?php echo
Text::_('HDP_CONVERT_TO_KB'); ?>"
onclick="convertToArticle(this.form)"
style="margin-left:20px;" />
</div>
<?php
}
?>
</div>
<?php
PK��[�s�XXfieldlayout/checkboxes.phpnu�[���<?php
/**
* @package Joomla
* @subpackage Event Booking
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2010 - 2018 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
$size = (int) $row->size ?: 1;
$span = intval(12 / $size);
$i = 0;
$numberOptions = count($options);
$rowFluid = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('row-fluid') :
'row-fluid';
$spanClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('span' . $span) :
'span' . $span;
$clearFixClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('clearfix') :
'clearfix';
$ukFieldsetClass = $bootstrapHelper ?
$bootstrapHelper->getFrameworkClass('uk-fieldset', 2) :
'';
?>
<fieldset id="<?php echo $name; ?>" class="<?php
echo $ukFieldsetClass . $clearFixClass; ?>
hdp-checkboxes-container">
<div class="<?php echo $rowFluid . ' ' .
$clearFixClass; ?>">
<?php
foreach ($options as $option)
{
$i++;
$checked = in_array($option, $selectedOptions) ? 'checked' :
'';
?>
<div class="<?php echo $spanClass ?>">
<label class="checkbox">
<input type="checkbox" id="<?php
echo $name.$i; ?>"
name="<?php echo $name; ?>[]"
value="<?php echo
htmlspecialchars($option, ENT_COMPAT, 'UTF-8') ?>"
<?php echo $checked.$attributes; ?>
/><?php echo $option; ?>
</label>
</div>
<?php
if ($i % $size == 0 && $i < $numberOptions)
{
?>
</div>
<div class="<?php echo $rowFluid . ' '
. $clearFixClass; ?>">
<?php
}
}
?>
</div>
</fieldset>
PK��[O�o��fieldlayout/controlgroup.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
$controlGroupClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('control-group') :
'control-group';
$controlLabelClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('control-label') :
'control-label';
$controlsClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('controls') :
'controls';
if ($tableLess)
{
?>
<div class="<?php echo $controlGroupClass; ?>"
<?php echo $controlGroupAttributes ?>>
<div class="<?php echo $controlLabelClass
?>">
<?php echo $label; ?>
</div>
<div class="<?php echo $controlsClass; ?>">
<?php echo $input; ?>
</div>
</div>
<?php
}
else
{
?>
<tr <?php echo $controlGroupAttributes; ?>>
<td class="key">
<?php
echo $row->title;
if ($row->required)
{
?>
<span class="required">*</span>
<?php
}
?>
</td>
<td>
<?php echo $input; ?>
</td>
</tr>
<?php
}
PK��[��l���fieldlayout/heading.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<h3 class="hdp-heading" <?php echo $controlGroupAttributes;
?>><?php echo Text::_($title); ?></h3>
PK��[�W�B��fieldlayout/label.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
$class = '';
$useTooltip = false;
if (!empty($description))
{
HTMLHelper::_('bootstrap.tooltip');
Factory::getDocument()->addStyleDeclaration(".hasTip{display:block
!important}");
$useTooltip = true;
$class = 'hasTooltip hasTip';
}
?>
<label id="<?php echo $name; ?>-lbl" for="<?php
echo $name; ?>"<?php if ($class) echo ' class="'
. $class . '"' ?> <?php if ($useTooltip) echo '
title="' . HTMLHelper::tooltipText(trim($title, ':'),
$description, 0) . '"'; ?>>
<?php
echo $title;
if ($row->required)
{
?>
<span class="required">*</span>
<?php
}
?>
</label>PK��[�K��fieldlayout/message.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
$controlGroup = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('control-group') :
'control-group';
?>
<div class="<?php echo $controlGroup; ?> hdp-message"
<?php echo $controlGroupAttributes; ?>><?php echo $description;
?></div>
PK��[k5�_bbfieldlayout/radio.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
$size = (int) $row->size ?: 1;
$span = intval(12 / $size);
$i = 0;
$numberOptions = count($options);
$rowFluid = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('row-fluid') :
'row-fluid';
$spanClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('span' . $span) :
'span' . $span;
$clearFixClass = $bootstrapHelper ?
$bootstrapHelper->getClassMapping('clearfix') :
'clearfix';
$ukFieldsetClass = $bootstrapHelper ?
$bootstrapHelper->getFrameworkClass('uk-fieldset', 2) :
'';
?>
<fieldset id="<?php echo $name; ?>" class="<?php
echo $ukFieldsetClass . $clearFixClass; ?>
hdp-radio-container">
<div class="<?php echo $rowFluid . ' ' .
$clearFixClass; ?>">
<?php
$value = trim($value);
foreach ($options as $option)
{
$i++;
$checked = (trim($option) == $value) ? 'checked' :
'';
?>
<div class="<?php echo $spanClass ?>">
<label class="radio">
<input type="radio" id="<?php echo
$name.$i; ?>"
name="<?php echo $name; ?>"
value="<?php echo
htmlspecialchars($option, ENT_COMPAT, 'UTF-8') ?>"
<?php echo $checked.$attributes; ?>
/><?php echo $option; ?>
</label>
</div>
<?php
if ($i % $size == 0 && $i < $numberOptions)
{
?>
</div>
<div class="<?php echo $rowFluid . ' '
. $clearFixClass; ?>">
<?php
}
}
?>
</div>
</fieldset>
PK��[
����fieldlayout/text.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
?>
<input type="<?php echo $type; ?>"
name="<?php echo $name; ?>" id="<?php echo
$name; ?>"
value=""<?php echo $attributes; ?> />
PK��[�6U,��fieldlayout/textarea.phpnu�[���<?php
/**
* @package Joomla
* @subpackage OSMembership
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
?>
<textarea name="<?php echo $name; ?>"
id="<?php echo $name; ?>"<?php echo
$attributes; ?>><?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?></textarea>
PK��[�S;�c)c)Ticket/Html.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
namespace OSSolution\HelpdeskPro\Site\View\Ticket;
use HelpdeskProHelperBootstrap;
use Joomla\CMS\Captcha\Captcha;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
use OSL\View\HtmlView;
use OSSolution\HelpdeskPro\Site\Helper\Database as
HelpdeskproHelperDatabase;
use OSSolution\HelpdeskPro\Site\Helper\Helper as HelpdeskproHelper;
use OSSolution\HelpdeskPro\Site\Helper\Html as HelpdeskproHelperHtml;
use OSSolution\HelpdeskPro\Site\Helper\Jquery as HelpdeskproHelperJquery;
use OSSolution\HelpdeskPro\Site\Helper\Route as RouteHelper;
defined('_JEXEC') or die;
/**
* Class Html
*
* @property \OSSolution\HelpdeskPro\Admin\Model\Ticket $model
*/
class Html extends HtmlView
{
protected function beforeRender()
{
// Load jQuery validation engine
HelpdeskproHelperJquery::validateForm();
// Remove the uploaded files data from section
$this->container->session->clear('hdp_uploaded_files');
$this->container->session->clear('hdp_uploaded_files_original_names');
$this->bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
$layout = $this->getLayout();
if ($layout == 'form')
{
$this->beforeRenderTicketForm();
return;
}
HelpdeskproHelper::loadEditable();
/* @var \JApplicationSite $app */
$app = $this->container->app;
$user = $this->container->user;
$config = HelpdeskproHelper::getConfig();
$fieldSuffix = HelpdeskproHelper::getFieldSuffix();
$item = $this->model->getData();
if (!$item->id)
{
$app->enqueueMessage(Text::_('HDP_TICKET_NOT_EXISTS'));
$app->redirect(Route::_(RouteHelper::getTicketsRoute(), false));
}
// Require users to login if they try to access support ticket via public
link
if (!$config->allow_public_user_submit_ticket &&
$item->is_ticket_code)
{
$redirectUrl = RouteHelper::getTicketRoute($item->id);
if ($user->id)
{
$app->redirect(Route::_($redirectUrl, false));
}
else
{
$app->enqueueMessage(Text::_('HDP_PLEASE_LOGIN_TO_CONTINUE'));
$app->redirect(Route::_('index.php?option=com_users&view=login&return='
. base64_encode($redirectUrl)));
}
}
$canAccess = HelpdeskproHelper::checkTicketAccess($item);
if (!$canAccess)
{
if (!$user->id && !$item->is_ticket_code)
{
$app->enqueueMessage(Text::_('HDP_PLEASE_LOGIN_TO_CONTINUE'));
$app->redirect(Route::_('index.php?option=com_users&view=login&return='
. base64_encode(Uri::getInstance()->toString())));
}
else
{
$app->enqueueMessage(Text::_('HDP_INVALID_TICKET'),
'warning');
$app->redirect(Uri::root());
}
}
$rows = HelpdeskproHelperDatabase::getAllCategories(
'ordering',
['access IN (' . implode(',',
$user->getAuthorisedViewLevels()) . ')'],
$fieldSuffix
);
$children = [];
if ($rows)
{
// first pass - collect children
foreach ($rows as $v)
{
$pt = $v->parent_id;
$list = @$children[$pt] ? $children[$pt] : [];
array_push($list, $v);
$children[$pt] = $list;
}
}
$categories = HTMLHelper::_('menu.treerecurse', 0,
'', [], $children, 9999, 0, 0);
$rowStatuses =
HelpdeskproHelperDatabase::getAllStatuses('ordering',
$fieldSuffix);
$rowPriorities =
HelpdeskproHelperDatabase::getAllPriorities('ordering',
$fieldSuffix);
if ($user->id == $item->user_id || $item->is_ticket_code)
{
$isCustomer = 1;
}
else
{
$isCustomer = 0;
}
if ($isCustomer && ($item->status_id ==
$config->closed_ticket_status))
{
$canComment = false;
}
else
{
$canComment = true;
}
$message = $this->input->getHtml('message');
if ($config->highlight_code)
{
HelpdeskproHelper::loadHighlighter();
}
$this->loadCaptcha($app, $config);
// Add js variables
$maxNumberOfFiles = $config->max_number_attachments ? (int)
$config->max_number_attachments : 1;
$siteUrl = Uri::root();
$this->container->document->addScriptDeclaration("
var maxAttachment = $maxNumberOfFiles;
var currentCategory = 0;
var currentNumberAttachment = 1;
var currentStatus = 0;
var hdpSiteUrl = '$siteUrl';
var jItemId = " . (int) $this->Itemid . ";
");
PluginHelper::importPlugin('helpdeskpro');
//Trigger plugins
$results =
$this->container->app->triggerEvent('onViewTicket',
[$item]);
// Pathway
$pathway = $app->getPathway();
$pathway->addItem(Text::sprintf('HDP_TICKET_NUMBER',
$item->id));
$this->fields =
HelpdeskproHelper::getFields($item->category_id);
$this->messages = $this->model->getMessages();
$this->fieldValues = $this->model->getFieldsValue();
$this->rowStatuses = $rowStatuses;
$this->rowPriorities = $rowPriorities;
$this->categories = $categories;
$this->config = $config;
$this->item = $item;
$this->isCustomer = $isCustomer;
$this->canComment = $canComment;
$this->message = $message;
$this->results = $results;
}
/**
* Prepare data to render submit ticket form
*
* @throws \Exception
*/
private function beforeRenderTicketForm()
{
/* @var \JApplicationSite $app */
$app = $this->container->app;
$user = $this->container->user;
$config = HelpdeskproHelper::getConfig();
$fieldSuffix = HelpdeskproHelper::getFieldSuffix();
$userId = $user->get('id');
$active = $app->getMenu()->getActive();
if ($active && isset($active->query['view'],
$active->query['layout'])
&& $active->query['view'] == 'ticket'
&& $active->query['layout'] == 'form')
{
$params = $active->getParams();
}
else
{
$params = new Registry;
}
$categoryId = $this->input->getInt('category_id', (int)
$params->get('default_category_id'));
$priorityId = $this->input->getInt('priority_id', 0);
if (!$userId && !$config->allow_public_user_submit_ticket)
{
//Redirect user to login page
$app->enqueueMessage(Text::_('HDP_LOGIN_TO_SUBMIT_TICKET'));
$app->redirect('index.php?option=com_users&view=login&return='
. base64_encode(Uri::getInstance()->toString()));
}
$filters = ['access IN (' . implode(',',
$user->getAuthorisedViewLevels()) . ')'];
if ($params->get('category_ids'))
{
$categoryIds =
array_filter(ArrayHelper::toInteger(explode(',',
$params->get('category_ids'))));
if (count($categoryIds))
{
$filters[] = ['id IN (' . implode(',',
$categoryIds) . ')'];
}
}
$rows = HelpdeskproHelperDatabase::getAllCategories(
'ordering',
$filters,
$fieldSuffix
);
$lists['category_id'] =
HelpdeskproHelperHtml::buildCategoryDropdown(
$categoryId,
'category_id',
'class="uk-select form-control input-xlarge form-select
validate[required]"
onchange="HDP.showFields(this.form);"',
$rows
);
$rowPriorities =
HelpdeskproHelperDatabase::getAllPriorities('ordering',
$fieldSuffix);
if (count($rowPriorities))
{
$options = [];
$options[] = HTMLHelper::_('select.option',
'', Text::_('HDP_CHOOSE_PRIORITY'), 'id',
'title');
$options = array_merge($options, $rowPriorities);
$lists['priority_id'] =
HTMLHelper::_('select.genericlist', $options,
'priority_id',
[
'option.text.toHtml' => false,
'option.text' => 'title',
'option.key' => 'id',
'list.attr' => 'class="uk-select
input-large validate[required] form-select"',
'list.select' => $priorityId > 0 ? $priorityId
: $config->default_ticket_priority_id]);
}
// Custom fields
$rowFields = HelpdeskproHelper::getAllFields();
$form = new \HDPForm($rowFields);
$relation = HelpdeskproHelper::getFieldCategoryRelation();
$form->prepareFormField($categoryId, $relation);
$fieldJs = "fields = new Array();\n";
foreach ($relation as $catId => $fieldList)
{
$fieldJs .= ' fields[' . $catId . '] = new
Array("' . implode('","', $fieldList) .
'");' . "\n";
}
$this->container->document->addScriptDeclaration($fieldJs);
$data = $this->input->getData();
if ($this->input->getMethod() == 'POST')
{
$useDefault = false;
}
else
{
$useDefault = true;
}
$form->bind($data, $useDefault);
$this->loadCaptcha($app, $config);
$maxNumberOfFiles = $config->max_number_attachments ? (int)
$config->max_number_attachments : 1;
$this->container->document->addScriptDeclaration("
var maxAttachment = $maxNumberOfFiles;
var currentCategory = $categoryId;
var currentNumberAttachment = 1;
");
// Pathway
$pathway = $app->getPathway();
$pathway->addItem(Text::_('HDP_NEW_TICKET'));
$this->lists = $lists;
$this->config = $config;
$this->userId = $userId;
$this->form = $form;
$this->categoryId = $categoryId;
$this->params = $params;
$this->rowCategories = $rows;
}
/**
* Load captcha for submit ticket and add comment form
*
* @param \JApplicationSite $app
* @param \OSL\Config\Config $config
*/
protected function loadCaptcha($app, $config)
{
// Captcha
$showCaptcha = 0;
$user = $this->container->user;
if (!$config->enable_captcha || ($user->id &&
$config->enable_captcha == '2'))
{
$enableCaptcha = false;
}
else
{
$enableCaptcha = true;
}
if ($enableCaptcha)
{
$captchaPlugin = $app->get('captcha',
$this->container->appConfig->get('captcha'));
if (!$captchaPlugin)
{
// Hardcode to recaptcha, reduce support request
$captchaPlugin = 'recaptcha';
}
// Check to make sure Captcha is enabled
$plugin = PluginHelper::getPlugin('captcha', $captchaPlugin);
if ($plugin)
{
$showCaptcha = 1;
$this->captcha =
Captcha::getInstance($captchaPlugin)->display('dynamic_recaptcha_1',
'dynamic_recaptcha_1', 'required');
}
else
{
$app->enqueueMessage(Text::_('EB_CAPTCHA_NOT_ACTIVATED_IN_YOUR_SITE'),
'error');
}
}
$this->showCaptcha = $showCaptcha;
}
}PK��[���}}Ticket/tmpl/default.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
HTMLHelper::_('behavior.core');
HTMLHelper::_('behavior.keepalive');
if (!HelpdeskproHelper::isJoomla4())
{
HTMLHelper::_('behavior.modal', 'a.hdp-modal');
}
$document = Factory::getDocument();
$rootUri = Uri::root(true);
if (!$this->config->use_html_editor &&
$this->config->process_bb_code)
{
$document->addScript($rootUri .
'/media/com_helpdeskpro/assets/js/jquery.selection.js');
$document->addScript($rootUri .
'/media/com_helpdeskpro/assets/js/helpdeskpro.bbcode.js');
}
$document->addScript($rootUri .
'/media/com_helpdeskpro/js/site-ticket-default.js');
Text::script('HDP_ENTER_COMMENT_FOR_TICKET', true);
$cbIntegration = file_exists(JPATH_ROOT .
'/components/com_comprofiler/comprofiler.php');
$editor =
Editor::getInstance(Factory::getConfig()->get('editor'));
$user = Factory::getUser();
$maxNumberOfFiles = $this->config->max_number_attachments ?
$this->config->max_number_attachments : 1;
if ($this->input->getMethod() == 'POST')
{
$this->captchaInvalid = true;
}
else
{
$this->captchaInvalid = false;
}
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = $this->bootstrapHelper;
$formHorizontalClass = $bootstrapHelper->getClassMapping('form
form-horizontal');
$rowFluidClass =
$bootstrapHelper->getClassMapping('row-fluid');
$controlGroupClass =
$bootstrapHelper->getClassMapping('control-group');
$controlLabelClass =
$bootstrapHelper->getClassMapping('control-label');
$controlsClass =
$bootstrapHelper->getClassMapping('controls');
$span3Class =
$bootstrapHelper->getClassMapping('span3');
$span9Class =
$bootstrapHelper->getClassMapping('span9');
$btnClass =
$bootstrapHelper->getClassMapping('btn');
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn
btn-primary');
?>
<h1 class="hdp_title"><?php echo
Text::_('HDP_VIEW_TICKET'); ?></h1>
<div id="hdp_container" class="container-fluid">
<form action="<?php echo
Route::_('index.php?option=com_helpdeskpro&view=ticket&Itemid='.$this->Itemid);
?>" method="post" name="adminForm"
id="adminForm" enctype="multipart/form-data">
<!--Toolbar buttons-->
<div class="row-fluid admintable">
<?php
$layoutData = array(
'categories' => $this->categories,
'rowStatuses' => $this->rowStatuses,
'rowPriorities' => $this->rowPriorities,
'isCustomer' => $this->isCustomer,
'item' => $this->item,
'user' => $user
);
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/toolbar.php',
$layoutData);
?>
</div>
<div class="row-fluid">
<div id="hdp_left_panel" class="span9">
<table class="adminform">
<tr>
<td>
<strong>
[#<?php echo $this->item->id ?>] - <?php echo
$this->escape($this->item->subject); ?>
</strong>
</td>
</tr>
<tr>
<td>
<?php
$layoutData = array(
'item' => $this->item,
'rootUri' => $rootUri,
'config' => $this->config
);
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_detail.php',
$layoutData);
?>
</td>
</tr>
<tr>
<th>
<h2 class="hdp_heading hdp_comments_heading"><?php
echo Text::_('HDP_COMMENTS'); ?>
<?php
if ($this->canComment)
{
?>
<a
href="javascript:HDP.showMessageBox();">
<span
id="hdp_add_comment_link"><?php echo
Text::_('HDP_ADD_COMMENT'); ?></span>
<img width="32"
height="32" src="<?php echo
$rootUri.'/media/com_helpdeskpro/assets/images/icons/icon_add.jpg'?>">
</a>
<?php
}
?>
</h2>
</th>
</tr>
<?php
$layoutData = array(
'canComment' => $this->canComment,
'captchaInvalid' => $this->captchaInvalid,
'config' => $this->config,
'maxNumberOfFiles' => $maxNumberOfFiles,
'rootUri' => $rootUri,
'editor' => $editor,
'message' => $this->message,
'captcha' => isset($this->captcha) ? $this->captcha
: ''
);
// Comment form
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_add_comment.php',
$layoutData);
// List of comments
$layoutData = array(
'messages' => $this->messages,
'user' => $user,
'cbIntegration' => $cbIntegration,
'rootUri' => $rootUri,
'config' => $this->config
);
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_comments.php',
$layoutData);
?>
</table>
</div>
<div id="hdp_right_panel" class="<?php echo
$span9Class; ?>">
<?php
// Customer information
$layoutData = array(
'item' => $this->item,
'fields' => $this->fields,
'fieldValues' => $this->fieldValues,
'rootUri' => $rootUri,
'config' => $this->config,
'results' => $this->results
);
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_customer_info.php',
$layoutData);
?>
</div>
</div>
<input type="hidden" name="id" value="<?php
echo $this->item->id; ?>" />
<input type="hidden" name="task" value=""
/>
<input type="hidden" name="new_value"
value="0" />
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<?php
if ($this->item->is_ticket_code) {
?>
<input type="hidden" name="ticket_code"
value="<?php echo $this->item->ticket_code ?>" />
<?php
}
?>
<?php echo HTMLHelper::_( 'form.token' ); ?>
</form>
</div>PK��[�$����Ticket/tmpl/form.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
HTMLHelper::_('behavior.core');
HTMLHelper::_('behavior.keepalive');
$document = Factory::getDocument();
$rootUri = Uri::root();
$editor =
Editor::getInstance(Factory::getConfig()->get('editor'));
if (!$this->config->use_html_editor &&
$this->config->process_bb_code)
{
$document->addScript($rootUri .
'/media/com_helpdeskpro/assets/js/jquery.selection.js');
$document->addScript($rootUri .
'/media/com_helpdeskpro/assets/js/helpdeskpro.bbcode.js');
}
$document->addScript($rootUri .
'/media/com_helpdeskpro/js/site-ticket-form.js');
/* @var HelpdeskproViewTicketHtml $this */
$role = HelpdeskproHelper::getUserRole($this->userId);
/* @var $bootstrapHelper HelpdeskProHelperBootstrap */
$bootstrapHelper = $this->bootstrapHelper;
$formHorizontalClass = $bootstrapHelper->getClassMapping('form
form-horizontal');
$rowFluidClass =
$bootstrapHelper->getClassMapping('row-fluid');
$controlGroupClass =
$bootstrapHelper->getClassMapping('control-group');
$controlLabelClass =
$bootstrapHelper->getClassMapping('control-label');
$controlsClass =
$bootstrapHelper->getClassMapping('controls');
$btnClass =
$bootstrapHelper->getClassMapping('btn');
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn
btn-primary');
?>
<div class="container-fluid">
<h1 class="hdp_title title"><?php echo
$this->params->get('page_heading') ?:
Text::_('HDP_NEW_TICKET'); ?></h1>
<form class="<?php echo $formHorizontalClass; ?>"
name="hdp_form" id="hdp_form" action="<?php
echo
Route::_('index.php?option=com_helpdeskpro&Itemid='.$this->Itemid);
?>" method="post"
enctype="multipart/form-data">
<?php
if (!$this->userId)
{
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass; ?>"
for="name"><?php echo Text::_('HDP_NAME');
?><span class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<input type="text" id="name"
name="name" class="input-xlarge form-control
validate[required]" value="<?php echo
$this->escape($this->input->getString('name'));
?>" />
</div>
</div>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass; ?>"
for="email"><?php echo Text::_('HDP_EMAIL');
?><span class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<input type="text" id="email"
name="email" class="input-xlarge form-control
validate[required,custom[email]]" value="<?php echo
$this->escape($this->input->getString('email'));
?>" />
</div>
</div>
<?php
}
if (count($this->rowCategories) > 1)
{
?>
<div class="<?php echo $controlGroupClass;
?>">
<label class="<?php echo $controlLabelClass;
?>" for="category_id"><?php echo
Text::_('HDP_CATEGORY'); ?><span
class="required">*</span></label>
<div class="<?php echo $controlsClass;
?>">
<?php echo $this->lists['category_id'] ; ?>
</div>
</div>
<?php
}
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass; ?>"
for="subject"><?php echo Text::_('HDP_SUBJECT');
?><span class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<input type="text" id="subject"
name="subject" class="input-xlarge form-control
validate[required]" value="<?php echo
$this->escape($this->input->getString('subject'));
?>" size="50" />
</div>
</div>
<?php
if (isset($this->lists['priority_id']))
{
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass; ?>"
for="priority_id"><?php echo
Text::_('HDP_PRIORITY'); ?><span
class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<?php echo $this->lists['priority_id'] ; ?>
</div>
</div>
<?php
}
$fields = $this->form->getFields();
/* @var HDPFormField $field*/
foreach ($fields as $field)
{
echo $field->getControlGroup(true, $this->bootstrapHelper);
}
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass; ?>"
for="message"><?php echo Text::_('HDP_MESSAGE');
?><span class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<?php
if ($this->config->use_html_editor)
{
echo $editor->display( 'message',
$this->input->getHtml('message'), '100%',
'250', '75', '10' );
}
else
{
?>
<textarea rows="10" cols="70"
class="hdp_fullwidth form-control validate[required]"
name="message" id="message"><?php echo
$this->escape($this->input->getString('message'));
?></textarea>
<?php
}
?>
</div>
</div>
<?php
if ($this->config->enable_attachment)
{
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass;
?>"><?php echo Text::_('HDP_ATTACHMENTS');
?></label>
<div class="<?php echo $controlsClass; ?>">
<div id="hdp_ticket_attachments"
class="dropzone needsclick dz-clickable">
</div>
</div>
</div>
<?php
}
if ($this->showCaptcha)
{
?>
<div class="<?php echo $controlGroupClass; ?>">
<label class="<?php echo $controlLabelClass;
?>"><?php echo Text::_('HDP_CAPTCHA');
?><span class="required">*</span></label>
<div class="<?php echo $controlsClass; ?>">
<?php echo $this->captcha; ?>
</div>
</div>
<?php
}
?>
<div class="form-actions">
<input type="button" name="btnSubmit"
class="<?php echo $btnPrimaryClass; ?>"
value="<?php echo Text::_('HDP_CANCEL'); ?>"
onclick="HDP.ticketList();" />
<input type="submit" name="btnSubmit"
class="<?php echo $btnPrimaryClass; ?>"
value="<?php echo Text::_('HDP_SUBMIT_TICKET');
?>" />
</div>
<?php
if ($this->config->enable_attachment)
{
echo
HelpdeskproHelperHtml::loadCommonLayout('common/tmpl/ticket_upload_attachments.php');
}
?>
<input type="hidden" name="option"
value="com_helpdeskpro" />
<input type="hidden" name="task"
value="ticket.save" />
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>" />
<?php
if (count($this->rowCategories) == 1)
{
$categoryId = $this->rowCategories[0]->id;
?>
<input type="hidden" name="category_id"
value="<?php echo $categoryId; ?>" />
<?php
}
?>
<?php echo HTMLHelper::_( 'form.token' ); ?>
</form>
</div>PK��[%τJTickets/Html.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
namespace OSSolution\HelpdeskPro\Site\View\Tickets;
use HelpdeskProHelperBootstrap;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
use OSL\View\ListView;
use OSSolution\HelpdeskPro\Site\Helper\Database as
HelpdeskproHelperDatabase;
use OSSolution\HelpdeskPro\Site\Helper\Helper as HelpdeskproHelper;
use OSSolution\HelpdeskPro\Site\Helper\Html as HelpdeskproHelperHtml;
defined('_JEXEC') or die;
/**
* Class Html
*
* @property-read \OSSolution\HelpdeskPro\Admin\Model\Tickets $model
*/
class Html extends ListView
{
protected $lists = array();
protected function beforeRender()
{
parent::beforeRender();
$user = $this->container->user;
if (!$user->id)
{
$redirectUrl =
Route::_('index.php?option=com_users&view=login&return='
. base64_encode(Uri::getInstance()->toString()));
$this->container->app->enqueueMessage(Text::_('HDP_PLEASE_LOGIN_TO_CONTINUE'));
$this->container->app->redirect($redirectUrl);
}
$config = HelpdeskproHelper::getConfig();
// Category filter
$filters = array();
$role = 'admin';
if (!$user->authorise('core.admin',
'com_helpdeskpro'))
{
$userId = $user->get('id');
$email = $user->get('email');
$role = HelpdeskproHelper::getUserRole();
$managedCategoryIds =
HelpdeskproHelper::getTicketCategoryIds($user->get('username'));
$managedCategoryIds = ArrayHelper::toInteger($managedCategoryIds);
if (count($managedCategoryIds))
{
$filters[] = '(id IN (' . implode(',',
$managedCategoryIds) . ') OR id IN (SELECT DISTINCT category_id FROM
#__helpdeskpro_tickets AS t WHERE t.staff_id =' . $userId .
'))';
}
elseif ($role == 'staff')
{
$filters[] = 'id IN (SELECT DISTINCT category_id FROM
#__helpdeskpro_tickets AS t WHERE t.staff_id =' . $userId .
')';
}
else
{
$db = $this->model->getDbo();
$filters[] = 'id IN (SELECT DISTINCT category_id FROM
#__helpdeskpro_tickets AS t WHERE t.user_id = ' . $userId . ' OR
t.email = ' . $db->quote($email) . ')';
}
$filters[] = '`access` IN (' . implode(',',
$user->getAuthorisedViewLevels()) . ')';
}
$fieldSuffix = HelpdeskproHelper::getFieldSuffix();
$rows = HelpdeskproHelperDatabase::getAllCategories('ordering',
$filters, $fieldSuffix);
$this->lists['filter_category_id'] =
HelpdeskproHelperHtml::buildCategoryDropdown($this->state->filter_category_id,
'filter_category_id', 'class="input-large
form-select" onchange="submit();"', $rows);
// Ticket status filter
$rowStatuses =
HelpdeskproHelperDatabase::getAllStatuses('ordering',
$fieldSuffix);
if (count($rowStatuses))
{
$options = array();
$options[] = HTMLHelper::_('select.option', -1,
Text::_('HDP_TICKET_STATUS'), 'id',
'title');
$options[] = HTMLHelper::_('select.option', 0,
Text::_('HDP_ALL_STATUSES'), 'id', 'title');
$options = array_merge($options, $rowStatuses);
$this->lists['filter_status_id'] =
HTMLHelper::_('select.genericlist', $options,
'filter_status_id',
array(
'option.text.toHtml' => false,
'option.text' => 'title',
'option.key' => 'id',
'list.attr' => 'class="input-medium
form-select" onchange="submit();"',
'list.select' =>
$this->state->filter_status_id));
}
$statusList = array();
foreach ($rowStatuses as $status)
{
$statusList[$status->id] = $status->title;
}
// Ticket priority filter
$rowPriorities =
HelpdeskproHelperDatabase::getAllPriorities('ordering',
$fieldSuffix);
if (count($rowPriorities))
{
$options = array();
$options[] = HTMLHelper::_('select.option', 0,
Text::_('HDP_ALL_PRIORITIES'), 'id',
'title');
$options = array_merge($options, $rowPriorities);
$this->lists['filter_priority_id'] =
HTMLHelper::_('select.genericlist', $options,
'filter_priority_id',
array(
'option.text.toHtml' => false,
'option.text' => 'title',
'option.key' => 'id',
'list.attr' => 'class="input-medium
form-select" onchange="submit();"',
'list.select' =>
$this->state->filter_priority_id));
}
$priorityList = array();
foreach ($rowPriorities as $priority)
{
$priorityList[$priority->id] = $priority->title;
}
if (PluginHelper::isEnabled('helpdeskpro',
'assignticket') && in_array($role, ['admin',
'manager']))
{
$staffDisplayField = $config->get('staff_display_field',
'username') ?: 'username';
$staffs =
HelpdeskproHelperDatabase::getAllStaffs($config->staff_group_id);
$options = array();
$options[] =
HTMLHelper::_('select.option', 0,
Text::_('HDP_SELECT_STAFF'), 'id',
$staffDisplayField);
$options = array_merge($options, $staffs);
$this->lists['filter_staff_id'] =
HTMLHelper::_('select.genericlist', $options,
'filter_staff_id', ' class="input-medium
form-select" onchange="submit();" ', 'id',
$staffDisplayField, $this->state->filter_staff_id);
$rowStaffs = array();
foreach ($staffs as $staff)
{
$rowStaffs[$staff->id] = $staff->{$staffDisplayField};
}
$this->staffs = $rowStaffs;
$this->showStaffColumn = true;
}
$active = Factory::getApplication()->getMenu()->getActive();
if ($active && isset($active->query['view'])
&& $active->query['view'] == 'tickets')
{
$params = $active->getParams();
}
else
{
$params = new Registry;
}
$this->fields =
HelpdeskproHelperDatabase::getFieldsOnListView($fieldSuffix);
$this->fieldValues =
$this->model->getFieldsData($this->fields);
$this->statusList = $statusList;
$this->priorityList = $priorityList;
$this->config = $config;
$this->params = $params;
$this->bootstrapHelper = HelpdeskProHelperBootstrap::getInstance();
}
}PK��[}��#�#Tickets/tmpl/default.phpnu�[���<?php
/**
* @version 4.3.0
* @package Joomla
* @subpackage Helpdesk Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2013 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined( '_JEXEC' ) or die ;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use OSSolution\HelpdeskPro\Site\Helper\Route as RouteHelper;
$ordering = $this->state->filter_order == 'tbl.ordering';
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip',
array('placement' => 'top'));
$cols = 4;
$centerClass =
$this->bootstrapHelper->getClassMapping('center');
$pullLeft =
$this->bootstrapHelper->getClassMapping('pull-left');
?>
<div id="hdp_container" class="container-fluid">
<h1 class="hdp_title"><?php echo
$this->params->get('page_heading') ?:
Text::_('HDP_MY_TICKETS'); ?>
<span class="newticket_link"><a
href="<?php echo
Route::_('index.php?option=com_helpdeskpro&task=ticket.add&Itemid='.$this->Itemid);
?>"><i class="icon-new"></i><?php echo
Text::_('HDP_SUBMIT_TICKET'); ?></a></span>
</h1>
<form action="<?php echo
Route::_(RouteHelper::getTicketsRoute()); ?>"
method="post" name="adminForm"
id="adminForm">
<fieldset class="filters btn-toolbar <?php echo
$this->bootstrapHelper->getClassMapping('clearfix');
?>">
<div class="filter-search btn-group <?php echo
$pullLeft; ?>>">
<input type="text"
name="filter_search" id="filter_search"
placeholder="<?php echo Text::_('JSEARCH_FILTER');
?>" value="<?php echo
$this->escape($this->lists['search']); ?>"
class="hasTooltip" title="<?php echo
HTMLHelper::tooltipText('HDP_FILTER_SEARCH_TICKETS_DESC');
?>" />
</div>
<div class="btn-group <?php echo
$this->bootstrapHelper->getClassMapping('pull-left');
?>">
<button type="submit" class="btn
hasTooltip" title="<?php echo
HTMLHelper::tooltipText('JSEARCH_FILTER_SUBMIT');
?>"><span class="<?php echo
$this->bootstrapHelper->getClassMapping('icon-search');
?>"></span></button>
<button type="button" class="btn
hasTooltip" title="<?php echo
HTMLHelper::tooltipText('JSEARCH_FILTER_CLEAR'); ?>"
onclick="document.getElementById('filter_search').value='';this.form.submit();"><span
class="<?php echo
$this->bootstrapHelper->getClassMapping('icon-remove');
?>"></span></button>
</div>
<div class="btn-group <?php echo $pullLeft;
?>">
<?php
echo $this->lists['filter_category_id'];
if (isset($this->lists['filter_status_id']))
{
echo $this->lists['filter_status_id'];
}
if (isset($this->lists['filter_priority_id']))
{
echo $this->lists['filter_priority_id'];
}
if (isset($this->lists['filter_staff_id']))
{
echo $this->lists['filter_staff_id'];
}
?>
</div>
</fieldset>
<table class="<?php echo
$this->bootstrapHelper->getClassMapping('table table-striped
table-bordered'); ?> table-hover">
<thead>
<tr>
<th style="text-align: left;">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_TITLE'), 'tbl.subject',
$this->state->filter_order_Dir, $this->state->filter_order );
?>
</th>
<?php
foreach ($this->fields as $field)
{
$cols++;
?>
<th>
<?php
if ($field->is_searchable)
{
echo HTMLHelper::_('grid.sort',
Text::_($field->title), 'tbl.' . $field->name,
$this->state->filter_order_Dir, $this->state->filter_order);
}
else
{
echo $field->title;
}
?>
</th>
<?php
}
?>
<th class="<?php echo $centerClass;
?>">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_CREATED_DATE'), 'tbl.created_date',
$this->state->filter_order_Dir, $this->state->filter_order );
?>
</th>
<th class="<?php echo $centerClass;
?>">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_MODIFIED_DATE'), 'tbl.modified_date',
$this->state->filter_order_Dir, $this->state->filter_order );
?>
</th>
<?php
if (isset($this->lists['filter_status_id']))
{
$cols++;
?>
<th width="8%">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_STATUS'), 'tbl.status_id',
$this->state->filter_order_Dir, $this->state->filter_order );
?>
</th>
<?php
}
if
(isset($this->lists['filter_priority_id']))
{
$cols++;
?>
<th width="8%">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_PRIORITY'), 'tbl.priority_id',
$this->state->filter_order_Dir, $this->state->filter_order);
?>
</th>
<?php
}
if (!empty($this->showStaffColumn))
{
$cols++;
?>
<th width="10%">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_ASSIGNED_TO'), 'tbl.staff_id',
$this->state->filter_order_Dir, $this->state->filter_order);
?>
</th>
<?php
}
?>
<th width="2%" class="<?php echo
$centerClass; ?>">
<?php echo HTMLHelper::_('grid.sort',
Text::_('HDP_ID'), 'tbl.id',
$this->state->filter_order_Dir, $this->state->filter_order );
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $cols +
count($this->fields); ?>">
<div class="pagination"><?php echo
$this->pagination->getListFooter(); ?></div>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $this->items ); $i < $n; $i++)
{
$row = $this->items[$i];
$link = Route::_(RouteHelper::getTicketRoute($row->id), false);
?>
<tr class="<?php echo "row$k"; ?>
hdp-ticket-status-<?php echo $row->status_id; ?>">
<td>
<a href="<?php echo $link;
?>"><?php echo $this->escape($row->subject) ;
?></a> <br />
<small><?php echo
Text::_('HDP_CATEGORY'); ?>: <strong><?php echo
$row->category_title ; ?></strong></small>
</td>
<?php
if(count($this->fields))
{
foreach ($this->fields as $field)
{
?>
<td>
<?php echo
isset($this->fieldValues[$row->id][$field->id]) ?
$this->fieldValues[$row->id][$field->id] : '';?>
</td>
<?php
}
}
?>
<td class="<?php echo $centerClass;
?>">
<?php echo HTMLHelper::_('date', $row->created_date,
$this->config->date_format); ?>
</td>
<td class="<?php echo $centerClass;
?>">
<?php echo HTMLHelper::_('date', $row->modified_date,
$this->config->date_format); ?>
</td>
<?php
if
(isset($this->lists['filter_status_id']))
{
?>
<td>
<?php echo
@$this->statusList[$row->status_id]; ?>
</td>
<?php
}
if
(isset($this->lists['filter_priority_id']))
{
?>
<td>
<?php echo
@$this->priorityList[$row->priority_id]; ?>
</td>
<?php
}
if (!empty($this->showStaffColumn))
{
?>
<td>
<?php echo
$this->staffs[$row->staff_id]; ?>
</td>
<?php
}
?>
<td class="<?php echo $centerClass;
?>">
<?php echo $row->id; ?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="boxchecked"
value="0" />
<input type="hidden" name="filter_order"
value="<?php echo $this->state->filter_order; ?>"
/>
<input type="hidden" name="filter_order_Dir"
value="<?php echo $this->state->filter_order_Dir; ?>"
/>
<?php echo HTMLHelper::_( 'form.token' ); ?>
</form>
</div>PK��[����'
'
CategoriesView.phpnu�[���<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
namespace Joomla\CMS\MVC\View;
defined('JPATH_PLATFORM') or die;
/**
* Categories view base class.
*
* @since 3.2
*/
class CategoriesView extends HtmlView
{
/**
* State data
*
* @var \Joomla\Registry\Registry
* @since 3.2
*/
protected $state;
/**
* Category items data
*
* @var array
* @since 3.2
*/
protected $items;
/**
* Language key for default page heading
*
* @var string
* @since 3.2
*/
protected $pageHeading;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 3.2
*/
public function display($tpl = null)
{
$state = $this->get('State');
$items = $this->get('Items');
$parent = $this->get('Parent');
$app = \JFactory::getApplication();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
$app->enqueueMessage($errors, 'error');
return false;
}
if ($items === false)
{
$app->enqueueMessage(\JText::_('JGLOBAL_CATEGORY_NOT_FOUND'),
'error');
return false;
}
if ($parent == false)
{
$app->enqueueMessage(\JText::_('JGLOBAL_CATEGORY_NOT_FOUND'),
'error');
return false;
}
$params = &$state->params;
$items = array($parent->id => $items);
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx'), ENT_COMPAT,
'UTF-8');
$this->maxLevelcat = $params->get('maxLevelcat', -1) <
0 ? PHP_INT_MAX : $params->get('maxLevelcat', PHP_INT_MAX);
$this->params = &$params;
$this->parent = &$parent;
$this->items = &$items;
$this->prepareDocument();
return parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*
* @since 3.2
*/
protected function prepareDocument()
{
$app = \JFactory::getApplication();
$menus = $app->getMenu();
// Because the application sets a default page title, we need to get it
from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
\JText::_($this->pageHeading));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = \JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = \JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
PK��[F��(��CategoryFeedView.phpnu�[���<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
namespace Joomla\CMS\MVC\View;
defined('JPATH_PLATFORM') or die;
/**
* Base feed View class for a category
*
* @since 3.2
*/
class CategoryFeedView extends HtmlView
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 3.2
*/
public function display($tpl = null)
{
$app = \JFactory::getApplication();
$document = \JFactory::getDocument();
$extension = $app->input->getString('option');
$contentType = $extension . '.' . $this->viewName;
$ucmType = new \JUcmType;
$ucmRow = $ucmType->getTypeByAlias($contentType);
$ucmMapCommon = json_decode($ucmRow->field_mappings)->common;
$createdField = null;
$titleField = null;
if (is_object($ucmMapCommon))
{
$createdField = $ucmMapCommon->core_created_time;
$titleField = $ucmMapCommon->core_title;
}
elseif (is_array($ucmMapCommon))
{
$createdField = $ucmMapCommon[0]->core_created_time;
$titleField = $ucmMapCommon[0]->core_title;
}
$document->link =
\JRoute::_(\JHelperRoute::getCategoryRoute($app->input->getInt('id'),
$language = 0, $extension));
$app->input->set('limit',
$app->get('feed_limit'));
$siteEmail = $app->get('mailfrom');
$fromName = $app->get('fromname');
$feedEmail = $app->get('feed_email',
'none');
$document->editor = $fromName;
if ($feedEmail !== 'none')
{
$document->editorEmail = $siteEmail;
}
// Get some data from the model
$items = $this->get('Items');
$category = $this->get('Category');
// Don't display feed if category id missing or non existent
if ($category == false || $category->alias === 'root')
{
return \JError::raiseError(404,
\JText::_('JGLOBAL_CATEGORY_NOT_FOUND'));
}
foreach ($items as $item)
{
$this->reconcileNames($item);
// Strip html from feed item title
if ($titleField)
{
$title = $this->escape($item->$titleField);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
}
else
{
$title = '';
}
// URL link to article
$router = new \JHelperRoute;
$link = \JRoute::_($router->getRoute($item->id, $contentType,
null, null, $item->catid));
// Strip HTML from feed item description text.
$description = $item->description;
$author = $item->created_by_alias ?: $item->author;
$categoryTitle = isset($item->category_title) ?
$item->category_title : $category->title;
if ($createdField)
{
$date = isset($item->$createdField) ? date('r',
strtotime($item->$createdField)) : '';
}
else
{
$date = '';
}
// Load individual item creator class.
$feeditem = new \JFeedItem;
$feeditem->title = $title;
$feeditem->link = $link;
$feeditem->description = $description;
$feeditem->date = $date;
$feeditem->category = $categoryTitle;
$feeditem->author = $author;
// We don't have the author email so we have to use site in both
cases.
if ($feedEmail === 'site')
{
$feeditem->authorEmail = $siteEmail;
}
elseif ($feedEmail === 'author')
{
$feeditem->authorEmail = $item->author_email;
}
// Loads item information into RSS array
$document->addItem($feeditem);
}
}
/**
* Method to reconcile non standard names from components to usage in this
class.
* Typically overridden in the component feed view class.
*
* @param object $item The item for a feed, an element of the $items
array.
*
* @return void
*
* @since 3.2
*/
protected function reconcileNames($item)
{
if (!property_exists($item, 'title') &&
property_exists($item, 'name'))
{
$item->title = $item->name;
}
}
}
PK��[7�M���CategoryView.phpnu�[���<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
namespace Joomla\CMS\MVC\View;
defined('JPATH_PLATFORM') or die;
/**
* Base HTML View class for the a Category list
*
* @since 3.2
*/
class CategoryView extends HtmlView
{
/**
* State data
*
* @var \Joomla\Registry\Registry
* @since 3.2
*/
protected $state;
/**
* Category items data
*
* @var array
* @since 3.2
*/
protected $items;
/**
* The category model object for this category
*
* @var \JModelCategory
* @since 3.2
*/
protected $category;
/**
* The list of other categories for this extension.
*
* @var array
* @since 3.2
*/
protected $categories;
/**
* Pagination object
*
* @var \JPagination
* @since 3.2
*/
protected $pagination;
/**
* Child objects
*
* @var array
* @since 3.2
*/
protected $children;
/**
* The name of the extension for the category
*
* @var string
* @since 3.2
*/
protected $extension;
/**
* The name of the view to link individual items to
*
* @var string
* @since 3.2
*/
protected $viewName;
/**
* Default title to use for page title
*
* @var string
* @since 3.2
*/
protected $defaultPageTitle;
/**
* Whether to run the standard Joomla plugin events.
* Off by default for b/c
*
* @var bool
* @since 3.5
*/
protected $runPlugins = false;
/**
* Method with common display elements used in category list displays
*
* @return boolean|\JException|void Boolean false or \JException
instance on error, nothing otherwise
*
* @since 3.2
*/
public function commonCategoryDisplay()
{
$app = \JFactory::getApplication();
$user = \JFactory::getUser();
$params = $app->getParams();
// Get some data from the models
$model = $this->getModel();
$paramsModel = $model->getState('params');
$paramsModel->set('check_access_rights', 0);
$model->setState('params', $paramsModel);
$state = $this->get('State');
$category = $this->get('Category');
$children = $this->get('Children');
$parent = $this->get('Parent');
if ($category == false)
{
return \JError::raiseError(404,
\JText::_('JGLOBAL_CATEGORY_NOT_FOUND'));
}
if ($parent == false)
{
return \JError::raiseError(404,
\JText::_('JGLOBAL_CATEGORY_NOT_FOUND'));
}
// Check whether category access level allows access.
$groups = $user->getAuthorisedViewLevels();
if (!in_array($category->access, $groups))
{
return \JError::raiseError(403,
\JText::_('JERROR_ALERTNOAUTHOR'));
}
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
\JError::raiseError(500, implode("\n", $errors));
return false;
}
// Setup the category parameters.
$cparams = $category->getParams();
$category->params = clone $params;
$category->params->merge($cparams);
$children = array($category->id => $children);
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx'));
if ($this->runPlugins)
{
\JPluginHelper::importPlugin('content');
foreach ($items as $itemElement)
{
$itemElement = (object) $itemElement;
$itemElement->event = new \stdClass;
// For some plugins.
!empty($itemElement->description) ? $itemElement->text =
$itemElement->description : $itemElement->text = null;
$dispatcher = \JEventDispatcher::getInstance();
$dispatcher->trigger('onContentPrepare',
array($this->extension . '.category', &$itemElement,
&$itemElement->params, 0));
$results = $dispatcher->trigger('onContentAfterTitle',
array($this->extension . '.category', &$itemElement,
&$itemElement->core_params, 0));
$itemElement->event->afterDisplayTitle =
trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay',
array($this->extension . '.category', &$itemElement,
&$itemElement->core_params, 0));
$itemElement->event->beforeDisplayContent =
trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay',
array($this->extension . '.category', &$itemElement,
&$itemElement->core_params, 0));
$itemElement->event->afterDisplayContent =
trim(implode("\n", $results));
if ($itemElement->text)
{
$itemElement->description = $itemElement->text;
}
}
}
$maxLevel = $params->get('maxLevel', -1) < 0 ?
PHP_INT_MAX : $params->get('maxLevel', PHP_INT_MAX);
$this->maxLevel = &$maxLevel;
$this->state = &$state;
$this->items = &$items;
$this->category = &$category;
$this->children = &$children;
$this->params = &$params;
$this->parent = &$parent;
$this->pagination = &$pagination;
$this->user = &$user;
// Check for layout override only if this is not the active menu item
// If it is the active menu item, then the view and category id will
match
$active = $app->getMenu()->getActive();
if ($active
&& $active->component == $this->extension
&& isset($active->query['view'],
$active->query['id'])
&& $active->query['view'] == 'category'
&& $active->query['id'] ==
$this->category->id)
{
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
}
elseif ($layout =
$category->params->get('category_layout'))
{
$this->setLayout($layout);
}
$this->category->tags = new \JHelperTags;
$this->category->tags->getItemTags($this->extension .
'.category', $this->category->id);
}
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 3.2
*/
public function display($tpl = null)
{
$this->prepareDocument();
return parent::display($tpl);
}
/**
* Method to prepares the document
*
* @return void
*
* @since 3.2
*/
protected function prepareDocument()
{
$app = \JFactory::getApplication();
$menus = $app->getMenu();
$this->pathway = $app->getPathway();
$title = null;
// Because the application sets a default page title, we need to get it
from the menu item itself
$this->menu = $menus->getActive();
if ($this->menu)
{
$this->params->def('page_heading',
$this->params->get('page_title',
$this->menu->title));
}
else
{
$this->params->def('page_heading',
\JText::_($this->defaultPageTitle));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = \JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = \JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
/**
* Method to add an alternative feed link to a category layout.
*
* @return void
*
* @since 3.2
*/
protected function addFeed()
{
if ($this->params->get('show_feed_link', 1) == 1)
{
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml',
'title' => 'RSS 2.0');
$this->document->addHeadLink(\JRoute::_($link .
'&type=rss'), 'alternate', 'rel',
$attribs);
$attribs = array('type' =>
'application/atom+xml', 'title' => 'Atom
1.0');
$this->document->addHeadLink(\JRoute::_($link .
'&type=atom'), 'alternate', 'rel',
$attribs);
}
}
}
PK��[M~��JOJOHtmlView.phpnu�[���<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
namespace Joomla\CMS\MVC\View;
defined('JPATH_PLATFORM') or die;
/**
* Base class for a Joomla View
*
* Class holding methods for displaying presentation data.
*
* @since 2.5.5
*/
class HtmlView extends \JObject
{
/**
* The active document object
*
* @var \JDocument
* @since 3.0
*/
public $document;
/**
* The name of the view
*
* @var array
* @since 3.0
*/
protected $_name = null;
/**
* Registered models
*
* @var array
* @since 3.0
*/
protected $_models = array();
/**
* The base path of the view
*
* @var string
* @since 3.0
*/
protected $_basePath = null;
/**
* The default model
*
* @var string
* @since 3.0
*/
protected $_defaultModel = null;
/**
* Layout name
*
* @var string
* @since 3.0
*/
protected $_layout = 'default';
/**
* Layout extension
*
* @var string
* @since 3.0
*/
protected $_layoutExt = 'php';
/**
* Layout template
*
* @var string
* @since 3.0
*/
protected $_layoutTemplate = '_';
/**
* The set of search directories for resources (templates)
*
* @var array
* @since 3.0
*/
protected $_path = array('template' => array(),
'helper' => array());
/**
* The name of the default template source file.
*
* @var string
* @since 3.0
*/
protected $_template = null;
/**
* The output of the template script.
*
* @var string
* @since 3.0
*/
protected $_output = null;
/**
* Callback for escaping.
*
* @var string
* @since 3.0
* @deprecated 3.0
*/
protected $_escape = 'htmlspecialchars';
/**
* Charset to use in escaping mechanisms; defaults to urf8 (UTF-8)
*
* @var string
* @since 3.0
*/
protected $_charset = 'UTF-8';
/**
* Constructor
*
* @param array $config A named configuration array for object
construction.
* name: the name (optional) of the view
(defaults to the view class name suffix).
* charset: the character set to use for display
* escape: the name (optional) of the function to
use for escaping strings
* base_path: the parent path (optional) of the
views directory (defaults to the component folder)
* template_plath: the path (optional) of the
layout directory (defaults to base_path + /views/ + view name
* helper_path: the path (optional) of the helper
files (defaults to base_path + /helpers/)
* layout: the layout (optional) to use to
display the view
*
* @since 3.0
*/
public function __construct($config = array())
{
// Set the view name
if (empty($this->_name))
{
if (array_key_exists('name', $config))
{
$this->_name = $config['name'];
}
else
{
$this->_name = $this->getName();
}
}
// Set the charset (used by the variable escaping functions)
if (array_key_exists('charset', $config))
{
\JLog::add('Setting a custom charset for escaping is deprecated.
Override \JViewLegacy::escape() instead.', \JLog::WARNING,
'deprecated');
$this->_charset = $config['charset'];
}
// User-defined escaping callback
if (array_key_exists('escape', $config))
{
$this->setEscape($config['escape']);
}
// Set a base path for use by the view
if (array_key_exists('base_path', $config))
{
$this->_basePath = $config['base_path'];
}
else
{
$this->_basePath = JPATH_COMPONENT;
}
// Set the default template search path
if (array_key_exists('template_path', $config))
{
// User-defined dirs
$this->_setPath('template',
$config['template_path']);
}
elseif (is_dir($this->_basePath . '/view'))
{
$this->_setPath('template', $this->_basePath .
'/view/' . $this->getName() . '/tmpl');
}
else
{
$this->_setPath('template', $this->_basePath .
'/views/' . $this->getName() . '/tmpl');
}
// Set the default helper search path
if (array_key_exists('helper_path', $config))
{
// User-defined dirs
$this->_setPath('helper',
$config['helper_path']);
}
else
{
$this->_setPath('helper', $this->_basePath .
'/helpers');
}
// Set the layout
if (array_key_exists('layout', $config))
{
$this->setLayout($config['layout']);
}
else
{
$this->setLayout('default');
}
$this->baseurl = \JUri::base(true);
}
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see \JViewLegacy::loadTemplate()
* @since 3.0
*/
public function display($tpl = null)
{
$result = $this->loadTemplate($tpl);
if ($result instanceof \Exception)
{
return $result;
}
echo $result;
}
/**
* Assigns variables to the view script via differing strategies.
*
* This method is overloaded; you can assign all the properties of
* an object, an associative array, or a single value by name.
*
* You are not allowed to set variables that begin with an underscore;
* these are either private properties for \JView or private variables
* within the template script itself.
*
* <code>
* $view = new \Joomla\CMS\View\HtmlView;
*
* // Assign directly
* $view->var1 = 'something';
* $view->var2 = 'else';
*
* // Assign by name and value
* $view->assign('var1', 'something');
* $view->assign('var2', 'else');
*
* // Assign by assoc-array
* $ary = array('var1' => 'something',
'var2' => 'else');
* $view->assign($obj);
*
* // Assign by object
* $obj = new \stdClass;
* $obj->var1 = 'something';
* $obj->var2 = 'else';
* $view->assign($obj);
*
* </code>
*
* @return boolean True on success, false on failure.
*
* @since 3.0
* @deprecated 3.0 Use native PHP syntax.
*/
public function assign()
{
\JLog::add(__METHOD__ . ' is deprecated. Use native PHP
syntax.', \JLog::WARNING, 'deprecated');
// Get the arguments; there may be 1 or 2.
$arg0 = @func_get_arg(0);
$arg1 = @func_get_arg(1);
// Assign by object
if (is_object($arg0))
{
// Assign public properties
foreach (get_object_vars($arg0) as $key => $val)
{
if (strpos($key, '_') !== 0)
{
$this->$key = $val;
}
}
return true;
}
// Assign by associative array
if (is_array($arg0))
{
foreach ($arg0 as $key => $val)
{
if (strpos($key, '_') !== 0)
{
$this->$key = $val;
}
}
return true;
}
// Assign by string name and mixed value.
// We use array_key_exists() instead of isset() because isset()
// fails if the value is set to null.
if (is_string($arg0) && strpos($arg0, '_') !== 0
&& func_num_args() > 1)
{
$this->$arg0 = $arg1;
return true;
}
// $arg0 was not object, array, or string.
return false;
}
/**
* Assign variable for the view (by reference).
*
* You are not allowed to set variables that begin with an underscore;
* these are either private properties for \JView or private variables
* within the template script itself.
*
* <code>
* $view = new \JView;
*
* // Assign by name and value
* $view->assignRef('var1', $ref);
*
* // Assign directly
* $view->var1 = &$ref;
* </code>
*
* @param string $key The name for the reference in the view.
* @param mixed &$val The referenced variable.
*
* @return boolean True on success, false on failure.
*
* @since 3.0
* @deprecated 3.0 Use native PHP syntax.
*/
public function assignRef($key, &$val)
{
\JLog::add(__METHOD__ . ' is deprecated. Use native PHP
syntax.', \JLog::WARNING, 'deprecated');
if (is_string($key) && strpos($key, '_') !== 0)
{
$this->$key = &$val;
return true;
}
return false;
}
/**
* Escapes a value for output in a view script.
*
* If escaping mechanism is either htmlspecialchars or htmlentities, uses
* {@link $_encoding} setting.
*
* @param mixed $var The output to escape.
*
* @return mixed The escaped value.
*
* @note the ENT_COMPAT flag will be replaced by ENT_QUOTES in Joomla 4.0
to also escape single quotes
*
* @since 3.0
*/
public function escape($var)
{
if (in_array($this->_escape, array('htmlspecialchars',
'htmlentities')))
{
return call_user_func($this->_escape, $var, ENT_COMPAT,
$this->_charset);
}
return call_user_func($this->_escape, $var);
}
/**
* Method to get data from a registered model or a property of the view
*
* @param string $property The name of the method to call on the model
or the property to get
* @param string $default The name of the model to reference or the
default value [optional]
*
* @return mixed The return value of the method
*
* @since 3.0
*/
public function get($property, $default = null)
{
// If $model is null we use the default model
if ($default === null)
{
$model = $this->_defaultModel;
}
else
{
$model = strtolower($default);
}
// First check to make sure the model requested exists
if (isset($this->_models[$model]))
{
// Model exists, let's build the method name
$method = 'get' . ucfirst($property);
// Does the method exist?
if (method_exists($this->_models[$model], $method))
{
// The method exists, let's call it and return what we get
$result = $this->_models[$model]->$method();
return $result;
}
}
// Degrade to \JObject::get
$result = parent::get($property, $default);
return $result;
}
/**
* Method to get the model object
*
* @param string $name The name of the model (optional)
*
* @return mixed \JModelLegacy object
*
* @since 3.0
*/
public function getModel($name = null)
{
if ($name === null)
{
$name = $this->_defaultModel;
}
return $this->_models[strtolower($name)];
}
/**
* Get the layout.
*
* @return string The layout name
*
* @since 3.0
*/
public function getLayout()
{
return $this->_layout;
}
/**
* Get the layout template.
*
* @return string The layout template name
*
* @since 3.0
*/
public function getLayoutTemplate()
{
return $this->_layoutTemplate;
}
/**
* Method to get the view name
*
* The model name by default parsed using the classname, or it can be set
* by passing a $config['name'] in the class constructor
*
* @return string The name of the model
*
* @since 3.0
* @throws \Exception
*/
public function getName()
{
if (empty($this->_name))
{
$classname = get_class($this);
$viewpos = strpos($classname, 'View');
if ($viewpos === false)
{
throw new
\Exception(\JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'),
500);
}
$this->_name = strtolower(substr($classname, $viewpos + 4));
}
return $this->_name;
}
/**
* Method to add a model to the view. We support a multiple model single
* view system by which models are referenced by classname. A caveat to
the
* classname referencing is that any classname prepended by \JModel will
be
* referenced by the name without \JModel, eg. \JModelCategory is just
* Category.
*
* @param \JModelLegacy $model The model to add to the view.
* @param boolean $default Is this the default model?
*
* @return \JModelLegacy The added model.
*
* @since 3.0
*/
public function setModel($model, $default = false)
{
$name = strtolower($model->getName());
$this->_models[$name] = $model;
if ($default)
{
$this->_defaultModel = $name;
}
return $model;
}
/**
* Sets the layout name to use
*
* @param string $layout The layout name or a string in format
<template>:<layout file>
*
* @return string Previous value.
*
* @since 3.0
*/
public function setLayout($layout)
{
$previous = $this->_layout;
if (strpos($layout, ':') === false)
{
$this->_layout = $layout;
}
else
{
// Convert parameter to array based on :
$temp = explode(':', $layout);
$this->_layout = $temp[1];
// Set layout template
$this->_layoutTemplate = $temp[0];
}
return $previous;
}
/**
* Allows a different extension for the layout files to be used
*
* @param string $value The extension.
*
* @return string Previous value
*
* @since 3.0
*/
public function setLayoutExt($value)
{
$previous = $this->_layoutExt;
if ($value = preg_replace('#[^A-Za-z0-9]#', '',
trim($value)))
{
$this->_layoutExt = $value;
}
return $previous;
}
/**
* Sets the _escape() callback.
*
* @param mixed $spec The callback for _escape() to use.
*
* @return void
*
* @since 3.0
* @deprecated 3.0 Override \JViewLegacy::escape() instead.
*/
public function setEscape($spec)
{
\JLog::add(__METHOD__ . ' is deprecated. Override
\JViewLegacy::escape() instead.', \JLog::WARNING,
'deprecated');
$this->_escape = $spec;
}
/**
* Adds to the stack of view script paths in LIFO order.
*
* @param mixed $path A directory path or an array of paths.
*
* @return void
*
* @since 3.0
*/
public function addTemplatePath($path)
{
$this->_addPath('template', $path);
}
/**
* Adds to the stack of helper script paths in LIFO order.
*
* @param mixed $path A directory path or an array of paths.
*
* @return void
*
* @since 3.0
*/
public function addHelperPath($path)
{
$this->_addPath('helper', $path);
}
/**
* Load a template file -- first look in the templates folder for an
override
*
* @param string $tpl The name of the template source file;
automatically searches the template paths and compiles as needed.
*
* @return string The output of the the template script.
*
* @since 3.0
* @throws \Exception
*/
public function loadTemplate($tpl = null)
{
// Clear prior output
$this->_output = null;
$template = \JFactory::getApplication()->getTemplate();
$layout = $this->getLayout();
$layoutTemplate = $this->getLayoutTemplate();
// Create the template file name based on the layout
$file = isset($tpl) ? $layout . '_' . $tpl : $layout;
// Clean the file name
$file = preg_replace('/[^A-Z0-9_\.-]/i', '', $file);
$tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\.-]/i',
'', $tpl) : $tpl;
// Load the language file for the template
$lang = \JFactory::getLanguage();
$lang->load('tpl_' . $template, JPATH_BASE, null, false,
true)
|| $lang->load('tpl_' . $template, JPATH_THEMES .
"/$template", null, false, true);
// Change the template folder if alternative layout is in different
template
if (isset($layoutTemplate) && $layoutTemplate !== '_'
&& $layoutTemplate != $template)
{
$this->_path['template'] = str_replace(
JPATH_THEMES . DIRECTORY_SEPARATOR . $template,
JPATH_THEMES . DIRECTORY_SEPARATOR . $layoutTemplate,
$this->_path['template']
);
}
// Load the template script
jimport('joomla.filesystem.path');
$filetofind = $this->_createFileName('template',
array('name' => $file));
$this->_template = \JPath::find($this->_path['template'],
$filetofind);
// If alternate layout can't be found, fall back to default layout
if ($this->_template == false)
{
$filetofind = $this->_createFileName('',
array('name' => 'default' . (isset($tpl) ?
'_' . $tpl : $tpl)));
$this->_template =
\JPath::find($this->_path['template'], $filetofind);
}
if ($this->_template != false)
{
// Unset so as not to introduce into template scope
unset($tpl, $file);
// Never allow a 'this' property
if (isset($this->this))
{
unset($this->this);
}
// Start capturing output into a buffer
ob_start();
// Include the requested template filename in the local scope
// (this will execute the view logic).
include $this->_template;
// Done with the requested template; get the buffer and
// clear it.
$this->_output = ob_get_contents();
ob_end_clean();
return $this->_output;
}
else
{
throw new
\Exception(\JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND',
$file), 500);
}
}
/**
* Load a helper file
*
* @param string $hlp The name of the helper source file automatically
searches the helper paths and compiles as needed.
*
* @return void
*
* @since 3.0
*/
public function loadHelper($hlp = null)
{
// Clean the file name
$file = preg_replace('/[^A-Z0-9_\.-]/i', '', $hlp);
// Load the template script
jimport('joomla.filesystem.path');
$helper = \JPath::find($this->_path['helper'],
$this->_createFileName('helper', array('name' =>
$file)));
if ($helper != false)
{
// Include the requested template filename in the local scope
include_once $helper;
}
}
/**
* Sets an entire array of search paths for templates or resources.
*
* @param string $type The type of path to set, typically
'template'.
* @param mixed $path The new search path, or an array of search
paths. If null or false, resets to the current directory only.
*
* @return void
*
* @since 3.0
*/
protected function _setPath($type, $path)
{
$component = \JApplicationHelper::getComponentName();
$app = \JFactory::getApplication();
// Clear out the prior search dirs
$this->_path[$type] = array();
// Actually add the user-specified directories
$this->_addPath($type, $path);
// Always add the fallback directories as last resort
switch (strtolower($type))
{
case 'template':
// Set the alternative template search dir
if (isset($app))
{
$component = preg_replace('/[^A-Z0-9_\.-]/i', '',
$component);
$fallback = JPATH_THEMES . '/' . $app->getTemplate() .
'/html/' . $component . '/' . $this->getName();
$this->_addPath('template', $fallback);
}
break;
}
}
/**
* Adds to the search path for templates and resources.
*
* @param string $type The type of path to add.
* @param mixed $path The directory or stream, or an array of either,
to search.
*
* @return void
*
* @since 3.0
*/
protected function _addPath($type, $path)
{
jimport('joomla.filesystem.path');
// Loop through the path directories
foreach ((array) $path as $dir)
{
// Clean up the path
$dir = \JPath::clean($dir);
// Add trailing separators as needed
if (substr($dir, -1) != DIRECTORY_SEPARATOR)
{
// Directory
$dir .= DIRECTORY_SEPARATOR;
}
// Add to the top of the search dirs
array_unshift($this->_path[$type], $dir);
}
}
/**
* Create the filename for a resource
*
* @param string $type The resource type to create the filename for
* @param array $parts An associative array of filename information
*
* @return string The filename
*
* @since 3.0
*/
protected function _createFileName($type, $parts = array())
{
switch ($type)
{
case 'template':
$filename = strtolower($parts['name']) . '.' .
$this->_layoutExt;
break;
default:
$filename = strtolower($parts['name']) . '.php';
break;
}
return $filename;
}
/**
* Returns the form object
*
* @return mixed A \JForm object on success, false on failure
*
* @since 3.2
*/
public function getForm()
{
if (!is_object($this->form))
{
$this->form = $this->get('Form');
}
return $this->form;
}
/**
* Sets the document title according to Global Configuration options
*
* @param string $title The page title
*
* @return void
*
* @since 3.6
*/
public function setDocumentTitle($title)
{
$app = \JFactory::getApplication();
// Check for empty title and add site name if param is set
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = \JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = \JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
}
}
PK��[6c>Z��Article/Html.phpnu�[���PK��[�he::3 Article/tmpl/default.phpnu�[���PK��[������Articles/Html.phpnu�[���PK��[�
�q���Articles/tmpl/default.phpnu�[���PK��[�q{���Categories/Html.phpnu�[���PK��[A�V���!Categories/tmpl/default.phpnu�[���PK��[VJ�
�
"�*common/tmpl/ticket_add_comment.phpnu�[���PK��[�&�b���5common/tmpl/ticket_comments.phpnu�[���PK��[*ځv�
�
$Pcommon/tmpl/ticket_customer_info.phpnu�[���PK��[v��`��^common/tmpl/ticket_detail.phpnu�[���PK��[2F��)gcommon/tmpl/ticket_upload_attachments.phpnu�[���PK��[�#�}ncommon/tmpl/toolbar.phpnu�[���PK��[�s�XX�~fieldlayout/checkboxes.phpnu�[���PK��[O�o����fieldlayout/controlgroup.phpnu�[���PK��[��l�����fieldlayout/heading.phpnu�[���PK��[�W�B��l�fieldlayout/label.phpnu�[���PK��[�K��?�fieldlayout/message.phpnu�[���PK��[k5�_bbn�fieldlayout/radio.phpnu�[���PK��[
�����fieldlayout/text.phpnu�[���PK��[�6U,���fieldlayout/textarea.phpnu�[���PK��[�S;�c)c)ٞTicket/Html.phpnu�[���PK��[���}}{�Ticket/tmpl/default.phpnu�[���PK��[�$����?�Ticket/tmpl/form.phpnu�[���PK��[%τJW�Tickets/Html.phpnu�[���PK��[}��#�#�Tickets/tmpl/default.phpnu�[���PK��[����'
'
�:CategoriesView.phpnu�[���PK��[F��(���GCategoryFeedView.phpnu�[���PK��[7�M���XCategoryView.phpnu�[���PK��[M~��JOJOQxHtmlView.phpnu�[���PK� ��