Display a search form that selects on typed text only

package Gems
subpackage Snippets\Token
copyright Copyright (c) 2015 Erasmus MC
license New BSD License
since Class available since version 1.7.2 15-okt-2015 17:31:50
inherited_from \Gems\Snippets\Token\PlanSearchSnippet

 Methods

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

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

Helper function to generate a period query string

getPeriodFilter(array $filter, \Zend_Db_Adapter_Abstract $db, $inFormat = null, $outFormat = null) : string
InheritedStatic

Parameters

$filter

array

A filter array or $request->getParams()

$db

\Zend_Db_Adapter_Abstract

$inFormat

Optional format to use for date when reading

$outFormat

Optional format to use for date in query

Returns

string

Generate two date selectors and - depending on the number of $dates passed - either a hidden element containing the field name or an radio button or dropdown selector for the type of date to use.

_addPeriodSelectors(array $elements, mixed $dates, string $defaultDate = null, integer $switchToSelect = 4
Inherited

Parameters

$elements

array

Search element array to which the element are added.

$dates

mixed

A string fieldName to use or an array of fieldName => Label

$defaultDate

string

Optional element, otherwise first is used.

$switchToSelect

integer

The number of dates where this function should switch to select display

Creates a \Zend_Form_Element_Select

_createCheckboxElement(string $name, string $label) : \Zend_Form_Element_Checkbox
Inherited

If $options is a string it is assumed to contain an SQL statement.

Parameters

$name

string

Name of the element

$label

string

Label for element

Returns

\Zend_Form_Element_Checkbox

Creates a \Zend_Form_Element_Select

_createRadioElement(string $name, string|array $options, string $empty = null) : \Zend_Form_Element_Radio
Inherited

If $options is a string it is assumed to contain an SQL statement.

Parameters

$name

string

Name of the select element

$options

stringarray

Can be a SQL select string or key/value array of options

$empty

string

Text to display for the empty selector

Returns

\Zend_Form_Element_Radio

Creates a \Zend_Form_Element_Select

_createSelectElement(string $name, string|array $options, string $empty = null) : \Zend_Form_Element_Select
Inherited

If $options is a string it is assumed to contain an SQL statement.

Parameters

$name

string

Name of the select element

$options

stringarray

Can be a SQL select string or key/value array of options

$empty

string

Text to display for the empty selector

Returns

\Zend_Form_Element_Select

Creates the form itself

createForm(array $options = null) : \Gems_Form
Inherited

Parameters

$options

array

Returns

\Gems_Form

getAllCreators()

getAllCreators(array $allowedOrgs, array $data) : mixed
Inherited

Parameters

$allowedOrgs

array

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

mixedSQL string or array

getAllGroups()

getAllGroups(string $orgWhere, array $data) : mixed
Inherited

Parameters

$orgWhere

string

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

mixedSQL string or array

getAllSurveys()

getAllSurveys(string $orgWhere, array $data) : mixed
Inherited

Parameters

$orgWhere

string

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

mixedSQL string or array

getAllTrackRounds()

getAllTrackRounds(string $orgWhere, array $data) : mixed
Inherited

Parameters

$orgWhere

string

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

mixedSQL string or array

getAllTrackTypes()

getAllTrackTypes(string $orgWhere, array $data) : mixed
Inherited

Parameters

$orgWhere

string

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

mixedSQL string or array

Returns a text element for autosearch. Can be overruled.

getAutoSearchElements(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\Snippets\Token\PlanSearchSnippet::getAutoSearchElements()

Parameters

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

arrayOf \Zend_Form_Element's or static tekst to add to the html or null for group breaks.

Returns a text element for autosearch. Can be overruled.

getAutoSearchElements(array $data) : array
Inherited

The form / html elements to search on. Elements can be grouped by inserting null's between them. That creates a distinct group of elements

Parameters

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

arrayOf \Zend_Form_Element's or static tekst to add to the html or null for group breaks.

Creates an autosearch form for indexAction.

getAutoSearchForm() : \Gems_Form | null
Inherited

Returns

\Gems_Formnull

getAutoSearchHref()

getAutoSearchHref() : string
Inherited

Returns

stringHref attribute for type as you go autofilter

Creates a reset button for the search form

getAutoSearchReset() : \Zend_Form_Element_Html
Inherited

Returns

\Zend_Form_Element_Htmlor null

Creates a submit button

getAutoSearchSubmit() : \Zend_Form_Element_Submit
Inherited

Returns

\Zend_Form_Element_Submit

getOrganizationList()

getOrganizationList(array $data) : array
Inherited

Parameters

$data

array

The $form field values (can be usefull, but no need to set them)

Returns

arrayof organization id => name

getSearchData()

getSearchData() : array
Inherited

Returns

arrayThe data to fill the form with

Creates a \Zend_Form_Element_Select

_createMultiElement(string $class, string $name, string|array $options, string $empty) : \Zend_Form_Element_Multi
Inherited

If $options is a string it is assumed to contain an SQL statement.

Parameters

$class

string

Name of the class to use

$name

string

Name of the select element

$options

stringarray

Can be a SQL select string or key/value array of options

$empty

string

Text to display for the empty selector

Returns

\Zend_Form_Element_Multi

 Properties

 

Optional, otherwise created from $util

$requestCache : \Gems_Util_RequestCache

Default

 

The id of a div that contains target that should be replaced.

$containingId : string

Default

 

$currentUser

$currentUser : \Gems_User_User

Default

 

Optional string format for date

$dateFormat : string

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

The default search data to use.

$defaultSearchData : \array()

Default

array()
 

$menu

$menu : \Gems_Menu

Default

 

$model

$model : \MUtil_Model_ModelAbstract

Default

 

$multiTracks

$multiTracks : boolean

Default

true
 

Display the period selector

$periodSelector : boolean

Default

false
inherited_from \Gems\Snippets\Token\PlanSearchSnippet::periodSelector
 

Display the period selector

$periodSelector : boolean

Default

true
 

$request

$request : \Zend_Controller_Request_Abstract

Default

 

Id for auto search button

$searchButtonId : string

Default

'AUTO_SEARCH_TEXT_BUTTON'
 

The input data for the model

$searchData : array

Default

false
 

$util

$util : \Gems_Util

Default

 Constants

 

Field name for perioe filters

PERIOD_DATE_USED = 'dateused'