Adds Gems specific display details and helper functions:

Items set are: = Default route: 'show'

  • Display class: 'formTable'
  • \Gems_Form use: createForm()
  • Table display: beforeDispay()

Extra helpers are:

  • Form title: getTitle()
  • Menu helpers: $this->menu, beforeDispay() & getMenuList()
package Gems
subpackage Snippets_Tracker
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.7.1 23-apr-2015 12:34:48
inherited_from \Gems_Snippets_ModelFormSnippetAbstract

 Methods

Adds one or more messages to the session based message store.

addMessageInvalid(mixed $message_args) : \Gems\Snippets\Tracker\InsertSurveySnippet
fluent This method is part of a fluent interface and will return the same instance

Parameters

$message_args

mixed

Can be an array or multiple argemuents. Each sub element is a single message string

Returns

\Gems\Snippets\Tracker\InsertSurveySnippet(continuation pattern)

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
inherited_from \Gems_Snippets_ModelFormSnippetAbstract::afterRegistry()

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

Perform some actions on the form, right before it is displayed but already populated

beforeDisplay() : \Zend_Form
Inherited

Here we add the table display to the form.

Returns

\Zend_Form

Should be called after answering the request to allow the Target to check if all required registry values have been set correctly.

checkRegistryRequestsAnswers() : boolean
Inherited

Returns

booleanFalse if required are missing.

Create the snippets content

getHtmlOutput(\Zend_View_Abstract $view) : \MUtil_Html_HtmlInterface
Inherited

This is a stub function either override getHtmlOutput() or override render()

Parameters

$view

\Zend_View_Abstract

Just in case it is needed here

Returns

\MUtil_Html_HtmlInterfaceSomething that can be rendered

Helper function to allow generalized statements about the items in the model to used specific item names.

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

Parameters

$count

integer

Returns

\$string

Adds elements from the model to the bridge that creates the form.

addFormElements(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 
Inherited

Overrule this function to add different elements to the browse table, without having to recode the core table building code.

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Simple default function for making sure there is a $this->_saveButton.

addSaveButton() 
Inherited

As the save button is not part of the model - but of the interface - it does deserve it's own function.

Hook that allows actions when data was saved

afterSave(integer $changed) 
Inherited

When not rerouted, the form will be populated afterwards

Parameters

$changed

integer

The number of changed rows (0 or 1 usually, but can be more)

Creates an empty form. Allows overruling in sub-classes.

createForm(mixed $options = null) : \Zend_Form
Inherited

Parameters

$options

mixed

Returns

\Zend_Form

Creates the model

createModel() : \MUtil_Model_ModelAbstract

Returns

\MUtil_Model_ModelAbstract

overrule to add your own buttons.

getMenuList() : \Gems_Menu_MenuList
Inherited

Returns

\Gems_Menu_MenuList

Get a select with the fields: - round_order: The gto_round_order to use for this round - has_group: True when has surveys for same group as current survey - group_answered: True when has answers for same group as current survey - any_answered: True when has answers for any survey - round_description: The gto_round_description for the round

getRoundSelect() : \Zend_Db_Select

Returns

\Zend_Db_Selector you can return a nested array containing said output/

Get the list of rounds and set the default

getRoundsListAndSetDefault() : array

Returns

array[roundInsertNr => RoundDescription

Retrieve the header title to display

getTitle() : string
Inherited

Returns

string

Initialize the _items variable to hold all items from the model

initItems() 

Hook that loads the form data from $_POST or the model

loadFormData() 

Or from whatever other source you specify here.

Load the settings for the round

loadRoundSettings() 

Load the survey object and use it

loadSurvey() 

Load the settings for the survey

loadTrackSettings() 

Hook containing the actual save code.

saveData() 

Call's afterSave() for user interaction.

see

Set what to do when the form is 'finished'.

setAfterSaveRoute() : \Gems\Snippets\Tracker\InsertSurveySnippet
inherited_from \Gems_Snippets_ModelFormSnippetAbstract::setAfterSaveRoute()
fluent This method is part of a fluent interface and will return the same instance

Returns

\Gems\Snippets\Tracker\InsertSurveySnippet

If menu item does not exist or is not allowed, redirect to index

setAfterSaveRoute() : \Gems_Snippets_ModelFormSnippetAbstract
Inherited

Returns

\Gems_Snippets_ModelFormSnippetAbstract

 Properties

 

$accesslog

$accesslog : \Gems_AccessLog

Default

 

Shortfix to add class attribute

$class : string

Default

'formTable'
 

True when the form should edit a new model item.

$createData : boolean

Default

true
 

$currentUser

$currentUser : \Gems_User_User

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

$defaultRound

$defaultRound : integer

Default

10
 

The items on the form - in the order of display

$formItems : array

Default

array('gto_id_respondent', 'gr2o_patient_nr', 'respondent_name', 'gto_id_organization', 'gto_id_survey', 'ggp_name', 'gto_id_relationfield', 'gto_id_track', 'gto_round_order', 'gto_valid_from_manual', 'gto_valid_from', 'gto_valid_until_manual', 'gto_valid_until', 'gto_comment')
 

An optional title for the form. replacing the current generic form title.

$formTitle : string

Default

 

Required

$loader : \Gems_Loader

Default

 

Required

$menu : \Gems_Menu

Default

 

$menuShowChildren

$menuShowChildren : boolean

Default

false
 

$menuShowSiblings

$menuShowSiblings : boolean

Default

false
 

$project

$project : \Gems_Project_ProjectSettings

Default

 

Required

$respondentTrack : \Gems_Tracker_RespondentTrack

Default

 

The name of the action to forward to after form completion

$routeAction : string

Default

'show'
inherited_from \Gems_Snippets_ModelFormSnippetAbstract::routeAction
 

The name of the action to forward to after form completion

$routeAction : string

Default

'show'
 

$survey

$survey : \Gems_Tracker_Survey

Default

 

id => label

$surveyList : array

Default

 

The newly create token

$token : \Gems_Tracker_Token

Default

 

When set getTopic uses this function instead of parent class.

$topicCallable : callable

Default

 

$tracker

$tracker : \Gems_Tracker

Default

 

When true a tabbed form is used.

$useTabbedForm : boolean

Default

false
 

$util

$util : \Gems_Util

Default