BrowseEdit controller
This controller handles a default model browse / edit / export to excel
package | Gems |
---|---|
subpackage | Controller |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.0 |
deprecated | Since version 1.7.1 |
inherited_from | \Gems_Controller_ModelActionAbstract |
afterFormLoad(array $data, boolean $isNew)
array
boolean
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()
createForm(array $options = null
) : \Gems_Form
inherited_from | \Gems_Controller_ModelActionAbstract::createForm() |
---|
array
\Gems_Form
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
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.
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
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
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
getTitle(string $separator = null
) : string
If the title is an array the seperator concatenates the parts.
string
string
getTopic(integer $count = 1
) : \$string
integer
\$string
getTopicTitle()
return $string
importAction()
indexAction()
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();
_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) : 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
aliasAction(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
\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
loadSnippetLoader()
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
$autoFilter
true
$db : \Zend_Db_Adapter_Abstract
$filterStandard
$formatExcelData : boolean
true
$loader : \Gems_Loader
$pageTitle : string
$requestCache : \Gems_Util_RequestCache
$sortKey
$summarizedActions
array('index', 'autofilter')
$tableSnippets
$useCsrf : boolean
true
$useKeyboardSelector
true
$useMultiRowForm
false
$usePreviousFilter
true
$useTabbedForms
false
$util : \Gems_Util
$csrfId : string
'no_csrfx'
$csrfTimeout : integer
300
$importSnippets : mixed
'ModelImportSnippet'
RESET_PARAM = 'reset'
SEARCH_BUTTON = 'AUTO_SEARCH_TEXT_BUTTON'