Controller for editing respondent tracks, including their tokens

package Gems
subpackage Default
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.0
inherited_from \Gems_Default_RespondentChildActionAbstract

 Methods

Pops the answers to a survey in a separate window

answerAction() 

Export a single token

answerExportAction() 

The automatically filtered result

autofilterAction($resetMvc = true
Inherited

Parameters

$resetMvc

When true only the filtered resulsts

Check the tokens for a single respondent

checkAllAnswersAction() 

Action for checking all assigned rounds for this respondent using a batch

checkAllTracksAction() 

Check the tokens for a single token

checkTokenAnswersAction() 

Action for checking all assigned rounds for a single respondent track using a batch

checkTrackAction() 

Check the tokens for a single track

checkTrackAnswersAction() 

Action for showing a create new item page

createAction() 

Uses separate createSnippets instead of createEditSnipppets

Action for showing a create new item page with extra title

createAction() 
Inherited

Action for showing a deactivate item page with extra titles

deactivateAction() 
Inherited

Delete a single token

deleteAction() 

Action for showing a delete item page with extra titles

deleteAction() 
Inherited

Delete a track

deleteTrackAction() 

Edit single token

editAction() 

Action for showing a edit item page with extra title

editAction() 
Inherited

Edit the respondent track data

editTrackAction() 

Email the user

emailAction() 

Outputs the model to excel, applying all filters and searches needed

excelAction() 
Inherited

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)

Export model data

exportAction() 
Inherited

Export a single track

exportTrackAction() 

Helper function to get the title for the create action.

getCreateTitle() : \$string
Inherited

Returns

\$string

Helper function to get the question for the deactivate action.

getDeactivateQuestion() : \$string
Inherited

Returns

\$string

Helper function to get the title for the deactivate action.

getDeactivateTitle() : \$string
Inherited

Returns

\$string

Name of the default import translator

getDefaultImportTranslator() : string
Inherited

Returns

string

Helper function to get the question for the delete action.

getDeleteQuestion() : \$string
Inherited

Returns

\$string

Helper function to get the title for the delete action.

getDeleteTitle() : \$string
Inherited

Returns

\$string

Helper function to get the title for the edit action.

getEditTitle() : \$string
Inherited

Returns

\$string

The directory to use for temporary storage

getImportTempDirectory() : string
Inherited

Returns

string

Get the possible translators for the import snippet.

getImportTranslators() : array
Inherited

Returns

arrayof \MUtil_Model_ModelTranslatorInterface objects

Get an Importer object for this actions

getImporter() : \MUtil_Model_Importer
Inherited

Returns

\MUtil_Model_Importer

Helper function to get the title for the index action.

getIndexTitle() : \$string

Returns

\$string

Helper function to get the title for the index action.

getIndexTitle() : \$string
Inherited

Returns

\$string

Return the current request ID, if any.

getInstanceId() : mixed
Inherited

Overrule this function if the last item in the page title should be something other than te value of \MUtil_Model::REQUEST_ID.

Returns

mixed

Returns the on empty texts for the autofilter snippets

getOnEmptyText() : string
Inherited

Returns

string

Helper function to get the question for the reactivate action.

getReactivateQuestion() : \$string
Inherited

Returns

\$string

Helper function to get the title for the reactivate action.

getReactivateTitle() : \$string
Inherited

Returns

\$string

Get filter for current respondent

getRespondentFilter() : array

Returns

array

Retrieve the respondent id (So we don't need to repeat that for every snippet.)

getRespondentId() : integer
Inherited

Returns

integer

Retrieve the respondent track (So we don't need to repeat that for every snippet.)

getRespondentTrack() : \Gems_Tracker_RespondentTrack

Returns

\Gems_Tracker_RespondentTrack

Retrieve the respondent track ID (So we don't need to repeat that for every snippet.)

getRespondentTrackId() : integer

Returns

integer

Helper function to get the title for the show action.

getShowTitle() : \$string
Inherited

Returns

\$string

Retrieve the survey ID

getSurveyId() : integer

Returns

integer

Returns the current html/head/title for this page.

getTitle(string $separator = null) : string
Inherited

If the title is an array the seperator concatenates the parts.

Parameters

$separator

string

Returns

string

Retrieve the token

getToken() : \Gems_Tracker_Token

Returns

\Gems_Tracker_Token

Retrieve the token ID

getTokenId() : string

Returns

string

Helper function to allow generalized statements about the items in the model.

getTokenTopic(integer $count = 1) : \$string

Parameters

$count

integer

Returns

\$string

getTokenTopicCallable()

getTokenTopicCallable() : callable

Returns

callableGet the getTokenTopic function as a callable

Helper function to allow generalized statements about the items in the model.

getTopic(integer $count = 1) : \$string

Parameters

$count

integer

Returns

\$string

Helper function to allow generalized statements about the items in the model.

getTopic(integer $count = 1) : \$string
Inherited

Parameters

$count

integer

Returns

\$string

Get a callable for the gettopic function

getTopicCallable() : callable
Inherited

Returns

callable

Retrieve the track engine

getTrackEngine() : \Gems_Tracker_Engine_TrackEngineInterface

Returns

\Gems_Tracker_Engine_TrackEngineInterface

Retrieve the track ID

getTrackId() : integer

Returns

integer

Generic model based import action

importAction() 
Inherited

Action for showing a browse page

indexAction() 
Inherited

Initialize translate and html objects

init() : void

Called from __construct() as final step of object instantiation.

Intializes the html component.

initHtml(boolean $reset = false) : void
Inherited

Parameters

$reset

boolean

Throws away any existing html output when true

Insert a single survey into a track

insertAction() 

Pops a PDF - if it exists

pdfAction() 

Shows the questions in a survey

questionsAction() 

Action for showing a reactivate item page with extra titles

reactivateAction() 
Inherited

Action for checking all assigned rounds using a batch

recalcAllFieldsAction() 

Action for checking all assigned rounds for a single track using a batch

recalcFieldsAction() 

Show a single token, mind you: it can be a SingleSurveyTrack

showAction() 

Action for showing an item page with title

showAction() 
Inherited

Show information on a single track assigned to a respondent

showTrackAction() 

Delete a single token

undeleteAction() 

Undelete a track

undeleteTrackAction() 

Show information on a single track type assigned to a respondent

viewAction() 

Used in AddTracksSnippet to show a preview for an insertable survey

viewSurveyAction() 

Creates a model for getModel(). Called only for each new $action.

createModel(boolean $detailed, string $action) : \MUtil_Model_ModelAbstract

The parameters allow you to easily adapt the model to the current action. The $detailed parameter was added, because the most common use of action is a split between detailed and summarized actions.

Parameters

$detailed

boolean

True when the current action is not in $summarizedActions.

$action

string

The current action.

Returns

\MUtil_Model_ModelAbstract

Finds the first item with one of the actions specified as parameter and using the current controller

firstAllowedMenuItem(string $action, string $action2 = null) : \Gems_Menu_SubMenuItem
Inherited

Parameters

$action

string

$action2

string

Returns

\Gems_Menu_SubMenuItem

Get the title for creating a track

getCreateTrackTitle() : string

Returns

string

Get the title for editing a track

getEmailTokenTitle() : string

Returns

string

Returns an array with all columns from the model that have a label

getExcelData(array $data, \MUtil_Model_ModelAbstract $model) : array
Inherited

Parameters

$data

array

$model

\MUtil_Model_ModelAbstract

Returns

array

Get the model for export and have the option to change it before using for export

getExportModel() : 
Inherited

Returns

Get the title for creating a track

getInsertInTrackTitle() : string

Returns

string

Get the respondent object

getRespondent() : \Gems_Tracker_Respondent
Inherited

Returns

\Gems_Tracker_Respondent

Get the title describing the token

getTokenTitle() : string

Returns

string

Get the title describing the track

getTrackTitle() : string

Returns

string

Get the view

getView() : \Zend_View_Interface

Returns

\Zend_View_Interface

Get the title for viewing track usage

getViewTrackTitle() : string

Returns

string

isMultiTracks()

isMultiTracks() : boolean
Inherited

Returns

boolean

isTemplateOnly()

isTemplateOnly() : boolean

Returns

boolean

Stub for overruling default snippet loader initiation.

loadSnippetLoader() 
Inherited

 Properties

 

$accesslog

$accesslog : \Gems_AccessLog

Default

 

$currentUser

$currentUser : \Gems_User_User

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

$escort

$escort : \GemsEscort

Default

 

Should Excel output contain formatted data (date fields, select lists)

$formatExcelData : boolean

Default

true
 

$loader

$loader : \Gems_Loader

Default

 

$menu

$menu : \Gems_Menu

Default

 

Array of the actions that use a summarized version of the model.

$summarizedActions : array

Default

array('index', 'autofilter', 'create', 'view', 'view-survey')

This determines the value of $detailed in createAction(). As it is usually less of a problem to use a $detailed model with an action that should use a summarized model and I guess there will usually be more detailed actions than summarized ones it seems less work to specify these.

 

$util

$util : \Gems_Util

Default

 

The parameters used for the answer export action.

$answerExportParameters : array

Default

array('formTitle' => 'getTokenTitle', 'hideGroup' => true)
 

This snippets for answer export

$answerExportSnippets : mixed

Default

array('Export\\RespondentExportSnippet')
 

The parameters used for the answers action.

$answerParameters 

Default

array()

Currently filled from $defaultTokenParameters

 

The parameters used for the autofilter action.

$autofilterParameters : array

Default

array('extraFilter' => 'getRespondentFilter', 'menuEditActions' => array('edit-track'), 'menuShowActions' => array('show-track'))

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

The snippets used for the autofilter action.

$autofilterSnippets : mixed

Default

array('ModelTableSnippetGeneric', 'Tracker\\Buttons\\TrackIndexButtonRow', 'Tracker\\AvailableTracksSnippet')
 

The snippets used for the autofilter action.

$autofilterSnippets : mixed

Default

'ModelTableSnippetGeneric'
 

The snippets used for the create and edit actions.

$createEditSnippets : mixed

Default

'ModelFormSnippetGeneric'
 

The parameters used for the edit actions, overrules any values in $this->createEditParameters.

$createParameters : array

Default

array('createData' => true, 'formTitle' => 'getCreateTrackTitle', 'multiTracks' => 'isMultiTracks', 'trackEngine' => 'getTrackEngine')

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

This action uses a different snippet order during create

$createSnippets : mixed

Default

array('Tracker\\TrackUsageOverviewSnippet', 'Tracker\\TrackUsageTextDetailsSnippet', 'Tracker\\EditTrackSnippet', 'Tracker\\TrackSurveyOverviewSnippet')
 

Model level parameters used for all actions, overruled by any values set in any other parameters array except the private $_defaultParamters values in this module.

$defaultParameters : array

Default

array('multiTracks' => 'isMultiTracks', 'respondent' => 'getRespondent')

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

The default parameters used for any token action like answers or sho0w

$defaultTokenParameters : array

Default

array('model' => null, 'respondent' => null, 'token' => 'getToken', 'tokenId' => 'getTokenId')

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

The parameters used for the delete action.

$deleteParameters : array

Default

array('formTitle' => null, 'topicCallable' => 'getTokenTopicCallable')

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

The snippets used for the delete action.

$deleteSnippets : mixed

Default

'ModelItemYesNoDeleteSnippetGeneric'
 

The parameters used for the edit track action.

$deleteTrackParameters : array

Default

array('formTitle' => null, 'multiTracks' => 'isMultiTracks', 'respondentTrack' => 'getRespondentTrack', 'respondentTrackId' => 'getRespondentTrackId', 'topicCallable' => 'getTopicCallable', 'trackEngine' => 'getTrackEngine', 'trackId' => 'getTrackId')
 

Snippets for deleting tracks

$deleteTrackSnippets : mixed

Default

array('Tracker\\DeleteTrackSnippet', 'Tracker\\TrackTokenOverviewSnippet', 'Tracker\\TrackUsageOverviewSnippet')
 

The parameters used for the edit track action.

$editTrackParameters : array

Default

array('createData' => false, 'formTitle' => 'getTrackTitle', 'multiTracks' => 'isMultiTracks', 'respondentTrack' => 'getRespondentTrack', 'respondentTrackId' => 'getRespondentTrackId', 'trackEngine' => 'getTrackEngine', 'trackId' => 'getTrackId')
 

Snippets for editing tracks

$editTrackSnippets : mixed

Default

array('Tracker\\EditTrackSnippet', 'Tracker\\TrackUsageTextDetailsSnippet', 'Tracker\\TrackTokenOverviewSnippet', 'Tracker\\TrackUsageOverviewSnippet')
 

The parameters used for the email action.

$emailParameters 

Default

array('formTitle' => 'getEmailTokenTitle', 'identifier' => '_getIdParam', 'mailTarget' => 'token', 'routeAction' => 'show', 'templateOnly' => 'isTemplateOnly', 'view' => 'getView')

Currently mostly filled from $defaultTokenParameters

 

Snippets used for emailing

$emailSnippets : mixed

Default

array('Mail_TokenMailFormSnippet')
 

$exportFormSnippets

$exportFormSnippets 

Default

'Export\\ExportFormSnippet'
 

The parameters used for the export track action.

$exportTrackParameters : array

Default

array('formTitle' => 'getTrackTitle', 'respondentTrack' => 'getRespondentTrack')
 

This snippets for track export

$exportTrackSnippets : mixed

Default

array('Export\\RespondentExportSnippet')
 

The parameters used for the import action

$importParameters : array

Default

array('respondent' => null)

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

The snippets used for the index action, before those in autofilter

$indexStartSnippets : mixed

Default

array('Generic\\ContentTitleSnippet', 'AutosearchFormSnippet')
 

The snippets used for the index action, after those in autofilter

$indexStopSnippets : mixed

Default

'Generic\\CurrentSiblingsButtonRowSnippet'
 

The parameters used for the insert action.

$insertParameters : array

Default

array('createData' => true, 'formTitle' => 'getInsertInTrackTitle', 'model' => null, 'surveyId' => 'getSurveyId')
 

Snippets used for inserting a survey

$insertSnippets : mixed

Default

array('Tracker\\InsertSurveySnippet')
 

The parameters used for the questions action.

$questionsParameters 

Default

array('surveyId' => 'getSurveyId')

Currently mostly filled from $defaultTokenParameters

 

Snippets used for showing survey questions

$questionsSnippets : mixed

Default

array('Survey\\SurveyQuestionsSnippet', 'Tracker\\Buttons\\TokenActionButtonRow')
 

The snippets used for the show action

$showSnippets : mixed

Default

array('Generic\\ContentTitleSnippet', 'ModelItemTableSnippetGeneric')
 

The parameters used for the edit track action.

$showTrackParameters : array

Default

array('contentTitle' => 'getTrackTitle', 'multiTracks' => 'isMultiTracks', 'respondentTrack' => 'getRespondentTrack', 'respondentTrackId' => 'getRespondentTrackId', 'displayMenu' => false, 'trackEngine' => 'getTrackEngine', 'trackId' => 'getTrackId')
 

This action uses a different snippet order during create

$showTrackSnippets : mixed

Default

array('Generic\\ContentTitleSnippet', 'Tracker\\SingleSurveyAvailableTracksSnippet', 'ModelItemTableSnippetGeneric', 'Tracker\\Buttons\\TrackActionButtonRow', 'Tracker\\TrackUsageTextDetailsSnippet', 'Tracker\\TrackTokenOverviewSnippet', 'Tracker\\TrackUsageOverviewSnippet')
 

The actions that should result in the survey return being set.

$tokenReturnActions : array

Default

array('index', 'show', 'show-track')
 

The parameters used for the edit actions, overrules any values in $this->createEditParameters.

$viewParameters : array

Default

array('contentTitle' => 'getViewTrackTitle', 'multiTracks' => 'isMultiTracks', 'trackEngine' => 'getTrackEngine', 'trackId' => 'getTrackId')

When the value is a function name of that object, then that functions is executed with the array key as single parameter and the return value is set as the used value

  • unless the key is an integer in which case the code is executed but the return value is not stored.
 

This action uses a different snippet order during create

$viewSnippets : mixed

Default

array('Tracker\\TrackUsageTextDetailsSnippet', 'Generic\\ContentTitleSnippet', 'Tracker\\TrackUsageOverviewSnippet', 'Tracker\\Buttons\\TrackActionButtonRow', 'Tracker\\TrackSurveyOverviewSnippet')
 

The parameters used for the viewSurveys action.

$viewSurveyParameters 

Default

array('surveyId' => 'getSurveyId')
 

Snippets used for showing survey questions

$viewSurveySnippets : mixed

Default

array('Survey\\SurveyQuestionsSnippet')
 

Gems only parameters used for the autofilter action. Can be overruled by setting $this->autofilterParameters

$_autofilterExtraParameters : array

Default

array('browse' => true, 'containingId' => 'autofilter_target', 'keyboard' => true, 'onEmpty' => 'getOnEmptyText', 'sortParamAsc' => 'asrt', 'sortParamDesc' => 'dsrt')
 

Gems only parameters used for the create action. Can be overruled by setting $this->createParameters or $this->createEditParameters

$_createExtraParameters : array

Default

array('formTitle' => 'getCreateTitle', 'topicCallable' => 'getTopicCallable')
 

Gems only parameters used for the deactivate action. Can be overruled by setting $this->deactivateParameters

$_deactivateExtraParameters : array

Default

array('confirmQuestion' => 'getDeactivateQuestion', 'displayTitle' => 'getDeactivateTitle', 'formTitle' => 'getDeactivateTitle', 'topicCallable' => 'getTopicCallable')
 

Gems only parameters used for the delete action. Can be overruled by setting $this->deleteParameters

$_deleteExtraParameters : array

Default

array('deleteQuestion' => 'getDeleteQuestion', 'displayTitle' => 'getDeleteTitle', 'formTitle' => 'getDeleteTitle', 'topicCallable' => 'getTopicCallable')
 

Gems only parameters used for the edit action. Can be overruled by setting $this->editParameters or $this->createEditParameters

$_editExtraParameters : array

Default

array('formTitle' => 'getEditTitle', 'topicCallable' => 'getTopicCallable')
 

Gems only parameters used for the import action. Can be overruled by setting $this->inmportParameters

$_importExtraParameters : array

Default

array('formatBoxClass' => 'browser table', 'importer' => 'getImporter', 'tempDirectory' => 'getImportTempDirectory', 'topicCallable' => 'getTopic')
 

Gems only parameters used for the deactivate action. Can be overruled by setting $this->deactivateParameters

$_reactivateExtraParameters : array

Default

array('confirmQuestion' => 'getReactivateQuestion', 'displayTitle' => 'getReactivateTitle', 'formTitle' => 'getReactivateTitle', 'topicCallable' => 'getTopicCallable')
 

$_respondent

$_respondent : \Gems_Tracker_Respondent

Default