include/SugarFields/Fields/Base/SugarFieldBase.php

Show: inherited
Table of Contents

\SugarFieldBase

Package: SugarCRM

SugarFieldBase translates and displays fields from a vardef definition into different formats including DetailView, ListView, EditView. It also provides Search Inputs and database queries to handle searching

Children
\SugarFieldLink
\SugarFieldHtml
\SugarFieldEnum
\SugarFieldCollection
\SugarFieldDatetimecombo
\SugarFieldHtml
\SugarFieldAddress
\SugarFieldPassword
\SugarFieldTeamset
\SugarFieldFile
\SugarFieldId
\SugarFieldRelate
\SugarFieldRadioenum
\SugarFieldBool
\SugarFieldText
\SugarFieldAssigned_user_name
\SugarFieldReadonly
\SugarFieldDatetime
\SugarFieldPhone
\SugarFieldDownload
\SugarFieldUsername
\SugarFieldImage
\SugarFieldTime
\SugarFieldInt
\SugarFieldFullname
\SugarFieldEncrypt

Properties

Propertypublic  $hasButton= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $ss= ''
Details
Type
n/a

Methods

methodpublicSugarFieldBase(  $type ) : void

Parameters
Name Type Description
$type
methodpublicdisplayFromFunc(  $displayType,  $parentFieldArray,  $vardef,  $displayParams,  $tabindex = 0 ) : void

Parameters
Name Type Description
$displayType
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicfetch(  $path ) : void

Parameters
Name Type Description
$path
methodpublicfindTemplate(  $view ) : void

Parameters
Name Type Description
$view
methodpublicformatField(  $rawField,  $vardef ) : void

Parameters
Name Type Description
$rawField
$vardef
methodprotectedgetAccessKey(  $vardef,  $fieldType = null,  $module = null ) : void

Parameters
Name Type Description
$vardef
$fieldType
$module
methodpublicgetChangeLogSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetDetailViewSmarty( \parentFieldArray $parentFieldArray, \vardef $vardef, \displayParam $displayParams,  $tabindex ) : void

Returns a smarty template for the DetailViews

Parameters
Name Type Description
$parentFieldArray \parentFieldArray

string name of the variable in the parent template for the bean's data

$vardef \vardef

vardef field defintion

$displayParams \displayParam

parameters for display available paramters are: * labelSpan - column span for the label * fieldSpan - column span for the field

$tabindex
methodpublicgetEditView( ) : void

methodpublicgetEditViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetEmailTemplateValue(  $inputField,  $vardef,  $context = null ) : void

Parameters
Name Type Description
$inputField
$vardef
$context
methodpublicgetImportViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetListViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $col ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$col
methodpublicgetPopupViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetQueryIn( ) : void

methodpublicgetQueryLike( ) : void

methodpublicgetSearchInput( \$key $key = '', \$args $args = array() ) : \$value

getSearchInput

This function allows the SugarFields to handle returning the search input value given arguments (typically from $_REQUEST/$_POST) and a search string.

Parameters
Name Type Description
$key \$key

String value of key to search for

$args \$args

Mixed value containing haystack to search for value in

Returns
Type Description
\$value Mixed value that the SugarField should return
methodpublicgetSearchViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetSearchWhereValue( \$value $value ) : Mixed

getSearchWhereValue

Checks and returns a sane value based on the field type that can be used when building the where clause in a search form.

Parameters
Name Type Description
$value \$value

Mixed value being searched on

Returns
Type Description
Mixed the value for the where clause used in search
methodpublicgetSmartyView(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex = -1,  $view ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
$view
methodpublicgetWirelessDetailViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetWirelessEditViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetWirelessListViewSmarty(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
methodpublicgetWirelessSmartyView(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex = -1,  $view ) : void

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
$view
methodpublicimportSanitize( \$value $value, \$vardefs $vardef, \$focus $focus, \$settings $settings ) : string

Handles import field sanitizing for an field type

Parameters
Name Type Description
$value \$value

string value to be sanitized

$vardef \$vardefs

array

$focus \$focus

SugarBean object

$settings \$settings

ImportFieldSanitize object

Returns
Type Description
string sanitized value or boolean false if there's a problem with the value
methodprotectedisRangeSearchView( array $vardef ) : boolean

isRangeSearchView This method helps determine whether or not to display the range search view code for the sugar field

Parameters
Name Type Description
$vardef array

entry representing the sugar field's definition

Returns
Type Description
boolean true if range search view should be displayed, false otherwise
methodprotectedisTrimmable( string $type ) : boolean

Check if the field is allowed to be trimmed

Parameters
Name Type Description
$type string
Returns
Type Description
boolean
methodpublicsave( \SugarBean $bean, array $params,  $field,  $properties,  $prefix = '' ) : void

This should be called when the bean is saved. The bean itself will be passed by reference

Parameters
Name Type Description
$bean \SugarBean

bean - the bean performing the save

$params array

params - an array of paramester relevant to the save, most likely will be $_REQUEST

$field
$properties
$prefix
methodpublicsetup(  $parentFieldArray,  $vardef,  $displayParams,  $tabindex,  $twopass = true ) : void

Setup function to assign values to the smarty template, should be called before every display function

Parameters
Name Type Description
$parentFieldArray
$vardef
$displayParams
$tabindex
$twopass
methodprotectedsetupFieldArray( mixed $parentFieldArray, array $vardef ) : array

setupFieldArray This method takes the $parentFieldArray mixed variable which may be an Array or object and attempts to call any custom fieldSpecific formatting to the value depending on the field type.

Parameters
Name Type Description
$parentFieldArray mixed

Array or Object of data where the field's value comes from

$vardef array

The vardef entry linked to the SugarField instance

Returns
Type Description
array $parentFieldArray The formatted $parentFieldArray with the formatField method possibly applied
Details
See
\SugarFieldEnum.php,  
methodpublicunformatField(  $formattedField,  $vardef ) : void

Parameters
Name Type Description
$formattedField
$vardef
Documentation was generated by DocBlox 0.18.1.