protected function getDateOptionsFor($sourceType, $roundId, $language, $validAfter)
    {
        switch ($sourceType) {
            case self::NO_TABLE:
                return array();

            case self::ANSWER_TABLE:
                if (! isset($this->_rounds[$roundId], $this->_rounds[$roundId]['gro_id_survey'])) {
                    return array();
                }
                $surveyId = $this->_rounds[$roundId]['gro_id_survey'];
                $survey = $this->tracker->getSurvey($surveyId);
                return $survey->getDatesList($language);

            case self::APPOINTMENT_TABLE:
                return $this->_fieldsDefinition->getFieldLabelsOfType(FieldsDefinition::TYPE_APPOINTMENT);

            case self::RESPONDENT_TRACK_TABLE:
                $results = array(
                    'gr2t_start_date' => $this->_('Track start'),
                    'gr2t_end_date'   => $this->_('Track end'),
                    // 'gr2t_created'    => $this->_('Track created'),
                );

                return $results + $this->_fieldsDefinition->getFieldLabelsOfType(array(
                    FieldsDefinition::TYPE_DATE,
                    FieldsDefinition::TYPE_DATETIME,
                    ));

            case self::TOKEN_TABLE:
                return array(
                    'gto_valid_from'      => $this->_('Valid from'),
                    'gto_valid_until'     => $this->_('Valid until'),
                    'gto_start_time'      => $this->_('Start time'),
                    'gto_completion_time' => $this->_('Completion date'),
                    );

        }
    }
protected function getDateOptionsFor($sourceType, $roundId, $language, $validAfter)
    {
        switch ($sourceType) {
            case self::NO_TABLE:
                return array();

            case self::ANSWER_TABLE:
                if (! isset($this->_rounds[$roundId], $this->_rounds[$roundId]['gro_id_survey'])) {
                    return array();
                }
                $surveyId = $this->_rounds[$roundId]['gro_id_survey'];
                $survey = $this->tracker->getSurvey($surveyId);
                return $survey->getDatesList($language);

            case self::APPOINTMENT_TABLE:
                return $this->_fieldsDefinition->getFieldLabelsOfType(FieldsDefinition::TYPE_APPOINTMENT);

            case self::RESPONDENT_TRACK_TABLE:
                $results = array(
                    'gr2t_start_date' => $this->_('Track start'),
                    'gr2t_end_date'   => $this->_('Track end'),
                    // 'gr2t_created'    => $this->_('Track created'),
                );

                return $results + $this->_fieldsDefinition->getFieldLabelsOfType(array(
                    FieldsDefinition::TYPE_DATE,
                    FieldsDefinition::TYPE_DATETIME,
                    ));

            case self::TOKEN_TABLE:
                return array(
                    'gto_valid_from'      => $this->_('Valid from'),
                    'gto_valid_until'     => $this->_('Valid until'),
                    'gto_start_time'      => $this->_('Start time'),
                    'gto_completion_time' => $this->_('Completion date'),
                    );

        }
    }
protected function getDateOptionsFor ( $ sourceType , $ roundId , $ language , $ validAfter ) { switch ( $ sourceType ) { case self :: NO_TABLE : return array ( ) ; case self :: ANSWER_TABLE : if ( ! isset ( $ this -> _rounds [ $ roundId ] , $ this -> _rounds [ $ roundId ] [ 'gro_id_survey' ] ) ) { return array ( ) ; } $ surveyId = $ this -> _rounds [ $ roundId ] [ 'gro_id_survey' ] ; $ survey = $ this -> tracker -> getSurvey ( $ surveyId ) ; return $ survey -> getDatesList ( $ language ) ; case self :: APPOINTMENT_TABLE : return $ this -> _fieldsDefinition -> getFieldLabelsOfType ( FieldsDefinition :: TYPE_APPOINTMENT ) ; case self :: RESPONDENT_TRACK_TABLE : $ results = array ( 'gr2t_start_date' => $ this -> _ ( 'Track start' ) , 'gr2t_end_date' => $ this -> _ ( 'Track end' ) , // 'gr2t_created'    => $this->_('Track created'), ) ; return $ results + $ this -> _fieldsDefinition -> getFieldLabelsOfType ( array ( FieldsDefinition :: TYPE_DATE , FieldsDefinition :: TYPE_DATETIME , ) ) ; case self :: TOKEN_TABLE : return array ( 'gto_valid_from' => $ this -> _ ( 'Valid from' ) , 'gto_valid_until' => $ this -> _ ( 'Valid until' ) , 'gto_start_time' => $ this -> _ ( 'Start time' ) , 'gto_completion_time' => $ this -> _ ( 'Completion date' ) , ) ; } }
Returns the date fields selectable using the current source

@param string $source The date list source as defined by this object
@param int $roundId  Gems round id
@param string $language   (ISO) language string
@param boolean $validAfter True if it concenrs _valid_after_ dates
@return type
Returns the date fields selectable using the current source