/** * Execute and display a template : ControlPanel * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_CONTROLPANEL"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'changelogs.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->menu = RtiprintHelper::addSubmenu('changelogs', 'default'); $this->mainmenu = RtiprintHelper::addSubmenu('changelogs', 'default', 'mainmenu'); $this->geographymenu = RtiprintHelper::addSubmenu('changelogs', 'default', 'geographymenu'); $this->systemmenu = RtiprintHelper::addSubmenu('changelogs', 'default', 'systemmenu'); $lists = array(); $this->lists =& $lists; //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_CONTROLPANEL'), 'rtiprint_changelogs'); // Config if ($model->canAdmin()) { CkJToolBarHelper::preferences('com_rtiprint'); } }
/** * Execute and display a template : Printers * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_PRINTERS"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'printers.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->filters = $filters = $model->getForm('default.filters'); $this->menu = RtiprintHelper::addSubmenu('printers', 'default'); $lists = array(); $this->lists =& $lists; //Filters // Printer Model > Name $modelPrinter_model = CkJModel::getInstance('printermdls', 'RtiprintModel'); $filters['filter_printer_model']->jdomOptions = array('list' => $modelPrinter_model->getItems()); // Building > Building $filters['filter_building']->jdomOptions = array('ajaxVars' => array('values' => array($model->getState("filter.building"), $model->getState("filter.building_town")))); // Server > Name $modelServer = CkJModel::getInstance('servers', 'RtiprintModel'); $filters['filter_server']->jdomOptions = array('list' => $modelServer->getItems()); // Sort by $filters['sortTable']->jdomOptions = array('list' => $this->getSortFields('default')); // Limit $filters['limit']->jdomOptions = array('pagination' => $this->pagination); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_PRINTERS'), 'rtiprint_printers'); // New if ($model->canCreate()) { CkJToolBarHelper::addNew('printer.add', "RTIPRINT_JTOOLBAR_NEW"); } // Edit if ($model->canEdit()) { CkJToolBarHelper::editList('printer.edit', "RTIPRINT_JTOOLBAR_EDIT"); } // Publish if ($model->canEditState()) { CkJToolBarHelper::publishList('printers.publish', "RTIPRINT_JTOOLBAR_PUBLISH"); } // Unpublish if ($model->canEditState()) { CkJToolBarHelper::unpublishList('printers.unpublish', "RTIPRINT_JTOOLBAR_UNPUBLISH"); } // Archive if ($model->canEditState()) { CkJToolBarHelper::archiveList('printers.archive', "RTIPRINT_JTOOLBAR_ARCHIVE"); } // Trash if ($model->canEditState()) { CkJToolBarHelper::trash('printers.trash', "RTIPRINT_JTOOLBAR_TRASH"); } // Delete if ($model->canDelete()) { CkJToolBarHelper::deleteList(JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'printer.delete', "RTIPRINT_JTOOLBAR_DELETE"); } }
/** * Execute and display a template : Printer * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayPrinter($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_PRINTER"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; // Initialiase variables. $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'printer.printer'); $this->item = $item = $this->get('Item'); $this->canDo = $canDo = RtiprintHelper::getActions($model->getId()); $lists = array(); $this->lists =& $lists; $user = JFactory::getUser(); $isNew = $model->getId() == 0; //Check ACL before opening the view (prevent from direct access) if (!$model->canAccess($item)) { $model->setError(JText::_('JERROR_ALERTNOAUTHOR')); } // Check for errors. if (count($errors = $model->getErrors())) { JError::raiseError(500, implode(BR, array_unique($errors))); return false; } $jinput = JFactory::getApplication()->input; //Hide the component menu in item layout $jinput->set('hidemainmenu', true); //Toolbar initialization // Cancel CkJToolBarHelper::cancel('printer.cancel', "RTIPRINT_JTOOLBAR_CANCEL"); }
/** * Execute and display a template : Manufacturers * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_MANUFACTURERS"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'manufacturers.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->filters = $filters = $model->getForm('default.filters'); $this->menu = RtiprintHelper::addSubmenu('manufacturers', 'default'); $lists = array(); $this->lists =& $lists; //Filters // Sort by $filters['sortTable']->jdomOptions = array('list' => $this->getSortFields('default')); // Limit $filters['limit']->jdomOptions = array('pagination' => $this->pagination); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_MANUFACTURERS'), 'rtiprint_manufacturers'); // New if ($model->canCreate()) { CkJToolBarHelper::addNew('manufacturer.add', "RTIPRINT_JTOOLBAR_NEW"); } // Edit if ($model->canEdit()) { CkJToolBarHelper::editList('manufacturer.edit', "RTIPRINT_JTOOLBAR_EDIT"); } // Publish if ($model->canEditState()) { CkJToolBarHelper::publishList('manufacturers.publish', "RTIPRINT_JTOOLBAR_PUBLISH"); } // Unpublish if ($model->canEditState()) { CkJToolBarHelper::unpublishList('manufacturers.unpublish', "RTIPRINT_JTOOLBAR_UNPUBLISH"); } // Archive if ($model->canEditState()) { CkJToolBarHelper::archiveList('manufacturers.archive', "RTIPRINT_JTOOLBAR_ARCHIVE"); } // Trash if ($model->canEditState()) { CkJToolBarHelper::trash('manufacturers.trash', "RTIPRINT_JTOOLBAR_TRASH"); } // Delete if ($model->canDelete()) { CkJToolBarHelper::deleteList(JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'manufacturer.delete', "RTIPRINT_JTOOLBAR_DELETE"); } }
/** * Execute and display a template : Favourites * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayDefault($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_FAVOURITES"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'favourites.default'); $this->items = $items = $this->get('Items'); $this->canDo = $canDo = RtiprintHelper::getActions(); $this->pagination = $this->get('Pagination'); $this->filters = $filters = $model->getForm('default.filters'); $this->menu = RtiprintHelper::addSubmenu('favourites', 'default'); $lists = array(); $this->lists =& $lists; //Filters // User $modelCreated_by = CkJModel::getInstance('thirdusers', 'RtiprintModel'); $filters['filter_created_by']->jdomOptions = array('list' => $modelCreated_by->getItems()); // Sort by $filters['sortTable']->jdomOptions = array('list' => $this->getSortFields('default')); // Limit $filters['limit']->jdomOptions = array('pagination' => $this->pagination); //Toolbar initialization // Delete if ($model->canDelete()) { CkJToolBarHelper::deleteList(JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'favourite.delete', "RTIPRINT_JTOOLBAR_DELETE"); } }
/** * Execute and display a template : Printer * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayPrinter($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_PRINTER"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; // Initialiase variables. $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'printer.printer'); $this->item = $item = $this->get('Item'); $this->form = $form = $this->get('Form'); $this->canDo = $canDo = RtiprintHelper::getActions($model->getId()); $lists = array(); $this->lists =& $lists; $user = JFactory::getUser(); $isNew = $model->getId() == 0; //Check ACL before opening the form (prevent from direct access) if (!$model->canEdit($item, true)) { $model->setError(JText::_('JERROR_ALERTNOAUTHOR')); } // Check for errors. if (count($errors = $model->getErrors())) { JError::raiseError(500, implode(BR, array_unique($errors))); return false; } $jinput = JFactory::getApplication()->input; //Hide the component menu in item layout $jinput->set('hidemainmenu', true); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_PRINTER'), 'rtiprint_printers'); // Save if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::apply('printer.apply', "RTIPRINT_JTOOLBAR_SAVE"); } // Save & Close if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save('printer.save', "RTIPRINT_JTOOLBAR_SAVE_CLOSE"); } // Save & New if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save2new('printer.save2new', "RTIPRINT_JTOOLBAR_SAVE_NEW"); } // Save to Copy if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save2copy('printer.save2copy', "RTIPRINT_JTOOLBAR_SAVE_TO_COPY"); } // Cancel CkJToolBarHelper::cancel('printer.cancel', "RTIPRINT_JTOOLBAR_CANCEL"); // Delete if (!$isNew && $item->params->get('access-delete')) { JToolbar::getInstance('toolbar')->appendButton('Confirm', JText::_('RTIPRINT_JTOOLBAR_ARE_YOU_SURE_TO_DELETE'), 'delete', "RTIPRINT_JTOOLBAR_DELETE", 'printer.delete', false); } $model_printer_model = CkJModel::getInstance('Printermdls', 'RtiprintModel'); $model_printer_model->addGroupOrder("a.name"); $lists['fk']['printer_model'] = $model_printer_model->getItems(); $model_server = CkJModel::getInstance('Servers', 'RtiprintModel'); $model_server->addGroupOrder("a.name"); $lists['fk']['server'] = $model_server->getItems(); }
/** * Execute and display a template : Manufacturer * * @access protected * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @since 11.1 */ protected function displayManufacturer($tpl = null) { $document = JFactory::getDocument(); $this->title = JText::_("RTIPRINT_LAYOUT_MANUFACTURER"); $document->title = $document->titlePrefix . $this->title . $document->titleSuffix; // Initialiase variables. $this->model = $model = $this->getModel(); $this->state = $state = $this->get('State'); $state->set('context', 'manufacturer.manufacturer'); $this->item = $item = $this->get('Item'); $this->form = $form = $this->get('Form'); $this->canDo = $canDo = RtiprintHelper::getActions($model->getId()); $lists = array(); $this->lists =& $lists; $user = JFactory::getUser(); $isNew = $model->getId() == 0; //Check ACL before opening the form (prevent from direct access) if (!$model->canEdit($item, true)) { $model->setError(JText::_('JERROR_ALERTNOAUTHOR')); } // Check for errors. if (count($errors = $model->getErrors())) { JError::raiseError(500, implode(BR, array_unique($errors))); return false; } $jinput = JFactory::getApplication()->input; //Hide the component menu in item layout $jinput->set('hidemainmenu', true); //Toolbar initialization JToolBarHelper::title(JText::_('RTIPRINT_LAYOUT_MANUFACTURER'), 'rtiprint_manufacturers'); // Save if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::apply('manufacturer.apply', "RTIPRINT_JTOOLBAR_SAVE"); } // Save & Close if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save('manufacturer.save', "RTIPRINT_JTOOLBAR_SAVE_CLOSE"); } // Save & New if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save2new('manufacturer.save2new', "RTIPRINT_JTOOLBAR_SAVE_NEW"); } // Save to Copy if ($isNew && $model->canCreate() || !$isNew && $item->params->get('access-edit')) { CkJToolBarHelper::save2copy('manufacturer.save2copy', "RTIPRINT_JTOOLBAR_SAVE_TO_COPY"); } // Cancel CkJToolBarHelper::cancel('manufacturer.cancel', "RTIPRINT_JTOOLBAR_CANCEL"); }