public function indexAction()
 {
     $batch = $this->loader->getTaskRunnerBatch('export_data');
     $batch->reset();
     $this->data['survey'] = $this->request->getParam('survey');
     parent::indexAction();
 }
 public function deleteAction()
 {
     $this->deleteParameters['resetRoute'] = true;
     $this->deleteParameters['deleteAction'] = 'delete';
     // Trick to not get aftersaveroute
     $this->deleteParameters['abortAction'] = 'index';
     $this->deleteParameters['afterSaveRouteUrl'] = array('action' => 'index', 'controller' => 'respondent-relation', \MUtil_Model::REQUEST_ID1 => $this->_getParam(\MUtil_Model::REQUEST_ID1), \MUtil_Model::REQUEST_ID2 => $this->_getParam(\MUtil_Model::REQUEST_ID2));
     parent::deleteAction();
 }
 /**
  * Function to allow the creation of search defaults in code
  *
  * @see getSearchFilter()
  *
  * @return array
  */
 public function getSearchDefaults()
 {
     if (!$this->defaultSearchData) {
         $orgId = $this->currentOrganization->getId();
         $this->defaultSearchData[-1] = "gtr_organizations LIKE '%|{$orgId}|%'";
     }
     return parent::getSearchDefaults();
 }
 /**
  * Returns the on empty texts for the autofilter snippets
  *
  * @static boolean $warned Listen very closely. I shall tell this only once!
  * @return string
  */
 public function getOnEmptyText()
 {
     static $warned;
     $dir = $this->getPath(false, 'index');
     if (!is_dir($dir)) {
         try {
             \MUtil_File::ensureDir($dir);
         } catch (\Zend_Exception $e) {
             $text = $e->getMessage();
             if (!$warned) {
                 $warned = true;
                 $this->addMessage($text);
             }
             return $text;
         }
     }
     return parent::getOnEmptyText();
 }
 public function showAction()
 {
     parent::showAction();
     $id = $this->getRequest()->getParam('id');
     if (!is_null($id)) {
         $id = (int) $id;
         $job = $this->db->fetchRow("SELECT * FROM gems__comm_jobs WHERE gcj_active = 1 and gcj_id_job = ?", $id);
         if ($job) {
             $model = $this->loader->getTracker()->getTokenModel();
             $filter = $this->loader->getUtil()->getDbLookup()->getFilterForMailJob($job);
             $params['model'] = $model;
             $params['filter'] = $filter;
             $this->addSnippet('TokenPlanTableSnippet', $params);
         }
     }
 }
Exemplo n.º 6
0
 /**
  * Get the filter to use with the model for searching
  *
  * @param boolean $useRequest Use the request as source (when false, the session is used)
  * @return array or false
  */
 public function getSearchFilter($useRequest = true)
 {
     $filter = parent::getSearchFilter($useRequest);
     $where = \Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($filter, $this->db);
     if ($where) {
         $filter[] = $where;
     }
     return $filter;
 }
 /**
  * Outputs the model to excel, applying all filters and searches needed
  *
  * When you want to change the output, there are two places to check:
  *
  * 1. $this->addExcelColumns($model), where the model can be changed to have labels for columns you
  * need exported
  *
  * 2. $this->getExcelData($data, $model) where the supplied data and model are merged to get output
  * (by default all fields from the model that have a label)
  */
 public function excelAction()
 {
     $model = $this->getModel();
     $model->set('gr2t_id_respondent_track', 'label', 'attribute_4', 'order', '5');
     foreach ($model->getColNames('has_orig') as $name) {
         $model->set($name . '_orig', 'label', $model->get($name, 'label') . ' {RAW]');
     }
     return parent::excelAction();
 }
 /**
  * Get the filter to use with the model for searching including model sorts, etc..
  *
  * @param boolean $useRequest Use the request as source (when false, the session is used)
  * @return array or false
  */
 public function getSearchFilter($useRequest = true)
 {
     $filter = parent::getSearchFilter($useRequest);
     if (array_key_exists('status', $filter)) {
         switch ($filter['status']) {
             case 'sok':
                 $filter['gsu_active'] = 0;
                 $filter[] = "(gsu_status IS NULL OR LENGTH(gsu_status) = 0)";
                 break;
             case 'nok':
                 $filter[] = "(gsu_status IS NOT NULL AND gsu_status NOT IN ('', 'OK'))";
                 break;
             case 'act':
                 $filter['gsu_active'] = 1;
                 // default:
         }
         unset($filter['status']);
     }
     return $filter;
 }
 /**
  * Function to allow the creation of search defaults in code
  *
  * @see getSearchFilter()
  *
  * @return array
  */
 public function getSearchDefaults()
 {
     if (!$this->defaultSearchData) {
         $orgId = $this->currentOrganization->getId();
         $this->defaultSearchData[-1] = "((gsu_insertable = 1 AND gsu_insert_organizations LIKE '%|{$orgId}|%') OR\r\n                EXISTS\r\n                (SELECT gro_id_track FROM gems__tracks INNER JOIN gems__rounds ON gtr_id_track = gro_id_track\r\n                    WHERE gro_id_survey = gsu_id_survey AND gtr_organizations LIKE '%|{$orgId}|%'\r\n                    ))";
     }
     return parent::getSearchDefaults();
 }
Exemplo n.º 10
0
 /**
  * Get the filter to use with the model for searching including model sorts, etc..
  *
  * @param boolean $useRequest Use the request as source (when false, the session is used)
  * @return array or false
  */
 public function getSearchFilter($useRequest = true)
 {
     $filter = parent::getSearchFilter($useRequest);
     if (!(isset($filter['gsf_id_organization']) && $filter['gsf_id_organization'])) {
         $filter['gsf_id_organization'] = array_keys($this->currentUser->getAllowedOrganizations());
     }
     return $filter;
 }
 /**
  * Default overview action
  */
 public function indexAction()
 {
     if ($this->checkForAnswersOnLoad) {
         $this->loader->getTracker()->processCompletedTokens(null, $this->currentUser->getUserId(), $this->currentUser->getCurrentOrganizationId(), true);
     }
     parent::indexAction();
 }
 /**
  * Action for showing a browse page
  */
 public function indexAction()
 {
     parent::indexAction();
     $this->html->pInfo($this->getModel()->get('gapr_name', 'description'));
 }
    /**
     * Action for showing a browse page
     */
    public function indexAction()
    {
        parent::indexAction();
        $this->html->pInfo($this->_('A location is a combination of a geographic location and an organization.
 Two organizations sharing a geographic location still need a location item for each organization.'));
    }
Exemplo n.º 14
0
 /**
  * Action for showing a edit item page with extra title
  */
 public function editAction()
 {
     $model = $this->getModel();
     $data = $model->loadFirst();
     //If we try to edit master, add an error message and reroute
     if (isset($data['grl_name']) && $data['grl_name'] == 'master') {
         $this->addMessage($this->_('Editing `master` is not allowed'));
         $this->_reroute(array('action' => 'index'), true);
     }
     parent::editAction();
 }
 /**
  * Get the filter to use with the model for searching
  *
  * @param boolean $useRequest Use the request as source (when false, the session is used)
  * @return array or false
  */
 public function getSearchFilter($useRequest = true)
 {
     $filter = parent::getSearchFilter($useRequest);
     $where = \Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($filter, $this->db, $this->getDateFormat(), 'yyyy-MM-dd HH:mm:ss');
     if ($where) {
         $filter[] = $where;
     }
     return $filter;
 }
 public function showAction()
 {
     $model = $this->getModel();
     $data = $model->loadFirst();
     if ($data) {
         $this->_setMenuParameters($data);
     }
     parent::showAction();
 }