/**
  * Returns a text element for autosearch. Can be overruled.
  *
  * The form / html elements to search on. Elements can be grouped by inserting null's between them.
  * That creates a distinct group of elements
  *
  * @param array $data The $form field values (can be usefull, but no need to set them)
  * @return array Of \Zend_Form_Element's or static tekst to add to the html or null for group breaks.
  */
 protected function getAutoSearchElements(array $data)
 {
     $elements = parent::getAutoSearchElements($data);
     if ($elements) {
         $elements[] = null;
         // break into separate spans
     }
     if ($this->periodSelector) {
         $dates = array('_gto_valid_from gto_valid_until' => $this->_('Is valid during'), '-gto_valid_from gto_valid_until' => $this->_('Is valid within'), 'gto_valid_from' => $this->_('Valid from'), 'gto_valid_until' => $this->_('Valid until'), 'gto_mail_sent_date' => $this->_('E-Mailed on'), 'gto_completion_time' => $this->_('Completion date'));
         $this->_addPeriodSelectors($elements, $dates);
         $elements[] = null;
         // break into separate spans
     }
     $allowedOrgs = $this->getOrganizationList($data);
     $orgWhere = "(INSTR(gtr_organizations, '|" . implode("|') > 0 OR INSTR(gtr_organizations, '|", array_keys($allowedOrgs)) . "|') > 0)";
     $elements[] = $this->_('Select:');
     $elements[] = \MUtil_Html::create('br');
     // Add track selection
     if ($this->multiTracks) {
         $elements[] = $this->_createSelectElement('gto_id_track', $this->getAllTrackTypes($orgWhere, $data), $this->_('(all tracks)'));
     }
     $elements[] = $this->_createSelectElement('gto_round_description', $this->getAllTrackRounds($orgWhere, $data), $this->_('(all rounds)'));
     $elements[] = $this->_createSelectElement('gto_id_survey', $this->getAllSurveys($orgWhere, $data), $this->_('(all surveys)'));
     $options = array('all' => $this->_('(all actions)'), 'open' => $this->_('Open'), 'notmailed' => $this->_('Not emailed'), 'tomail' => $this->_('To email'), 'toremind' => $this->_('Needs reminder'), 'hasnomail' => $this->_('Missing email'), 'toanswer' => $this->_('Yet to Answer'), 'answered' => $this->_('Answered'), 'missed' => $this->_('Missed'), 'removed' => $this->_('Removed'));
     $elements[] = $this->_createSelectElement('main_filter', $options);
     $elements[] = $this->_createSelectElement('gsu_id_primary_group', $this->getAllGroups($orgWhere, $data), $this->_('(all fillers)'));
     // Select organisation
     if (count($allowedOrgs) > 1) {
         $elements[] = $this->_createSelectElement('gto_id_organization', $allowedOrgs, $this->_('(all organizations)'));
     }
     $elements[] = $this->_createSelectElement('gr2t_created_by', $this->getAllCreators($allowedOrgs, $data), $this->_('(all staff)'));
     return $elements;
 }
 /**
  * Returns a text element for autosearch. Can be overruled.
  *
  * The form / html elements to search on. Elements can be grouped by inserting null's between them.
  * That creates a distinct group of elements
  *
  * @param array $data The $form field values (can be usefull, but no need to set them)
  * @return array Of \Zend_Form_Element's or static tekst to add to the html or null for group breaks.
  */
 protected function getAutoSearchElements(array $data)
 {
     $elements = parent::getAutoSearchElements($data);
     $this->_addPeriodSelectors($elements, 'gla_created');
     $elements[] = null;
     $elements[] = $this->_('Specific action');
     $sql = "SELECT gls_id_action, gls_name\n                    FROM gems__log_setup\n                    WHERE gls_when_no_user = 1 OR gls_on_action = 1 OR gls_on_change = 1 OR gls_on_post = 1\n                    ORDER BY gls_name";
     $elements[] = $this->_createSelectElement('gla_action', $sql, $this->_('(any action)'));
     $elements[] = $this->_createSelectElement('gla_organization', $this->loader->getCurrentUser()->getAllowedOrganizations(), $this->_('(all organizations)'));
     return $elements;
 }
 /**
  * Returns a text element for autosearch. Can be overruled.
  *
  * The form / html elements to search on. Elements can be grouped by inserting null's between them.
  * That creates a distinct group of elements
  *
  * @param array $data The $form field values (can be usefull, but no need to set them)
  * @return array Of \Zend_Form_Element's or static tekst to add to the html or null for group breaks.
  */
 protected function getAutoSearchElements(array $data)
 {
     // Search text
     $elements = parent::getAutoSearchElements($data);
     $this->_addPeriodSelectors($elements, array('grco_created' => $this->_('Date sent')));
     $br = \MUtil_Html::create()->br();
     $elements[] = null;
     $dbLookup = $this->util->getDbLookup();
     $elements[] = $this->_createSelectElement('gto_id_track', $this->getRespondentTrackNames(), $this->_('(select a track)'));
     $elements[] = $this->_createSelectElement('gto_id_survey', $this->getRespondentSurveyNames(), $this->_('(select a survey)'));
     $elements[] = $this->_createSelectElement('status', $this->util->getTokenData()->getEveryStatus(), $this->_('(select a status)'));
     return $elements;
 }