Generic controller class for showing and editing respondents
This controller handles a default model browse / edit / export to excel
| package | Gems |
|---|---|
| subpackage | Default |
| copyright | Copyright (c) 2011 Erasmus MC |
| license | New BSD License |
| since | Class available since version 1.0 |
| deprecated | Since 1.7.2 |
| inherited_from | \Gems_Controller_BrowseEditAction |
afterFormLoad(array $data, boolean $isNew)
array
boolean
afterSave(array $data, boolean $isNew)
As the data was already saved, it can NOT be changed anymore
| inherited_from | \Gems_Controller_BrowseEditAction::afterSave() |
|---|
afterSave(array $data, boolean $isNew) : boolean
As the data was already saved, it can NOT be changed anymore
array
boolean
booleanTrue when you want to display the default 'saved' messagesafterSaveRoute(mixed $data) : boolean
mixeddata array or Zend Request
booleanautofilterAction()
beforeFormDisplay(\Zend_Form $form, boolean $isNew) : \Zend_Form
Here we add the table display to the form.
\Zend_Form
boolean
\Zend_FormbeforeSave(array $data, boolean $isNew, \Zend_Form $form = null) : boolean
arrayThe data that will be saved.
boolean$param \Zend_Form $form
booleanReturns true if flow should continuecreateAction()
Uses $this->getModel() $this->addFormElements()
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.
booleanTrue when the current action is not in $summarizedActions.
stringThe current action.
\MUtil_Model_ModelAbstractdeleteAction()
Uses $this->getModel() $this->addFormElements()
| inherited_from | \Gems_Controller_BrowseEditAction::deleteAction() |
|---|
deleteAction()
Uses $this->getModel() $this->addFormElements()
editAction()
Uses $this->getModel() $this->addFormElements()
excelAction()
When you want to change the output, there are two places to check:
$this->addExcelColumns($model), where the model can be changed to have labels for columns you need exported
exportArchiveAction()
getAfterSaveRoute(mixed $data) : mixed
mixedarray or \Zend_Controller_Request_Abstract
mixedarray with route options or false when no redirect is foundgetBrowseTable(array $baseUrl= array(), $sort= null, $model= null) : \MUtil_Html_TableElement
Overruled to add css classes for Gems
array
\MUtil_Html_TableElementgetCachedRequestData(boolean $includeDefaults= true, string $sourceAction= null, boolean $readonly= false, boolean $filterEmpty= true) : array
booleanInclude the default values (yes for filtering, no for urls
stringThe action to get the cache from if not the current one.
booleanOptional, tell the cache not to store any new values
booleanOptional, filter empty values from cache
arraygetDefaultSearchData() : array
Used to specify the filter when no values have been entered by the user.
| inherited_from | \Gems_Controller_BrowseEditAction::getDefaultSearchData() |
|---|
arraygetDefaultSearchData() : array
Used to specify the filter when no values have been entered by the user.
arraygetInstanceId() : mixed
Overrule this function if the last item in the page title should be something other than te value of \MUtil_Model::REQUEST_ID.
mixedgetMenuParameter(string $name, mixed $default)
| inherited_from | \Gems_Menu_ParameterSourceInterface::getMenuParameter() |
|---|
getModelForm(array $data, \optional $new = false) : \Zend_Form
arrayThe data that will later be loaded into the form, can be changed
\optionalboolean $new Form should be for a new element
\Zend_FormgetRespondentId() : integer
integergetShowTable(integer $columns= 1, mixed $filter= null, mixed $sort= null) : \MUtil_Html_TableElement
Overruled to add css classes for Gems
integerThe number of columns to use for presentation
mixedA valid filter for \MUtil_Model_ModelAbstract->load()
mixedA valid sort for \MUtil_Model_ModelAbstract->load()
\MUtil_Html_TableElementgetSubject($data)
getTitle(string $separator = null) : string
If the title is an array the seperator concatenates the parts.
string
stringgetTopic($count = 1)
getTopic(integer $count = 1) : \$string
integer
\$stringgetTopicTitle()
getTopicTitle()
return $string
importAction()
indexAction()
| inherited_from | \Gems_Controller_BrowseEditAction::indexAction() |
|---|
indexAction()
init() : void
Called from __construct() as final step of object instantiation.
initHtml(boolean $reset = false) : void
booleanThrows away any existing html output when true
isConfirmedItem($title, $question= null, $info= null)
onFakeSubmit(\Zend_Form $form, array $data)
When not rerouted, the form will be populated afterwards
\Zend_FormThe populated form
arrayThe data-array we are working on
showAction()
Uses: $this->getModel() $this->getShowTable();
| inherited_from | \Gems_Controller_BrowseEditAction::showAction() |
|---|
showAction()
Uses: $this->getModel() $this->getShowTable();
_applySearchParameters(\MUtil_Model_ModelAbstract $model, $useStored = false)
_createSelectElement(string $name, string|array $options, string $empty = null) : \Zend_Form_Element_Select
stringName of the select element
stringarrayCan be a SQL select string or key/value array of options
stringText to display for the empty selector
\Zend_Form_Element_Select_createTable()
addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
Adds a button column to the model, if such a button exists in the model.
| rturn | void |
|---|---|
| inherited_from | \Gems_Controller_BrowseEditAction::addBrowseTableColumns() |
\MUtil_Model_Bridge_TableBridge
\MUtil_Model_ModelAbstract
addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model) : void
Adds a button column to the model, if such a button exists in the model.
\MUtil_Model_Bridge_TableBridge
\MUtil_Model_ModelAbstract
addExcelColumns(\MUtil_Model_ModelAbstract $model)
Only columns that have a label will be exported.
example:
$model->set('columnname', 'label', $this->_('Excel label'));
\MUtil_Model_ModelAbstract
addFormElements(\MUtil_Model_Bridge_FormBridgeInterface $bridge, \MUtil_Model_ModelAbstract $model, array $data, \optional $new = false) : void | array
Overrule this function to add different elements to the browse table, without having to recode the core table building code.
\MUtil_Model_Bridge_FormBridgeInterface
\MUtil_Model_ModelAbstract
arrayThe data that will later be loaded into the form
\optionalboolean $new Form should be for a new element
voidarrayWhen an array of new values is return, these are used to update the $data array in the calling functionaliasAction(string $alias)
Use this when an action is a Ajax action for retrieving information for use within the screen of another action
string
createForm(mixed $options = array()) : \Gems_Form
mixed
\Gems_FormcreateMenuLinks($includeLevel= 2, $parentLabel= true)
findAllowedMenuItem($action)
getAutoSearchElements(\MUtil_Model_ModelAbstract $model, array $data) : array
The form / html elements to search on. Elements can be grouped by inserting null's between them. That creates a distinct group of elements
| inherited_from | \Gems_Controller_BrowseEditAction::getAutoSearchElements() |
|---|
\MUtil_Model_ModelAbstract
arrayThe $form field values (can be usefull, but no need to set them)
arrayOf \Zend_Form_Element's or static tekst to add to the html or null for group breaks.getAutoSearchElements(\MUtil_Model_ModelAbstract $model, array $data) : array
The form / html elements to search on. Elements can be grouped by inserting null's between them. That creates a distinct group of elements
\MUtil_Model_ModelAbstract
arrayThe $form field values (can be usefull, but no need to set them)
arrayOf \Zend_Form_Element's or static tekst to add to the html or null for group breaks.getAutoSearchForm(string $targetId) : \Gems_Form | null
string
\Gems_Formnull
getAutoSearchHref()
getAutoSearchReset() : \Zend_Form_Element_Submit
\Zend_Form_Element_SubmitgetAutoSearchSubmit(\MUtil_Model_ModelAbstract $model, \MUtil_Form $form)
getDataFilter(array $data) : array
User input that has the same name as a model field is automatically used as a filter, but if the name is different processing is needed. That processing should happen here.
arrayThe current user input
arrayNew filter statementsgetExcelData(array $data, \MUtil_Model_ModelAbstract $model) : array
array
\MUtil_Model_ModelAbstract
arraygetOrganizationId(integer $default = null) : integer
integerOptional default value
integerAn organization idloadSnippetLoader()
openedRespondent(string $patientId, integer $orgId) : \Gems_Default_RespondentAction
string
integer
\Gems_Default_RespondentActionprocessForm(string $saveLabel= null, array $data= null) : \Zend_Form | null
stringA label describing the form
arrayAn array of data to use, adding to the data from the post
\Zend_FormnullReturns a form to display or null when finishedsetPageTitle(string $title)
stringTitle
$accesslog : \Gems_AccessLog
$autoFilter
true$currentOrganization : \Gems_User_Organization
$currentUser : \Gems_User_User
$db : \Zend_Db_Adapter_Abstract
$deleteSnippets
array('Respondent\\RespondentDetailsSnippet')$exportSnippets
array('Respondent\\RespondentDetailsSnippet')$filterStandard
array('grc_success' => 1)| inherited_from | \Gems_Controller_BrowseEditAction::filterStandard |
|---|
$filterStandard
$formatExcelData : boolean
true$loader : \Gems_Loader
$pageTitle : string
$requestCache : \Gems_Util_RequestCache
$showSnippets
array('Respondent\\RespondentDetailsSnippet', 'Tracker\\AddTracksSnippet', 'Token\\TokenTabsSnippet', 'RespondentTokenSnippet')$sortKey
array('gr2o_opened' => SORT_DESC)| inherited_from | \Gems_Controller_BrowseEditAction::sortKey |
|---|
$sortKey
$summarizedActions
array('index', 'autofilter')$tableSnippets
$useCsrf : boolean
true$useKeyboardSelector
true$useMultiRowForm
false$usePreviousFilter
true$useTabbedForms
true| inherited_from | \Gems_Controller_BrowseEditAction::useTabbedForms |
|---|
$useTabbedForms
false$util : \Gems_Util
$csrfId : string
'no_csrfx'$csrfTimeout : integer
300$importSnippets : mixed
'ModelImportSnippet'RESET_PARAM = 'reset'
SEARCH_BUTTON = 'AUTO_SEARCH_TEXT_BUTTON'