コード例 #1
0
ファイル: view.html.php プロジェクト: atikahmed/joomla-probid
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $this->assignRef('user', JFactory::getUser());
     $login_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
     $Itemid = JRequest::getInt('Itemid');
     $return = base64_encode(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=dashboard' . ($Itemid ? '&Itemid=' . $Itemid : ''), false));
     $login_link = JRoute::_('index.php?option=' . $login_option . '&view=login' . ($Itemid ? '&Itemid=' . $Itemid : '') . '&return=' . $return);
     $this->assignRef('login_link', $login_link);
     $this->assignRef('categories', $this->get('categories'));
     $this->assignRef('tickets', $this->get('tickets'));
     $params = $mainframe->getParams('com_rsticketspro');
     $this->assignRef('params', $params);
     JHTML::_('behavior.mootools');
     $doc =& JFactory::getDocument();
     if (RSTicketsProHelper::isJ16() || JPluginHelper::isEnabled('system', 'mtupgrade')) {
         $doc->addScript(JURI::root(true) . '/components/com_rsticketspro/assets/js/more.js');
     }
     if (RSTicketsProHelper::isJ16()) {
         // Description
         if ($params->get('menu-meta_description')) {
             $this->document->setDescription($params->get('menu-meta_description'));
         }
         // Keywords
         if ($params->get('menu-meta_keywords')) {
             $this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
         }
         // Robots
         if ($params->get('robots')) {
             $this->document->setMetadata('robots', $params->get('robots'));
         }
     }
     parent::display($tpl);
 }
コード例 #2
0
ファイル: history.php プロジェクト: atikahmed/joomla-probid
 function __construct()
 {
     parent::__construct();
     $mainframe =& JFactory::getApplication();
     $option = 'com_rsticketspro';
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         $link = JRequest::getURI();
         $link = base64_encode($link);
         $user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
     }
     $ticket_viewing_history = RSTicketsProHelper::getConfig('ticket_viewing_history');
     if (!$ticket_viewing_history) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_VIEW_HISTORY'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     if ($ticket_viewing_history == 1 && !RSTicketsProHelper::isStaff()) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_VIEW_HISTORY'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $this->_db = JFactory::getDBO();
     // Get pagination request variables
     $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState($option . '.history.limit', $limit);
     $this->setState($option . '.history.limitstart', $limitstart);
     $this->_query = $this->_buildQuery();
     $document =& JFactory::getDocument();
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/system.css');
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/general.css');
 }
コード例 #3
0
ファイル: users.php プロジェクト: atikahmed/joomla-probid
 function __construct()
 {
     parent::__construct();
     $mainframe =& JFactory::getApplication();
     $option = 'com_rsticketspro';
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         $link = JRequest::getURI();
         $link = base64_encode($link);
         $user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
     }
     if (!RSTicketsProHelper::isStaff()) {
         JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_VIEW_USERS'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $this->_permissions = RSTicketsProHelper::getCurrentPermissions();
     if (!$this->_permissions->add_ticket_customers && !$this->_permissions->add_ticket_staff) {
         JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_VIEW_USERS'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $this->_db = JFactory::getDBO();
     // Get pagination request variables
     $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     // In case limit has been changed, adjust it
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->setState($option . '.users.limit', $limit);
     $this->setState($option . '.users.limitstart', $limitstart);
     $this->_query = $this->_buildQuery();
 }
コード例 #4
0
ファイル: notes.php プロジェクト: atikahmed/joomla-probid
 function update()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     $model = $this->getModel('notes');
     $model->update();
     $ticket_id = JRequest::getInt('ticket_id');
     $this->setRedirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=notes&ticket_id=' . $ticket_id . '&tmpl=component', false), JText::_('RST_UPDATE_TICKET_NOTE_OK'));
 }
コード例 #5
0
ファイル: signature.php プロジェクト: atikahmed/joomla-probid
 function save()
 {
     $mainframe =& JFactory::getApplication();
     $signature = JRequest::getVar('signature', '', 'post', 'none', JREQUEST_ALLOWHTML);
     $user = JFactory::getUser();
     $this->_db->setQuery("UPDATE #__rsticketspro_staff SET signature='" . $this->_db->getEscaped($signature) . "' WHERE user_id='" . (int) $user->get('id') . "' LIMIT 1");
     $this->_db->query();
     $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=signature', false), JText::_('RST_SIGNATURE_OK'));
 }
コード例 #6
0
ファイル: searches.php プロジェクト: atikahmed/joomla-probid
 function _getSearch()
 {
     $this->_row =& JTable::getInstance('RSTicketsPro_Searches', 'Table');
     $cid = JRequest::getInt('cid', 0);
     if ($cid) {
         $this->_row->load($cid);
         $user = JFactory::getUser();
         if ($user->get('id') != $this->_row->user_id) {
             $mainframe =& JFactory::getApplication();
             JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_VIEW_SEARCHES'));
             $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=searches', false));
         }
     }
 }
コード例 #7
0
 function getPath()
 {
     $return = array();
     $parent_id = $this->category_id;
     $row =& JTable::getInstance('RSTicketsPro_KB_Categories', 'Table');
     while ($parent_id > 0) {
         $row->load($parent_id);
         $parent_id = $row->parent_id;
         $obj = new stdClass();
         $obj->name = $row->name;
         $obj->link = RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=knowledgebase&cid=' . $row->id . ':' . JFilterOutput::stringURLSafe($row->name));
         $return[] = $obj;
     }
     krsort($return);
     return $return;
 }
コード例 #8
0
ファイル: ticket.php プロジェクト: atikahmed/joomla-probid
 function reopen()
 {
     $mainframe =& JFactory::getApplication();
     $model = $this->getModel('ticket');
     $url = RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=ticket&cid=' . $model->_ticket->id . ':' . JFilterOutput::stringURLSafe($model->_ticket->subject), false);
     $can_open = $model->is_staff ? $model->_permissions->change_ticket_status : RSTicketsProHelper::getConfig('allow_ticket_reopening');
     $user = JFactory::getUser();
     if ($model->_ticket->customer_id == $user->get('id')) {
         $can_open = RSTicketsProHelper::getConfig('allow_ticket_reopening');
     }
     if (!$can_open) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_REOPEN_TICKET'));
         $mainframe->redirect($url);
     }
     $model->reopenTicket();
     $mainframe->redirect($url, JText::_('RST_TICKET_REOPENED_OK'));
 }
コード例 #9
0
ファイル: search.php プロジェクト: atikahmed/joomla-probid
 function __construct()
 {
     parent::__construct();
     $mainframe =& JFactory::getApplication();
     $option = 'com_rsticketspro';
     if ($mainframe->isAdmin()) {
         $data = "staff_itemid=\n";
         $data .= "customer_itemid=\n";
         jimport('joomla.html.parameter');
         $this->params = new JParameter($data);
     } else {
         $this->params = $mainframe->getParams('com_rsticketspro');
     }
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         $link = JRequest::getURI();
         $link = base64_encode($link);
         $user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
     }
 }
コード例 #10
0
 function __construct()
 {
     parent::__construct();
     $mainframe =& JFactory::getApplication();
     $user = JFactory::getUser();
     if ($user->get('guest')) {
         $link = JRequest::getURI();
         $link = base64_encode($link);
         $user_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=' . $user_option . '&view=login&return=' . $link, false));
     }
     $this->is_staff = RSTicketsProHelper::isStaff();
     if (!$this->is_staff) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_UPDATE_TICKET_MESSAGE'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $permissions = RSTicketsProHelper::getCurrentPermissions();
     $message = $this->getRow();
     // can update his own replies
     if (!$permissions->update_ticket_replies && $message->user_id == $user->get('id')) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_UPDATE_TICKET_MESSAGE'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     // can update customer replies
     $is_customer = !RSTicketsProHelper::isStaff($message->user_id);
     if (!$permissions->update_ticket_replies_customers && $is_customer) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_UPDATE_TICKET_MESSAGE'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     // can update staff replies
     $is_other_staff = !$is_customer && $message->user_id != $user->get('id');
     if (!$permissions->update_ticket_replies_staff && $is_other_staff) {
         JError::raiseWarning(500, JText::_('RST_CANNOT_UPDATE_TICKET_MESSAGE'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $this->_db = JFactory::getDBO();
     $document =& JFactory::getDocument();
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/system.css');
     $document->addStyleSheet(JURI::root(true) . '/templates/system/css/general.css');
 }
コード例 #11
0
ファイル: view.html.php プロジェクト: atikahmed/joomla-probid
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     if ($mainframe->isSite()) {
         $params = $mainframe->getParams('com_rsticketspro');
         $this->assignRef('params', $params);
     }
     if ($mainframe->isSite()) {
         $pathway =& $mainframe->getPathway();
         $pathway->addItem(JText::_('RST_MANAGE_SEARCHES'), RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=searches'));
     }
     $task = JRequest::getVar('task');
     if ($task == 'edit' || $task == 'save') {
         $row = $this->get('search');
         $this->assignRef('row', $row);
         if ($mainframe->isSite()) {
             $pathway->addItem($row->name, '');
         }
         $lists['default'] = JHTML::_('select.booleanlist', 'default', '', $row->default);
         $this->assignRef('lists', $lists);
     } else {
         $this->assignRef('searches', $this->get('searches'));
         $this->assignRef('pagination', $this->get('pagination'));
     }
     if (RSTicketsProHelper::isJ16() && $mainframe->isSite()) {
         // Description
         if ($params->get('menu-meta_description')) {
             $this->document->setDescription($params->get('menu-meta_description'));
         }
         // Keywords
         if ($params->get('menu-meta_keywords')) {
             $this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
         }
         // Robots
         if ($params->get('robots')) {
             $this->document->setMetadata('robots', $params->get('robots'));
         }
     }
     parent::display();
 }
コード例 #12
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
} else {
    ?>
		<?php 
    if ($this->is_staff && ($this->permissions->add_ticket_customers || $this->permissions->add_ticket_staff)) {
        ?>
		<tr>
			<td><label for="submit_email"><span class="hasTip" title="<?php 
        echo JText::_('RST_CUSTOMER_EMAIL_DESC');
        ?>
"><?php 
        echo JText::_('RST_CUSTOMER_EMAIL');
        ?>
</span></label></td>
			<td>
			<a class="modal" href="<?php 
        echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=users&tmpl=component');
        ?>
" rel="{handler: 'iframe', size: {x: 600, y: 475}}"><?php 
        echo JText::_('RST_SELECT_USERNAME');
        ?>
</a>
			<div id="submit_email_text"><?php 
        echo $this->escape(@$this->data['email']);
        ?>
</div>
			<input type="hidden" name="customer_id" id="customer_id" value="<?php 
        echo $this->escape(@$this->data['customer_id']);
        ?>
" />
			</td>
		</tr>
コード例 #13
0
 function savemessage()
 {
     $mainframe =& JFactory::getApplication();
     $model = $this->getModel('ticketmessage');
     $model->save();
     $cid = JRequest::getInt('cid');
     $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=ticketmessage&cid=' . $cid . '&tmpl=component', false), JText::_('RST_UPDATE_TICKET_MESSAGE_OK'));
 }
コード例 #14
0
 function getPermissions()
 {
     $mainframe =& JFactory::getApplication();
     if ($mainframe->isAdmin() && empty($this->_permissions)) {
         JError::raiseWarning(500, JText::_('RST_PERMISSIONS_ERROR'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro', false));
         return;
     }
     return @$this->_permissions;
 }
コード例 #15
0
ファイル: submit.php プロジェクト: atikahmed/joomla-probid
 function _processData()
 {
     // don't process anything if the form hasn't been submitted
     if (empty($this->_data['task']) || $this->_data['task'] != 'submit') {
         return;
     }
     $mainframe =& JFactory::getApplication();
     // get the customer (ticket submitter) information
     $user = JFactory::getUser();
     if ($mainframe->isSite() && $user->get('guest') || $mainframe->isAdmin() && $this->_data['submit_type'] == 1) {
         jimport('joomla.mail.helper');
         if (empty($this->_data['email']) || !JMailHelper::isEmailAddress($this->_data['email'])) {
             JError::raiseNotice(500, JText::_('RST_TICKET_EMAIL_ERROR'));
             return;
         }
         $this->_db->setQuery("SELECT id FROM #__users WHERE email LIKE '" . $this->_db->getEscaped($this->_data['email']) . "'");
         $user_id = $this->_db->loadResult();
         if ($user_id && RSTicketsProHelper::isStaff($user_id)) {
             JError::raiseNotice(500, JText::sprintf('RST_TICKET_EMAIL_STAFF_ERROR', $this->_data['email']));
             return;
         }
         $this->_data['customer_id'] = 0;
         if (empty($this->_data['name'])) {
             JError::raiseNotice(500, JText::_('RST_TICKET_NAME_ERROR'));
             return;
         }
     } else {
         $this->_data['email'] = $user->get('email');
         $this->_data['name'] = $user->get('name');
         $this->_data['customer_id'] = $user->get('id');
         if (RSTicketsProHelper::isStaff()) {
             $permissions = RSTicketsProHelper::getCurrentPermissions();
             if (!$permissions->add_ticket && !$permissions->add_ticket_customers && !$permissions->add_ticket_staff) {
                 JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_SUBMIT_TICKET'));
                 $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
             } elseif ($permissions->add_ticket_customers || $permissions->add_ticket_staff) {
                 $this->_data['email'] = '';
                 $this->_data['name'] = '';
                 $this->_data['customer_id'] = 0;
                 $customer_id = JRequest::getInt('customer_id', 0, 'post');
                 if ($mainframe->isSite() && !$customer_id || $mainframe->isAdmin() && $this->_data['submit_type'] == 2 && !$customer_id) {
                     JError::raiseNotice(500, JText::_('RST_TICKET_CUSTOMER_ERROR'));
                     return;
                 }
                 $customer = JFactory::getUser($customer_id);
                 $this->_data['email'] = $customer->get('email');
                 $this->_data['name'] = $customer->get('name');
                 $this->_data['customer_id'] = $customer->get('id');
             }
         }
     }
     // must select a department
     if (empty($this->_data['department_id'])) {
         JError::raiseNotice(500, JText::_('RST_TICKET_DEPARTMENT_ERROR'));
         return;
     }
     // get all custom fields
     $custom_fields = $this->_getList("SELECT * FROM #__rsticketspro_custom_fields WHERE department_id='" . (int) $this->_data['department_id'] . "' AND published=1 ORDER BY ordering");
     // get the submitted custom fields
     $sent_custom_fields = JRequest::getVar('rst_custom_fields', array(), 'post');
     $sent_custom_fields = @$sent_custom_fields['department_' . $this->_data['department_id']];
     // add the custom fields to an array so that we can send them as a parameter later on
     $correct_custom_fields = array();
     foreach ($custom_fields as $field) {
         if ($field->type == 'freetext') {
             continue;
         }
         if ($field->required) {
             $validation_message = JText::_($field->validation);
             if (empty($validation_message)) {
                 $validation_message = JText::sprintf('RST_VALIDATION_DEFAULT_ERROR', JText::_($field->label));
             }
             if (empty($sent_custom_fields[$field->name])) {
                 JError::raiseNotice(500, $validation_message);
                 return false;
             } elseif (is_array($sent_custom_fields[$field->name]) && empty($sent_custom_fields[$field->name][0])) {
                 JError::raiseNotice(500, $validation_message);
                 return false;
             }
         }
         if (!empty($sent_custom_fields[$field->name])) {
             $correct_custom_fields[$field->id] = $sent_custom_fields[$field->name];
         }
     }
     // must write a subject
     if (empty($this->_data['subject'])) {
         JError::raiseNotice(500, JText::_('RST_TICKET_SUBJECT_ERROR'));
         return;
     }
     // must write a message
     if (empty($this->_data['message'])) {
         JError::raiseNotice(500, JText::_('RST_TICKET_MESSAGE_ERROR'));
         return;
     }
     // must select a priority
     if (empty($this->_data['priority_id'])) {
         JError::raiseNotice(500, JText::_('RST_TICKET_PRIORITY_ERROR'));
         return;
     }
     if ($mainframe->isSite()) {
         $captcha_enabled = RSTicketsProHelper::getConfig('captcha_enabled');
         $use_captcha = $this->getUseCaptcha();
         if ($use_captcha && $captcha_enabled) {
             if ($captcha_enabled == 1) {
                 $captcha_image = new JSecurImage();
                 $valid = $captcha_image->check($this->_data['captcha']);
                 if (!$valid) {
                     JError::raiseNotice(500, JText::_('RST_TICKET_CAPTCHA_ERROR'));
                     return;
                 }
             } elseif ($captcha_enabled == 2) {
                 $privatekey = RSTicketsProHelper::getConfig('recaptcha_private_key');
                 $response = JReCAPTCHA::checkAnswer($privatekey, @$_SERVER['REMOTE_ADDR'], @$this->_data['recaptcha_challenge_field'], @$this->_data['recaptcha_response_field']);
                 if ($response === false || !$response->is_valid) {
                     $this->recaptcha_error = @$response->error;
                     JError::raiseNotice(500, JText::_('RST_TICKET_CAPTCHA_ERROR'));
                     return;
                 }
             }
         }
     }
     $this->_data['agent'] = @$_SERVER['HTTP_USER_AGENT'];
     $this->_data['referer'] = @$_SERVER['HTTP_REFERER'];
     $this->_data['ip'] = @$_SERVER['REMOTE_ADDR'];
     $correct_files = array();
     if ($this->getCanUpload()) {
         $department =& JTable::getInstance('RSTicketsPro_Departments', 'Table');
         $department->load($this->_data['department_id']);
         $upload_extensions = str_replace("\r\n", "\n", $department->upload_extensions);
         $upload_extensions = explode("\n", $upload_extensions);
         $files = JRequest::get('files');
         $files = @$files['rst_files'];
         if (is_array($files)) {
             foreach ($files['tmp_name'] as $i => $file_tmp) {
                 if ($files['error'][$i] == 4) {
                     continue;
                 }
                 switch ($files['error'][$i]) {
                     default:
                         $msg = 'RST_TICKET_UPLOAD_ERROR';
                         break;
                     case 1:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_INI_SIZE';
                         break;
                     case 2:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_FORM_SIZE';
                         break;
                     case 3:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_PARTIAL';
                         break;
                     case 6:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_NO_TMP_DIR';
                         break;
                     case 7:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_CANT_WRITE';
                         break;
                     case 8:
                         $msg = 'RST_TICKET_UPLOAD_ERROR_PHP_EXTENSION';
                         break;
                 }
                 $file_name = $files['name'][$i];
                 if ($files['error'][$i]) {
                     JError::raiseWarning(500, JText::sprintf($msg, $file_name));
                     return;
                 }
                 if (!RSTicketsProHelper::isAllowedExtension(RSTicketsProHelper::getExtension($file_name), $upload_extensions)) {
                     $upload_extensions = implode(', ', $upload_extensions);
                     JError::raiseNotice(500, JText::sprintf('RST_TICKET_UPLOAD_EXTENSION_ERROR', $file_name, $upload_extensions));
                     return;
                 }
                 if ($department->upload_size > 0 && $files['size'][$i] > $department->upload_size * 1048576) {
                     JError::raiseWarning(500, JText::sprintf('RST_TICKET_UPLOAD_SIZE_ERROR', $file_name, $department->upload_size));
                     return;
                 }
                 $correct_files[] = array('src' => 'upload', 'tmp_name' => $file_tmp, 'name' => $file_name);
             }
         }
     }
     RSTicketsProHelper::addTicket($this->_data, $correct_custom_fields, $correct_files);
     $redirect = RSTicketsProHelper::getConfig('submit_redirect');
     if ($redirect && $mainframe->isSite()) {
         $mainframe->redirect($redirect);
     } else {
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=submit', false), JText::_('RST_TICKET_SUBMIT_OK'));
     }
 }
コード例 #16
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
?>
</h1>

<?php 
echo RSTicketsProHelper::getConfig('global_message');
?>

<form id="rsticketspro_form" action="<?php 
echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro' . $this->itemid);
?>
" method="post" name="searchForm">
	<?php 
if (!$this->is_advanced) {
    ?>
		<p><a href="<?php 
    echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=search&advanced=true');
    ?>
"><?php 
    echo JText::_('RST_OPEN_ADVANCED_SEARCH');
    ?>
</a></p>
	<?php 
}
?>
		<p>
			<label class="float_left" for="filter_word"><span class="hasTip" title="<?php 
echo JText::_('RST_SEARCH_TEXT_DESC');
?>
"><?php 
echo JText::_('RST_SEARCH_TEXT');
?>
コード例 #17
0
ファイル: searches.php プロジェクト: atikahmed/joomla-probid
 /**
  * Logic to save
  */
 function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     // Get the model
     $model = $this->getModel('searches');
     // Save
     $result = $model->save();
     $link = RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=searches', false);
     if ($result) {
         $this->setRedirect($link, JText::_('RST_SEARCH_SAVED_OK'));
     } else {
         $this->setRedirect($link, JText::_('RST_SEARCH_SAVED_ERROR'));
     }
 }
コード例 #18
0
ファイル: edit.php プロジェクト: atikahmed/joomla-probid
?>
</span></label></td>
			<td>
				<textarea cols="80" rows="10" class="text_area" type="text" name="text" id="text"><?php 
echo $this->escape($this->row->text);
?>
</textarea>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><button type="submit" class="button"><?php 
echo JText::_('RST_UPDATE');
?>
</button> <button type="button" onclick="document.location='<?php 
echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=notes&ticket_id=' . $this->row->ticket_id . '&tmpl=component');
?>
'" class="button"><?php 
echo JText::_('RST_BACK');
?>
</button></td>
		</tr>
	</table>
	
	<input type="hidden" name="option" value="com_rsticketspro" />
	<input type="hidden" name="view" value="notes" />
	<input type="hidden" name="task" value="update" />
	<input type="hidden" name="controller" value="notes" />
	<input type="hidden" name="tmpl" value="component" />
	
	<input type="hidden" name="ticket_id" value="<?php 
コード例 #19
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
    ?>
" >
	<td><?php 
    echo $this->pagination->getRowOffset($i);
    ?>
</td>
	<td><?php 
    echo JHTML::_('grid.id', $i, $item->id);
    ?>
</td>
	<td align="center"><?php 
    echo JHTML::_('rsticketsproicon.deletesearch', $item);
    ?>
</td>
	<td><a href="<?php 
    echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&controller=searches&task=edit&cid=' . $item->id);
    ?>
"><?php 
    echo !empty($item->name) ? $this->escape($item->name) : '<em>' . JText::_('RST_NO_TITLE') . '</em>';
    ?>
</a></td>
	<td><?php 
    echo $item->default ? JText::_('RST_YES') : JText::_('RST_NO');
    ?>
</td>
	<td class="order">
		<span><?php 
    echo $orderup;
    ?>
</span>
		<span><?php 
コード例 #20
0
ファイル: results.php プロジェクト: atikahmed/joomla-probid
</td>
	<td><a href="<?php 
    echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=article&cid=' . $item->id . ':' . JFilterOutput::stringURLSafe($item->name));
    ?>
"><?php 
    echo $item->name != '' ? $item->name : JText::_('RST_NO_TITLE');
    ?>
</a> <?php 
    echo $this->isHot($item->hits) ? '<em class="rst_hot">' . JText::_('RST_HOT') . '</em>' : '';
    ?>
</td>
	<td><?php 
    if ($item->category_id) {
        ?>
<a href="<?php 
        echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=knowledgebase&cid=' . $item->category_id . ':' . JFilterOutput::stringURLSafe($item->category_name));
        ?>
"><?php 
        echo $this->escape($item->category_name);
        ?>
</a><?php 
    } else {
        echo JText::_('RST_KB_NO_CATEGORY');
    }
    ?>
</td>
</tr>
<?php 
    $k = $k == 1 ? 2 : 1;
    $i++;
}
コード例 #21
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
</a></td>
				<td><?php 
                echo $this->escape(JText::_($ticket->status_name));
                ?>
</td>
			</tr>
			<?php 
                if (isset($ticket->message)) {
                    ?>
			<tr>
				<td colspan="2" bgcolor="#FFFFFF"><?php 
                    echo JHTML::image('components/com_rsticketspro/assets/images/smallicon4.gif', '', 'class="rsticketspro_smallicon"');
                    echo JText::_('RST_REPLY');
                    ?>
:  <a href="<?php 
                    echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=ticket&cid=' . $ticket->id . ':' . JFilterOutput::stringURLSafe($ticket->subject));
                    ?>
"><?php 
                    echo $this->trim(strip_tags($ticket->message));
                    ?>
</a></td>
			</tr>
			<?php 
                }
                ?>
			<?php 
            }
            ?>
		</table>
		<?php 
        } else {
コード例 #22
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
<?php 
}
$k = 1;
$i = 0;
foreach ($this->items as $item) {
    ?>
<tr class="sectiontableentry<?php 
    echo $k . $this->escape($this->params->get('pageclass_sfx'));
    ?>
" >
	<td align="right"><?php 
    echo $this->pagination->getRowOffset($i);
    ?>
</td>
	<td><a href="<?php 
    echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=article&cid=' . $item->id . ':' . JFilterOutput::stringURLSafe($item->name));
    ?>
"><?php 
    echo $item->name != '' ? $item->name : JText::_('RST_NO_TITLE');
    ?>
</a> <?php 
    echo $this->isHot($item->hits) ? '<em class="rst_hot">' . JText::_('RST_HOT') . '</em>' : '';
    ?>
</td>
	<?php 
    if ($this->params->get('show_hits', 0)) {
        ?>
	<td><?php 
        echo $item->hits;
        ?>
</td>
コード例 #23
0
    echo $message->message;
    ?>
</div>
			<?php 
    if ($has_files) {
        ?>
			<div class="rsticketspro_files">
			<?php 
        foreach ($this->row->files[$message->id] as $file) {
            ?>
			<div>
				<?php 
            echo JHTML::image('components/com_rsticketspro/assets/images/attach.png', JText::_('RST_THIS_TICKET_HAS_ATTACHMENTS'));
            ?>
 <a href="<?php 
            echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&task=download&cid=' . $this->row->id . '&file_id=' . $file->id);
            ?>
"><?php 
            echo $this->escape($file->filename);
            ?>
</a> <small><?php 
            echo JText::sprintf('RST_TICKET_FILE_DOWNLOADS', $file->downloads);
            ?>
</small>
			</div>
			<?php 
        }
        ?>
			</div>
			<?php 
    }
コード例 #24
0
ファイル: default.php プロジェクト: atikahmed/joomla-probid
/**
* @version 2.0.0
* @package RSTickets! Pro 2.0.0
* @copyright (C) 2010 www.rsjoomla.com
* @license GPL, http://www.gnu.org/licenses/gpl-2.0.html
*/
defined('_JEXEC') or die('Restricted access');
JHTML::_('behavior.tooltip');
?>

<?php 
echo RSTicketsProHelper::getConfig('global_message');
?>

<form id="rsticketspro_form" action="<?php 
echo RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=tickets');
?>
" method="post" name="adminForm" id="adminForm">
	<table cellspacing="0" cellpadding="0" border="0" width="100%" class="admintable">
	<tr>
		<td width="150"  align="right" class="key"><span class="hasTip" title="<?php 
echo JText::_('RST_SEARCH_TEXT_DESC');
?>
"><label for="filter_word"><?php 
echo JText::_('RST_SEARCH_TEXT');
?>
</label></span></td>
		<td><input type="text" name="filter_word" id="filter_word" size="40" value="" class="inputbox" /></td>
	</tr>
	<tr>
		<td width="150"  align="right" class="key"><label class="float_left" for="customer"><span class="hasTip" title="<?php 
コード例 #25
0
ファイル: notes.php プロジェクト: atikahmed/joomla-probid
 function save()
 {
     $mainframe =& JFactory::getApplication();
     // can add his own notes
     if (!$this->_permissions->add_note) {
         JError::raiseWarning(500, JText::_('RST_STAFF_CANNOT_ADD_NOTE'));
         $mainframe->redirect(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=rsticketspro', false));
     }
     $note =& JTable::getInstance('RSTicketsPro_Ticket_Notes', 'Table');
     $post = JRequest::get('post');
     $user = JFactory::getUser();
     $date = JFactory::getDate();
     $note->id = null;
     $note->ticket_id = (int) $post['ticket_id'];
     $note->user_id = $user->get('id');
     $note->text = $post['text'];
     $note->date = $date->toUnix();
     if ($note->store()) {
         return true;
     } else {
         JError::raiseWarning(500, $note->getError());
         return false;
     }
 }
コード例 #26
0
ファイル: ticket.php プロジェクト: atikahmed/joomla-probid
 function _notifyTicket()
 {
     if (!$this->is_staff) {
         return;
     }
     if (!RSTicketsProHelper::getConfig('autoclose_enabled')) {
         return;
     }
     if ($this->_ticket->last_reply_customer) {
         return;
     }
     if ($this->_ticket->autoclose_sent) {
         return;
     }
     $date = JFactory::getDate();
     $date = $date->toUnix();
     $date = RSTicketsProHelper::getCurrentDate($date);
     $this->_db->setQuery("UPDATE #__rsticketspro_tickets SET autoclose_sent='" . $date . "' WHERE id='" . $this->_ticket->id . "' LIMIT 1");
     $this->_db->query();
     $interval = RSTicketsProHelper::getConfig('autoclose_email_interval') * 86400;
     if ($interval < 86400) {
         $interval = 86400;
     }
     $last_reply_interval = RSTicketsProHelper::getCurrentDate($this->_ticket->last_reply) + $interval;
     if ($last_reply_interval > $date) {
         return;
     }
     $overdue = floor(($date - $last_reply_interval) / 86400);
     $closed = RSTicketsProHelper::getConfig('autoclose_interval');
     // get email sending settings
     $from = RSTicketsProHelper::getConfig('email_address');
     $fromname = RSTicketsProHelper::getConfig('email_address_fullname');
     // are we using global ?
     if (RSTicketsProHelper::getConfig('email_use_global')) {
         $config = new JConfig();
         $from = $config->mailfrom;
         $fromname = $config->fromname;
     }
     $department =& JTable::getInstance('RSTicketsPro_Departments', 'Table');
     $department->load($this->_ticket->department_id);
     if (!$department->get('email_use_global')) {
         $from = $department->email_address;
         $fromname = $department->email_address_fullname;
     }
     $email = RSTicketsProHelper::getEmail('notification_email');
     $customer = JFactory::getUser($this->_ticket->customer_id);
     $staff = JFactory::getUser($this->_ticket->staff_id);
     $code = $this->_ticket->code;
     $replace = array('{live_site}', '{ticket}', '{customer_name}', '{customer_username}', '{customer_email}', '{staff_name}', '{staff_username}', '{staff_email}', '{code}', '{subject}', '{inactive_interval}', '{close_interval}');
     $with = array(JURI::root(), RSTicketsProHelper::route(JURI::root() . 'index.php?option=com_rsticketspro&view=ticket&cid=' . $this->_ticket->id . ':' . JFilterOutput::stringURLSafe($this->_ticket->subject)), $customer->get('name'), $customer->get('username'), $customer->get('email'), $staff->get('name'), $staff->get('username'), $staff->get('email'), $code, $this->_ticket->subject, $overdue, $closed);
     $email_subject = str_replace($replace, $with, $email->subject);
     $email_message = str_replace($replace, $with, $email->message);
     JUtility::sendMail($from, $fromname, $customer->get('email'), $email_subject, $email_message, 1);
 }
コード例 #27
0
ファイル: html.php プロジェクト: atikahmed/joomla-probid
 function deletesearch($search, $attribs = null)
 {
     $url = RSTicketsProHelper::route('index.php?option=com_rsticketspro&controller=searches&task=delete&cid=' . $search->id);
     $img = JHTML::_('image.site', 'delete.png', '/components/com_rsticketspro/assets/images/', null, null, JText::_('RST_DELETE_SEARCH'));
     $return = '<span class="hasTip" title="' . JText::_('RST_DELETE_SEARCH_DESC') . '" ' . $attribs . '><a href="' . $url . '" onclick="return confirm(\'' . JText::_('RST_DELETE_SEARCH_CONFIRM', true) . '\')">' . $img . '</a></span>';
     return $return;
 }