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
boolean
True when you want to display the default 'saved' messagesafterSaveRoute(mixed $data) : boolean
mixed
data array or Zend Request
boolean
autofilterAction()
beforeFormDisplay(\Zend_Form $form, boolean $isNew) : \Zend_Form
Here we add the table display to the form.
\Zend_Form
boolean
\Zend_Form
beforeSave(array $data, boolean $isNew, \Zend_Form $form = null
) : boolean
array
The data that will be saved.
boolean
$param \Zend_Form $form
boolean
Returns 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.
boolean
True when the current action is not in $summarizedActions.
string
The current action.
\MUtil_Model_ModelAbstract
deleteAction()
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
mixed
array or \Zend_Controller_Request_Abstract
mixed
array 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_TableElement
getCachedRequestData(boolean $includeDefaults= true
, string $sourceAction= null
, boolean $readonly= false
, boolean $filterEmpty= true
) : array
boolean
Include the default values (yes for filtering, no for urls
string
The action to get the cache from if not the current one.
boolean
Optional, tell the cache not to store any new values
boolean
Optional, filter empty values from cache
array
getDefaultSearchData() : array
Used to specify the filter when no values have been entered by the user.
inherited_from | \Gems_Controller_BrowseEditAction::getDefaultSearchData() |
---|
array
getDefaultSearchData() : array
Used to specify the filter when no values have been entered by the user.
array
getInstanceId() : mixed
Overrule this function if the last item in the page title should be something other than te value of \MUtil_Model::REQUEST_ID.
mixed
getMenuParameter(string $name, mixed $default)
inherited_from | \Gems_Menu_ParameterSourceInterface::getMenuParameter() |
---|
getModelForm(array $data, \optional $new = false
) : \Zend_Form
array
The data that will later be loaded into the form, can be changed
\optional
boolean $new Form should be for a new element
\Zend_Form
getRespondentId() : integer
integer
getShowTable(integer $columns= 1
, mixed $filter= null
, mixed $sort= null
) : \MUtil_Html_TableElement
Overruled to add css classes for Gems
integer
The number of columns to use for presentation
mixed
A valid filter for \MUtil_Model_ModelAbstract->load()
mixed
A valid sort for \MUtil_Model_ModelAbstract->load()
\MUtil_Html_TableElement
getSubject($data)
getTitle(string $separator = null
) : string
If the title is an array the seperator concatenates the parts.
string
string
getTopic($count = 1
)
getTopic(integer $count = 1
) : \$string
integer
\$string
getTopicTitle()
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
boolean
Throws 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_Form
The populated form
array
The 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
string
Name of the select element
string
array
Can be a SQL select string or key/value array of options
string
Text 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
array
The data that will later be loaded into the form
\optional
boolean $new Form should be for a new element
void
array
When 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_Form
createMenuLinks($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
array
The $form field values (can be usefull, but no need to set them)
array
Of \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
array
The $form field values (can be usefull, but no need to set them)
array
Of \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_Form
null
getAutoSearchHref()
getAutoSearchReset() : \Zend_Form_Element_Submit
\Zend_Form_Element_Submit
getAutoSearchSubmit(\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.
array
The current user input
array
New filter statementsgetExcelData(array $data, \MUtil_Model_ModelAbstract $model) : array
array
\MUtil_Model_ModelAbstract
array
getOrganizationId(integer $default = null
) : integer
integer
Optional default value
integer
An organization idloadSnippetLoader()
openedRespondent(string $patientId, integer $orgId) : \Gems_Default_RespondentAction
string
integer
\Gems_Default_RespondentAction
processForm(string $saveLabel= null
, array $data= null
) : \Zend_Form | null
string
A label describing the form
array
An array of data to use, adding to the data from the post
\Zend_Form
null
Returns a form to display or null when finishedsetPageTitle(string $title)
string
Title
$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'