Esempio n. 1
0
 /**
  * Override Build Toolbar function, only need Publish, Unpublish and Delete button
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . strtoupper($viewName) . '_MANAGEMENT'));
     JToolBarHelper::deleteList(JText::_($this->lang_prefix . '_DELETE_' . strtoupper($this->getName()) . '_CONFIRM'), $controller . '.remove');
     JToolBarHelper::publishList($controller . '.publish');
     JToolBarHelper::unpublishList($controller . '.unpublish');
 }
Esempio n. 2
0
 /**
  * Build the toolbar for view list
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . strtoupper($viewName) . '_MANAGEMENT'));
     JToolBarHelper::editList($controller . '.edit');
     if (JFactory::getUser()->authorise('core.admin', 'com_osmembership')) {
         JToolBarHelper::preferences('com_osmembership');
     }
 }
Esempio n. 3
0
 /**
  * Build the toolbar for view list 
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . strtoupper($viewName) . '_MANAGEMENT'));
     JToolBarHelper::deleteList(JText::_($this->lang_prefix . '_DELETE_' . strtoupper($this->getName()) . '_CONFIRM'), $controller . '.remove');
     JToolBarHelper::editList($controller . '.edit');
     JToolBarHelper::addNew($controller . '.add');
     JToolBarHelper::custom($controller . '.copy', 'copy.png', 'copy_f2.png', 'Copy', true);
     JToolBarHelper::publishList($controller . '.publish');
     JToolBarHelper::unpublishList($controller . '.unpublish');
 }
Esempio n. 4
0
 /**
  * Build the toolbar for view list 
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . strtoupper($viewName) . '_MANAGEMENT'));
     JToolBarHelper::deleteList(JText::_($this->lang_prefix . '_DELETE_' . strtoupper($this->getName()) . '_CONFIRM'), $controller . '.remove');
     JToolBarHelper::editList($controller . '.edit');
     JToolBarHelper::addNew($controller . '.add');
     JToolBarHelper::publishList($controller . '.publish');
     JToolBarHelper::unpublishList($controller . '.unpublish');
     if (JFactory::getUser()->authorise('core.admin', 'com_osmembership')) {
         JToolBarHelper::preferences('com_osmembership');
     }
 }
Esempio n. 5
0
 /**
  * Build the toolbar for view list
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     $edit = JRequest::getVar('edit');
     if ($edit) {
         $toolbarTitle = $this->lang_prefix . '_' . $viewName . '_EDIT';
     } else {
         $toolbarTitle = $this->lang_prefix . '_' . $viewName . '_NEW';
     }
     JToolBarHelper::title(JText::_(strtoupper($toolbarTitle)));
     JToolBarHelper::save($controller . '.save');
     JToolBarHelper::apply($controller . '.apply');
     JToolBarHelper::cancel($controller . '.cancel');
 }
Esempio n. 6
0
 /**
  * Build the toolbar for view list
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     if ($viewName == 'status') {
         $controller = $viewName;
     } else {
         $controller = OSInflector::singularize($viewName);
     }
     $edit = JRequest::getVar('edit');
     $text = $edit ? JText::_($this->lang_prefix . '_EDIT') : JText::_($this->lang_prefix . '_NEW');
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . $viewName) . ': <small><small>[ ' . $text . ' ]</small></small>');
     JToolBarHelper::save($controller . '.save');
     JToolBarHelper::apply($controller . '.apply');
     JToolBarHelper::cancel($controller . '.cancel');
 }
Esempio n. 7
0
 /**
  * Constructor
  *
  * @since 1.5
  */
 function __construct($config = array())
 {
     parent::__construct();
     if (isset($config['table_filename'])) {
         $this->tableFileName = $config['table_filename'];
     } else {
         $this->getTableFilename();
     }
     if (isset($config['table_name'])) {
         $this->tableName = $config['table_name'];
     } else {
         $this->tableName = $this->_db->getPrefix() . strtolower(OSF_TABLE_PREFIX . '_' . OSInflector::pluralize($this->getName()));
     }
     $array = JRequest::getVar('cid', array(0), '', 'array');
     $edit = JRequest::getVar('edit', true);
     if ($edit) {
         $this->setId((int) $array[0]);
     }
 }
Esempio n. 8
0
 /**
  * Unpublish entities
  *
  */
 function unpublish()
 {
     $cid = JRequest::getVar('cid', array(), 'post');
     JArrayHelper::toInteger($cid);
     $model =& $this->getModel($this->entityName);
     $ret = $model->publish($cid, 0);
     if ($ret) {
         $msg = JText::_($this->langPrefix . '_' . OSInflector::pluralize($this->entityName) . '_UNPUBLISHED');
     } else {
         $msg = JText::_($this->langPrefix . '_' . OSInflector::pluralize($this->entityName) . '_UNPUBLISH_ERROR');
     }
     $this->setRedirect($this->viewListUrl, $msg);
 }
Esempio n. 9
0
 * @subpackage	Helpdesk Pro
 * @author  Tuan Pham Ngoc
 * @copyright	Copyright (C) 2012 Ossolution Team
 * @license		GNU/GPL, see LICENSE.php
 */
// no direct access
defined('_JEXEC') or die;
//Require the controller
error_reporting(0);
require_once JPATH_ROOT . '/components/com_helpdeskpro/helper/helper.php';
require_once JPATH_ROOT . '/components/com_helpdeskpro/helper/fields.php';
//OS Framework
require_once JPATH_ROOT . '/administrator/components/com_helpdeskpro/libraries/defines.php';
require_once JPATH_ROOT . '/administrator/components/com_helpdeskpro/libraries/inflector.php';
require_once JPATH_ROOT . '/administrator/components/com_helpdeskpro/libraries/factory.php';
OSInflector::addWord('status', 'statuses');
$command = JRequest::getVar('task', 'display');
// Check for a controller.task command.
if (strpos($command, '.') !== false) {
    list($controller, $task) = explode('.', $command);
    $path = JPATH_COMPONENT . '/controllers/' . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
        $className = 'HelpdeskproController' . ucfirst($controller);
        $controller = new $className();
    } else {
        //Fallback to default controller
        OSFactory::loadLibrary('controller');
        $controller = new OSController(array('entity_name' => $controller, 'name' => 'Helpdeskpro'));
    }
    JRequest::setVar('task', $task);
Esempio n. 10
0
 /**
  * Custom toolbar
  * @see OSViewList::_buildToolbar()
  */
 function _buildToolbar()
 {
     $viewName = $this->getName();
     $controller = OSInflector::singularize($this->getName());
     JToolBarHelper::title(JText::_($this->lang_prefix . '_' . strtoupper($viewName) . '_MANAGEMENT'));
     JToolBarHelper::deleteList(JText::_($this->lang_prefix . '_DELETE_' . strtoupper($this->getName()) . '_CONFIRM'), $controller . '.remove');
     JToolBarHelper::addNew($controller . '.add');
     JToolBarHelper::custom('csv_export', 'export', 'export', 'Export Tickets', false);
 }