package Gems
subpackage Tracker\Snippets
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.7.2 Jan 15, 2016 3:57:15 PM

 Methods

Add the settings from the transformed import data to the formData and the model

addExistingRoundsToModel(\ArrayObject $import, \MUtil_Model_ModelAbstract $model) 

Parameters

$import

\ArrayObject

$model

\MUtil_Model_ModelAbstract

Add the settings from the transformed import data to the formData and the model

addImportToModelData(\ArrayObject $import) 

Parameters

$import

\ArrayObject

Returns an array with the allowed section names as keys and as a value true when the field list is reset for every item or false for the standard case where the first line contains all the fields.

getImportSections() : array

Returns

arraysectionName => resetFields

Add the elements from the model to the bridge for file check step

addStepChangeTrack(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Add the elements from the model to the bridge for file check step

addStepCreateTrack(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Add the elements from the model to the bridge for the current step

addStepElementsFor(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model, integer $step) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

$step

integer

The current step

Add the elements from the model to the bridge for file check step

addStepFileCheck(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Add the elements from the model to the bridge for file upload step

addStepFileImport(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Add the elements from the model to the bridge for file check step

addStepMergeTrack(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Add the elements from the model to the bridge for file check step

addStepRoundMatch(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model) 

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$model

\MUtil_Model_ModelAbstract

Overrule this function for any activities you want to take place after the form has successfully been validated, but before any buttons are processed.

afterFormValidationFor(integer $step) 

Parameters

$step

integer

The current step

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)

Creates the model

createModel() : \MUtil_Model_ModelAbstract

Returns

\MUtil_Model_ModelAbstract

Display a header

displayHeader(\MUtil_Model_Bridge_FormBridgeInterface $bridge, mixed $header, string $tagName = 'h2'

Parameters

$bridge

\MUtil_Model_Bridge_FormBridgeInterface

$header

mixed

Header content

$tagName

string

Creates from the model a \Zend_Form using createForm and adds elements using addFormElements().

getFormFor(integer $step) : \Zend_Form

Parameters

$step

integer

The current step

Returns

\Zend_Form

Get the title at the top of the form

getFormTitle(integer $step) : string

Parameters

$step

integer

The current step

Returns

string

getImportCheckBatch()

getImportCheckBatch() : \Gems_Task_TaskRunnerBatch

Returns

\Gems_Task_TaskRunnerBatch

getImportCreateBatch()

getImportCreateBatch() : \Gems_Task_TaskRunnerBatch

Returns

\Gems_Task_TaskRunnerBatch

getImportMergeBatch()

getImportMergeBatch() : \Gems_Task_TaskRunnerBatch

Returns

\Gems_Task_TaskRunnerBatch

The number of steps in this form

getStepCount() : integer

Returns

integer

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

loadFormData() 

Or from whatever other source you specify here.

Load the import data in an array fo the type:

loadImportData() : \ArrayObject

\ArrayObject(array( 'track' => array(linenr => array), 'organizations' => array(linenr => array), 'fields' => array(linenr => array), 'surveys' => array(linenr => array), 'rounds' => array(linenr => array), 'errors' => array(linenr => string), ))

Stored in session

Returns

\ArrayObject

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

setAfterSaveRoute() : \Gems\Tracker\Snippets\ImportMergeSnippetAbstract

Returns

\Gems\Tracker\Snippets\ImportMergeSnippetAbstract

Performs the validation.

validateForm() : boolean

Returns

booleanTrue if validation was OK and data should be saved.

 Properties

 

$view

$view : \Gems_View

Default

 

$_session

$_session : \Zend_Session_Namespace

Default

 

$cache

$cache : \Zend_Cache_Core

Default

 

$currentUser

$currentUser : \Gems_User_User

Default

 

$importModel

$importModel : \MUtil_Model_ModelAbstract

Default

 

$loader

$loader : \Gems_Loader

Default

 

$trackEngine

$trackEngine : \Gems_Tracker_Engine_TrackEngineInterface

Default

false
 

$util

$util : \Gems_Util

Default

 Constants

 

Deactivate this current round

ROUND_DEACTIVATE = -1 
 

Leave the current round as is

ROUND_LEAVE = -2