Snippet for editing reception code of token.

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\Token
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.4
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract

 Methods

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

Called after loadFormData() and isUndeleting() but before the form is created

getReceptionCodes() : array
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::getReceptionCodes()

Returns

array

Called after loadFormData() and isUndeleting() but before the form is created

getReceptionCodes() : array
Inherited

Returns

array

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

Called after loadFormData() in loadForm() before the form is created

isUndeleting() : boolean
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::isUndeleting()

Returns

booleanAre we undeleting or deleting?

Called after loadFormData() in loadForm() before the form is created

isUndeleting() : boolean
Inherited

Returns

booleanAre we undeleting or deleting?

Hook performing actual save

setReceptionCode(string $newCode, integer $userId) : \Gems\Snippets\Token\$changed
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::setReceptionCode()

Parameters

$newCode

string

$userId

integer

Returns

\Gems\Snippets\Token\$changed

Hook performing actual save

setReceptionCode(string $newCode, integer $userId) : \Gems\Snippets\ReceptionCode\$changed
Inherited

Parameters

$newCode

string

$userId

integer

Returns

\Gems\Snippets\ReceptionCode\$changed

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) 

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)

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

getMenuList()

getMenuList() : \Gems_Menu_MenuList

Returns

\Gems_Menu_MenuList

overrule to add your own buttons.

getMenuList() : \Gems_Menu_MenuList
Inherited

Returns

\Gems_Menu_MenuList

Retrieve the header title to display

getTitle() : string
Inherited

Returns

string

Initialize the _items variable to hold all items from the model

initItems() 
Inherited

Makes sure there is a form.

loadForm() 
Inherited

Hook containing the actual save code.

saveData() 
Inherited

Call's afterSave() for user interaction.

see

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

setAfterSaveRoute() : \Gems\Snippets\Token\DeleteTrackTokenSnippet

Returns

\Gems\Snippets\Token\DeleteTrackTokenSnippet(continuation pattern)

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

setAfterSaveRoute() : \Gems_Snippets_ModelFormSnippetAbstract
Inherited

Returns

\Gems_Snippets_ModelFormSnippetAbstract

 Properties

 

Replacement token after a redo delete

$_replacementTokenId : string

Default

 

$accesslog

$accesslog : \Gems_AccessLog

Default

 

Shortfix to add class attribute

$class : string

Default

'formTable'
 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

Array of items that should be shown to the user

$editItems : array

Default

array('gto_comment')
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::editItems
 

Array of items that should be shown to the user

$editItems : array

Default

array()
 

Array of items that should be shown to the user

$exhibitItems : array

Default

array('gto_id_token', 'gr2o_patient_nr', 'respondent_name', 'gtr_track_name', 'gr2t_track_info', 'gsu_survey_name', 'gto_round_description', 'ggp_name', 'gto_valid_from', 'gto_valid_until', 'gto_completion_time')
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::exhibitItems
 

Array of items that should be shown to the user

$exhibitItems : array

Default

array()
 

When a fixed reception code is specified, then no choice list is presented to the user

$fixedReceptionCode : string

Default

null
 

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

$formTitle : string

Default

 

Array of items that should be kept, but as hidden

$hiddenItems : array

Default

array('gto_id_organization', 'gto_id_respondent', 'gto_id_respondent_track')
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::hiddenItems
 

Array of items that should be kept, but as hidden

$hiddenItems : array

Default

array()
 

$loader

$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

 

The item containing the reception code field

$receptionCodeItem : string

Default

'gto_reception_code'
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::receptionCodeItem
 

The item containing the reception code field

$receptionCodeItem : string

Default

''
 

The name of the action to forward to after form completion

$routeAction : string

Default

'show'
 

The token shown

$token : \Gems_Tracker_Token

Default

 

When set getTopic uses this function instead of parent class.

$topicCallable : callable

Default

 

Marker that the snippet is in undelete mode (for subclasses)

$unDelete : boolean

Default

false
 

Optional right to check for undeleting

$unDeleteRight : string

Default

'pr.token.undelete'
inherited_from \Gems\Snippets\ReceptionCode\ChangeReceptionCodeSnippetAbstract::unDeleteRight
 

Optional right to check for undeleting

$unDeleteRight : string

Default

 

When true a tabbed form is used.

$useTabbedForm : boolean

Default

false
 

$util

$util : \Gems_Util

Default

 

$view

$view : \Zend_View

Default