Exemplo n.º 1
0
 /**
  * Cargos view display method
  * @return void
  */
 function display($tpl = null)
 {
     $this->canDo = JHelperContent::getActions('com_agendadirigentes');
     if (!$this->canDo->get('cargos.list')) {
         return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Get data from the model
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     AgendaDirigentesHelper::addSubmenu('cargos');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Assign data to the view
     $this->user = JFactory::getUser();
     $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
     $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
     // Set the toolbar
     $this->addToolBar($this->pagination->total);
     //set sidebar menu
     $this->sidebar = JHtmlSidebar::render();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
 /**
  * Method to get the field options for category
  * Use the extension attribute in a form to specify the.specific extension for
  * which categories should be displayed.
  * Use the show_root attribute to specify whether to show the global category root in the list.
  *
  * @return  array    The field option objects.
  *
  * @since   11.1
  */
 protected function getOptions()
 {
     $options = array();
     $extension = $this->element['extension'] ? (string) $this->element['extension'] : (string) $this->element['scope'];
     $published = (string) $this->element['published'];
     // Load the category options for a given extension.
     if (!empty($extension)) {
         // Filter over published state or not depending upon if it is present.
         if ($published) {
             $options = JHtml::_('category.options', $extension, array('filter.published' => explode(',', $published)));
         } else {
             $options = JHtml::_('category.options', $extension);
         }
         $componentParams = AgendaDirigentesHelper::getParams();
         $restrictionType = $this->getAttribute('restrictType', 'cargos');
         $restrictedList = $componentParams->get('restricted_list_' . $restrictionType, 0);
         if ($restrictedList == 1 && !AgendaDirigentesHelper::isSuperUser()) {
             $input = JFactory::getApplication()->input;
             $id = $input->getInt('id', 0);
             if (empty($id)) {
                 foreach ($options as $i => $option) {
                     $canCreate = AgendaDirigentesHelper::getGranularPermissions($restrictionType, $option->value, 'create');
                     if (!$canCreate) {
                         unset($options[$i]);
                     }
                 }
             } else {
                 foreach ($options as $i => $option) {
                     list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions($restrictionType, $option->value, 'manage');
                     if (!$canManage) {
                         unset($options[$i]);
                     }
                 }
             }
         } else {
             if ((string) $this->element['action']) {
                 // Get the current user object.
                 $user = JFactory::getUser();
                 foreach ($options as $i => $option) {
                     /*
                      * To take save or create in a category you need to have create rights for that category
                      * unless the item is already in that category.
                      * Unset the option if the user isn't authorised for it. In this field assets are always categories.
                      */
                     if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true) {
                         unset($options[$i]);
                     }
                 }
             }
         }
         if (isset($this->element['show_root'])) {
             array_unshift($options, JHtml::_('select.option', '0', JText::_('JGLOBAL_ROOT')));
         }
     } else {
         JLog::add(JText::_('JLIB_FORM_ERROR_FIELDS_CATEGORY_ERROR_EXTENSION_EMPTY'), JLog::WARNING, 'jerror');
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Exemplo n.º 3
0
 /**
  * Method to build an SQL query to load the list data.
  *
  * @return      string  An SQL query
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select($db->quoteName('dir.id') . ', ' . $db->quoteName('dir.name') . ', ' . $db->quoteName('dir.cargo_id') . ', ' . $db->quoteName('dir.state') . ', ' . $db->quoteName('dir.interino') . ', ' . $db->quoteName('dir.em_atividade') . ', ' . $db->quoteName('dir.sexo') . ', ' . $db->quoteName('car.catid') . ', ' . $db->quoteName('car.name', 'cargo') . ', ' . $db->quoteName('car.name_f', 'cargo_f') . ', ' . $db->quoteName('cat.title', 'categoria') . ', ' . $db->quoteName('cat.title', 'categoria'))->from($db->quoteName('#__agendadirigentes_dirigentes', 'dir'))->join('LEFT', $db->quoteName('#__agendadirigentes_cargos', 'car') . ' ON (' . $db->quoteName('car.id') . ' = ' . $db->quoteName('dir.cargo_id') . ')')->join('INNER', $db->quoteName('#__categories', 'cat') . ' ON (' . $db->quoteName('cat.id') . ' = ' . $db->quoteName('car.catid') . ')');
     // Filter by state
     $state = $this->state->get('filter.state');
     if (is_numeric($state)) {
         $query->where('dir.state = ' . (int) $state);
     } elseif ($state === '') {
         $query->where('(dir.state IN (0, 1))');
     }
     // Filter by category.
     $catid = $this->getState('filter.catid');
     if (is_numeric($catid)) {
         $query->where('car.catid = ' . (int) $catid);
     }
     // Filter by cargo.
     $cargo_id = $this->getState('filter.cargo_id');
     if (is_numeric($cargo_id)) {
         $query->where('dir.cargo_id = ' . (int) $cargo_id);
     }
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('dir.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->quote('%' . $db->escape($search, true) . '%');
             $query->where('(dir.name LIKE ' . $search . ')');
         }
     }
     //restringir de acordo com as permissoes de usuario
     if ($this->state->get('params')->get('restricted_list_dirigentes', 0) == 1 && !AgendaDirigentesHelper::isSuperUser()) {
         $formatedToGetPermissions = true;
         $categories = $this->getCategories($formatedToGetPermissions);
         $allowed_categories = array();
         for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
             list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('dirigentes', $categories[$i]);
             if ($canManage || $canChange) {
                 $allowed_categories[] = $categories[$i]->catid;
             }
         }
         if (count($allowed_categories)) {
             $allowed_categories = implode(', ', $allowed_categories);
             $query->where($db->quoteName('car.catid') . ' IN (' . $allowed_categories . ')');
         } else {
             $allowed_categories = 0;
             $query->where($db->quoteName('car.catid') . ' IN (' . $allowed_categories . ')');
         }
     }
     // Add the list ordering clause.
     $orderCol = $this->state->get('list.ordering', 'dir.name');
     $orderDirn = $this->state->get('list.direction', 'ASC');
     $query->order($db->escape($orderCol . ' ' . $orderDirn));
     // echo $query->dump();die();
     return $query;
 }
Exemplo n.º 4
0
 protected function canEditState($item)
 {
     list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('cargos', $item, 'manage');
     if ($canChange) {
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
 /**
  * Method to build an SQL query to load the list data.
  *
  * @return      string  An SQL query
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     // Select some fields from the cargos table
     $query->select('DISTINCT a.id, a.name, a.name_f, a.catid, a.published, a.featured, b.title AS titleCategory, a.ordering, a.permitir_sobreposicao')->from($db->quoteName('#__agendadirigentes_cargos', 'a'))->join('INNER', $db->quoteName('#__categories', 'b') . ' ON (' . $db->quoteName('b.id') . ' = ' . $db->quoteName('a.catid') . ')');
     // Filter by published state
     $published = $this->state->get('filter.published');
     if (is_numeric($published)) {
         $query->where('a.published = ' . (int) $published);
     } elseif ($published === '') {
         $query->where('(a.published IN (0, 1))');
     }
     // Filter by category.
     $catid = $this->getState('filter.catid');
     if (is_numeric($catid)) {
         $query->where('a.catid = ' . (int) $catid);
     }
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('a.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->quote('%' . $db->escape($search, true) . '%');
             $query->where('(a.name LIKE ' . $search . ')');
         }
     }
     //restringir de acordo com as permissoes de usuario
     if ($this->state->get('params')->get('restricted_list_cargos', 0) == 1 && !AgendaDirigentesHelper::isSuperUser()) {
         $formatedToGetPermissions = true;
         $categories = $this->getCategories($formatedToGetPermissions);
         $allowed_categories = array();
         for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
             list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('cargos', $categories[$i]);
             if ($canManage || $canChange) {
                 $allowed_categories[] = $categories[$i]->catid;
             }
         }
         if (count($allowed_categories)) {
             $allowed_categories = implode(', ', $allowed_categories);
             $query->where($db->quoteName('a.catid') . ' IN (' . $allowed_categories . ')');
         } else {
             $allowed_categories = 0;
             $query->where($db->quoteName('a.catid') . ' IN (' . $allowed_categories . ')');
         }
     }
     // Add the list ordering clause.
     $orderCol = $this->state->get('list.ordering', 'a.id');
     $orderDirn = $this->state->get('list.direction', 'DESC');
     $query->order($db->escape($orderCol . ' ' . $orderDirn));
     return $query;
 }
Exemplo n.º 6
0
 /**
  * Implement to allow edit or not
  * Overwrites: JControllerForm::allowEdit
  *
  * @param array $data
  * @param string $key
  * @return bool
  */
 protected function allowEdit($data = array(), $key = 'id')
 {
     $id = isset($data[$key]) ? $data[$key] : 0;
     if (!empty($id)) {
         $model = $this->getModel();
         $item = $model->getTable();
         $item->load($id);
         list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('dirigentes', $item, 'manage');
         return $canManage;
     }
     return true;
 }
Exemplo n.º 7
0
 /**
  * display method of Compromisso
  * @return void
  */
 public function display($tpl = null)
 {
     // get the Data
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->script = $this->get('Script');
     $this->isNew = $this->item->id == 0;
     $app = JFactory::getApplication();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $this->canDo = JHelperContent::getActions('com_agendadirigentes');
     $this->canCreate = $this->canDo->get('core.create');
     if ($this->isNew) {
         if (!$this->canCreate) {
             JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
             $app->redirect('index.php');
         }
         $this->canManage = $this->canDo->get('core.edit') || $this->canDo->get('core.edit.own');
         $this->canChange = $this->canDo->get('core.edit.state');
     } else {
         list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('compromissos', $this->item, 'manage');
         $this->canManage = $canManage;
         $this->canChange = $canChange;
         if (!$this->canManage) {
             JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
             $app->redirect('index.php');
         }
     }
     $isSuperUser = AgendaDirigentesHelper::isSuperUser();
     $params = JComponentHelper::getParams('com_agendadirigentes');
     $allowFeature = $params->get('allowFeature', 'state');
     $this->showFeatured = $allowFeature == 'state' && $this->canChange || $allowFeature == 'edit' && $this->canManage || $allowFeature == 'superuser' && $isSuperUser;
     $this->permitir_participantes_locais = $params->get('permitir_participantes_locais', 1);
     $this->permitir_participantes_externos = $params->get('permitir_participantes_externos', 1);
     // Set the toolbar
     $this->addToolBar();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
Exemplo n.º 8
0
 /**
  * display method of Dirigente
  * @return void
  */
 public function display($tpl = null)
 {
     // get the Data
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     if (empty($this->item)) {
         $this->item = new StdClass();
         $this->item->id = 0;
     }
     $this->isNew = $this->item->id == 0;
     $app = JFactory::getApplication();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $this->canDo = JHelperContent::getActions('com_agendadirigentes');
     $this->canCreate = $this->canDo->get('dirigentes.create');
     if ($this->isNew) {
         if (!$this->canCreate) {
             JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
             $app->redirect('index.php');
         }
         $this->canChange = $this->canDo->get('dirigentes.edit.state');
     } else {
         list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('dirigentes', $this->item, 'manage');
         $this->canManage = $canManage;
         $this->canChange = $canChange;
         if (!$this->canManage) {
             JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
             $app->redirect('index.php');
         }
     }
     // Set the toolbar
     $this->addToolBar();
     // Display the template
     parent::display($tpl);
     // Set the document
     $this->setDocument();
 }
Exemplo n.º 9
0
 public static function isPluginActive()
 {
     if (is_null(self::$pluginActive)) {
         $db = JFactory::getDBO();
         $query = $db->getQuery(true);
         $query->select($db->quoteName('enabled'))->from($db->quoteName('#__extensions'))->where($db->quoteName('type') . ' = ' . $db->Quote('plugin') . ' AND ' . $db->quoteName('element') . ' = ' . $db->Quote('agendadirigentes') . ' AND ' . $db->quoteName('folder') . ' = ' . $db->Quote('search'));
         $db->setQuery((string) $query);
         self::$pluginActive = $db->loadResult();
     }
     return self::$pluginActive;
 }
Exemplo n.º 10
0
<?php

/**
* @package PortalPadrao
* @subpackage com_agendadirigentes
*
* @copyright Copyright (C) 2005 - 2014 Joomla Calango. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// impedir acesso direto ao arquivo
defined('_JEXEC') or die;
foreach ($this->items as $i => $item) {
    list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('dirigentes', $item);
    ?>
        <tr class="row<?php 
    echo $i % 2;
    ?>
">
                <td>
                    <?php 
    if ($canManage) {
        ?>
                        <?php 
        echo $item->id;
        ?>
                    <?php 
    }
    ?>
                </td>
                <td>
                    <?php 
Exemplo n.º 11
0
 /**
  * Method to build an SQL query to load the list data.
  *
  * @return      string  An SQL query
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     // Select some fields from the compromissos table
     $query->select(' comp.id, comp.checked_out, comp.title, comp.data_inicial')->select(' comp.data_final, comp.horario_inicio, comp.horario_fim, comp.description, comp.local')->select(' comp.params, comp.featured, comp.created_by')->select(' comp.state, comp.dia_todo')->select(' dc.sobreposto, dc.owner, dc.sobreposto_por')->select(' dir.name AS nameOwner, dir.id AS idOwner')->select(' car.name AS cargoOwner, car.catid')->from($db->quoteName('#__agendadirigentes_compromissos', 'comp'));
     $participante_id = $this->getState('filter.participante_id');
     if (is_numeric($participante_id)) {
         $query->where('dc.dirigente_id = ' . (int) $participante_id);
         $this->setState('list.status_dono_compromisso', 0);
     }
     $status_dono_compromisso = $this->getState('list.status_dono_compromisso', 1);
     if ($status_dono_compromisso == 0) {
         $query->join('LEFT', $db->quoteName('#__agendadirigentes_dirigentes_compromissos', 'dc') . ' ON (' . $db->quoteName('comp.id') . ' = ' . $db->quoteName('dc.compromisso_id') . ')');
     } else {
         $query->join('LEFT', $db->quoteName('#__agendadirigentes_dirigentes_compromissos', 'dc') . ' ON (' . $db->quoteName('comp.id') . ' = ' . $db->quoteName('dc.compromisso_id') . ' AND dc.owner = 1)');
     }
     $query->join('LEFT', $db->quoteName('#__agendadirigentes_dirigentes', 'dir') . ' ON (' . $db->quoteName('dc.dirigente_id') . ' = ' . $db->quoteName('dir.id') . ')')->join('LEFT', $db->quoteName('#__agendadirigentes_cargos', 'car') . ' ON (' . $db->quoteName('dir.cargo_id') . ' = ' . $db->quoteName('car.id') . ')');
     // Filter by state
     $state = $this->state->get('filter.state');
     if (is_numeric($state)) {
         $query->where('comp.state = ' . (int) $state);
     } elseif ($state === '') {
         $query->where('(comp.state IN (0, 1))');
     }
     // Filter by category.
     $catid = $this->getState('filter.catid');
     if (is_numeric($catid)) {
         $query->where('car.catid = ' . (int) $catid);
     }
     // Filter by cargo.
     $cargo_id = $this->getState('filter.cargo_id');
     if (is_numeric($cargo_id)) {
         $query->where('dir.cargo_id = ' . (int) $cargo_id);
     }
     // Filter by dia todo.
     $dia_todo = $this->getState('filter.dia_todo');
     if (is_numeric($dia_todo)) {
         $query->where('comp.dia_todo = ' . (int) $dia_todo);
     }
     //filter by 1 dia ou mais de compromisso
     $duracao = $this->getState('filter.duracao');
     if (intval($duracao) == 1) {
         $query->where($db->quoteName('data_inicial') . ' = ' . $db->quoteName('data_final'));
     } elseif (intval($duracao) == 2) {
         $query->where($db->quoteName('data_inicial') . ' <> ' . $db->quoteName('data_final'));
     }
     // Filter by dirigente.
     $dirigente_id = $this->getState('filter.dirigente_id');
     if (is_numeric($dirigente_id)) {
         $query->where('dir.id = ' . (int) $dirigente_id);
     }
     $featured = $this->getState('filter.featured', '');
     if ($featured != '') {
         $query->where('comp.featured = ' . (int) $featured);
     }
     // Filter by data inicial | data final.
     $data_inicial = $this->getState('dates.data_inicial');
     $data_final = $this->getState('dates.data_final');
     if (!empty($data_inicial) || !empty($data_final)) {
         require_once JPATH_COMPONENT . '/models/rules/databrasil.php';
         $dateVerify = new JFormRuleDataBrasil();
         if (preg_match($dateVerify->getRegex(), $data_inicial)) {
             $data_inicial = $this->format_date_mysql($data_inicial);
             $clause = $db->quoteName('data_inicial') . ' >= ' . $db->Quote($data_inicial);
             $query->where($clause);
         }
         if (preg_match($dateVerify->getRegex(), $data_final)) {
             $data_final = $this->format_date_mysql($data_final);
             $clause = '(' . $db->quoteName('data_final') . ' <= ' . $db->Quote($data_final);
             $clause .= ' OR ';
             $clause .= $db->quoteName('data_final') . ' = ' . $db->Quote('0000-00-00') . ')';
             $query->where($clause);
         }
     }
     // Filter by search in title
     $search = $this->getState('filter.search');
     if (!empty($search)) {
         if (stripos($search, 'id:') === 0) {
             $query->where('comp.id = ' . (int) substr($search, 3));
         } else {
             $search = $db->quote('%' . $db->escape($search, true) . '%');
             $query->where('(comp.title LIKE ' . $search . ')');
         }
     }
     //restringir de acordo com as permissoes de usuario
     if ($this->state->get('params')->get('restricted_list_compromissos', 0) == 1 && !AgendaDirigentesHelper::isSuperUser()) {
         $formatedToGetPermissions = true;
         $categories = $this->getCategories($formatedToGetPermissions);
         $allowed_categories = array();
         for ($i = 0, $limit = count($categories); $i < $limit; $i++) {
             list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('compromissos', $categories[$i]);
             if ($canManage || $canChange) {
                 $allowed_categories[] = $categories[$i]->catid;
             }
         }
         if (count($allowed_categories)) {
             $allowed_categories = implode(', ', $allowed_categories);
             $query->where($db->quoteName('car.catid') . ' IN (' . $allowed_categories . ')');
         } else {
             $allowed_categories = 0;
             $query->where($db->quoteName('car.catid') . ' IN (' . $allowed_categories . ')');
         }
     }
     // Add the list ordering clause.
     $orderCol = $this->state->get('list.ordering', 'comp.id');
     $orderDirn = $this->state->get('list.direction', 'DESC');
     if ($orderCol == 'comp.data_inicial' || $orderCol == 'comp.data_final') {
         $ordering = $db->escape($orderCol . ' ' . $orderDirn . ', comp.horario_inicio ASC');
     } else {
         $ordering = $db->escape($orderCol . ' ' . $orderDirn);
     }
     $query->order($ordering);
     return $query;
 }
Exemplo n.º 12
0
 /**
  * Method to toggle the featured setting of a list of compromissos.
  *
  * @return  void
  * @since   1.6
  */
 public function featured()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $user = JFactory::getUser();
     $isSuperUser = AgendaDirigentesHelper::isSuperUser();
     $ids = $this->input->get('cid', array(), 'array');
     $values = array('featured' => 1, 'unfeatured' => 0);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($values, $task, 0, 'int');
     $model = $this->getModel();
     $fields = array('car.catid', 'comp.id', 'comp.created_by');
     $dataFromIds = $model->getDataFromIds($ids, $fields);
     $params = JComponentHelper::getParams($this->option);
     $allowFeature = $params->get('allowFeature', 'state');
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
     }
     foreach ($ids as $i => $id) {
         $item = $dataFromIds[$id];
         if (!isset($item->catid)) {
             unset($ids[$i]);
             continue;
         }
         if ($allowFeature == 'superuser') {
             if ($isSuperUser) {
                 continue;
             } else {
                 $ids = NULL;
                 JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
                 break;
             }
         }
         if ($allowFeature == 'state') {
             list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('compromissos', $item);
             if (!$canChange) {
                 unset($ids[$i]);
                 JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
             }
         } else {
             if ($allowFeature == 'edit') {
                 //informacao canManage eh sobreposta por permissoes de edicao de proprios itens e a linha abaixo nao
                 if (!$user->authorise("core.edit", "com_agendadirigentes.category." . $item->catid)) {
                     unset($ids[$i]);
                     JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
                 }
             }
         }
     }
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Publish compromissos.
         if (!$model->featured($ids, $value)) {
             JError::raiseWarning(500, $model->getError());
         }
     }
     $this->setRedirect('index.php?option=com_agendadirigentes&view=compromissos');
 }
Exemplo n.º 13
0
 /**
  * Method to get the field input for a tag field.
  *
  * @return  string  The field input.
  *
  * @since   3.1
  */
 protected function getInput()
 {
     $componentParams = AgendaDirigentesHelper::getParams();
     // se campo for do tipo multipla escolha e permitir participantes locais
     // ou se campo for do tipo multipla escolha e permitir participantes externos
     // entao incluir script
     if ($this->getAttribute('multiple', false) == "true" && ($componentParams->get('permitir_participantes_locais', 1) == 1 || $componentParams->get('permitir_participantes_externos', 1) == 1)) {
         $id = isset($this->element['id']) ? $this->element['id'] : null;
         $cssId = '#' . $this->getId($id, $this->element['name']);
         $this->ajaxfieldCustomTag($cssId, 5, $componentParams->get('permitir_participantes_externos', 1) == 1 ? 'true' : 'false');
     }
     $input = parent::getInput();
     return $input;
 }
Exemplo n.º 14
0
/**
* @package PortalPadrao
* @subpackage com_agendadirigentes
*
* @copyright Copyright (C) 2005 - 2014 Joomla Calango. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// impedir acesso direto ao arquivo
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$this->sobreposicaoBloqueada = false;
foreach ($this->items as $i => $item) {
    list($canManage, $canChange) = AgendaDirigentesHelper::getGranularPermissions('cargos', $item);
    $allowFeature = $this->state->get('params')->get('allowFeature', 'state');
    $isSuperUser = AgendaDirigentesHelper::isSuperUser();
    ?>
        <tr class="row<?php 
    echo $i % 2;
    ?>
" sortable-group-id="<?php 
    echo $item->catid;
    ?>
">
                <td class="order nowrap center hidden-phone">
                    <?php 
    $iconClass = '';
    if (!$canChange) {
        $iconClass = ' inactive';
    } elseif (!$this->saveOrder) {
        $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
Exemplo n.º 15
0
<?php

/**
* @package PortalPadrao
* @subpackage com_agendadirigentes
*
* @copyright Copyright (C) 2005 - 2014 Joomla Calango. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// impedir acesso direto ao arquivo
defined('_JEXEC') or die('Restricted access');
// Access check: is this user allowed to access the backend of this component?
if (!JFactory::getUser()->authorise('core.manage', 'com_agendadirigentes')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// require helper file
JLoader::register('AgendaDirigentesHelper', JPATH_COMPONENT . '/helpers/agendadirigentes.php');
// Set some global property
$document = JFactory::getDocument();
$document->addStyleDeclaration('.icon-compromisso {background-image: url(../media/com_agendadirigentes/images/icon-calendar.png);}');
//verificacoes globais
AgendaDirigentesHelper::verifySearchPlugin();
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by AgendaDirigentes
$controller = JControllerLegacy::getInstance('AgendaDirigentes');
// Perform the Request task
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
// Redirect if set by the controller
$controller->redirect();