include/SearchForm/SearchForm.php

Show: inherited
Table of Contents

\SearchForm

Package: SugarCRM

Old search form

Children
\SearchFormReports
\EmployeesSearchForm
Api
 

Properties

Propertypublic\bean  $bean= ''

Seed bean to use

Details
Type
\bean
Propertypublicstring  $module= ''

Module the search from is for

Details
Type
string
Propertypublicarray  $searchFields= ''

SearchField meta data array to use. Populated from moduleDir/metadata/SearchFields

Details
Type
array
Propertypublicboolean  $showSavedSearchOptions= 'true'

Use to determine whether or not to show the saved search options

Default valuetrueDetails
Type
boolean
Propertypublicarray  $tabs= ''

meta data for the tabs to display

Details
Type
array
Propertypublicstring  $tpl= ''

SearchForm Template to use (xtpl)

Details
Type
string
Propertypublicobject  $xtpl= ''

XTPL object

Details
Type
object

Methods

methodpublicSearchForm( string $module, \bean $seedBean, string $tpl = null ) : void

loads SearchFields MetaData, sets member variables

Parameters
Name Type Description
$module string

moduleDir

$seedBean \bean

seed bean to use

$tpl string

template to use, defaults to moduleDir/SearchForm.html

methodpublicdisplayAdvanced( bool $header = true, bool $return = false,  $listViewDefs = '',  $lv = '' ) : string

displays the advanced search form body

Parameters
Name Type Description
$header bool

display this with headers

$return bool

echo or return the html

$listViewDefs
$lv
Returns
Type Description
string html of contents
methodpublicdisplayBasic( bool $header = true, bool $return = false ) : string

displays the basic search form body

Parameters
Name Type Description
$header bool

display this with headers

$return bool

echo or return the html

Returns
Type Description
string html of contents
methodpublicdisplayHeader( string $view ) : void

displays the search form header

Parameters
Name Type Description
$view string

which view is currently being displayed

methodpublicdisplaySavedViews(  $listViewDefs,  $lv, bool $header = true, bool $return = false ) : string

displays the saved views form body

Parameters
Name Type Description
$listViewDefs
$lv
$header bool

display this with headers

$return bool

echo or return the html

Returns
Type Description
string html of contents
methodpublicdisplayTabs( string $currentKey ) : string

displays the tabs (top of the search form)

Parameters
Name Type Description
$currentKey string

key in $this->tabs to show as the current tab

Returns
Type Description
string html
methodpublicdisplayWithHeaders( string $view, string $basic_search_text = '', string $advanced_search_text = '', string $saved_views_text = '' ) : void

displays the search form body, for example if basic_search is being displayed, then the function call would be displayWithHeaders('basic_search', $htmlForBasicSearchBody) {

Parameters
Name Type Description
$view string

which view is currently being displayed

$basic_search_text string

body of the basic search tab

$advanced_search_text string

body of the advanced search tab

$saved_views_text string

body of the saved views tab

methodpublicgenerateSearchWhere(  $add_custom_fields = false,  $module = '' ) : void

The fuction will returns an array of filter conditions.

Parameters
Name Type Description
$add_custom_fields
$module
methodpublicgetButtons( ) : string

get the search buttons

Returns
Type Description
string html of contents
methodpublicpopulateFromArray( array $array, string $switchVar = null, bool $addAllBeanFields = true ) : void

Populate the searchFields from an array

Parameters
Name Type Description
$array array

array to search through

$switchVar string

variable to use in switch statement

$addAllBeanFields bool

true to process at all bean fields

methodpublicpopulateFromRequest( string $switchVar = null, bool $addAllBeanFields = true ) : void

Populate the searchFields from $_REQUEST

Parameters
Name Type Description
$switchVar string

variable to use in switch statement

$addAllBeanFields bool

true to process at all bean fields

methodpublicsetup( ) : void

sets up the search forms, populates the preset values

Documentation was generated by DocBlox 0.18.1.