modules/UpgradeWizard/SugarMerge/SubpanelMerge.php

Show: inherited
Table of Contents

\SubpanelMerge

Package: SugarCRM

SubpanelMerge is a class for merging subpanel meta data together. This subpanel meta-data is a mix of the layouts seen in listviews and editviews

Parent(s)
\ListViewMerge < \EditViewMerge

Properties

PropertyprotectedBOOLEAN  $bestMatch= 'true'
inherited

If we should use the best match algorithim

Inherited from: \EditViewMerge::$$bestMatch\ListViewMerge::$$bestMatch
Default valuetrueDetails
Type
BOOLEAN
Inherited_from
\EditViewMerge::$$bestMatch  
Inherited_from
\ListViewMerge::$$bestMatch  
PropertyprotectedARRAY  $customData= 'array()'
inherited

this will store the meta data for the custom file

Inherited from: \EditViewMerge::$$customData\ListViewMerge::$$customData
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$customData  
Inherited_from
\ListViewMerge::$$customData  
PropertyprotectedARRAY  $customFields= 'array()'
inherited

this will store an associative array contianing all the fields that are used in the custom meta data file

Inherited from: \EditViewMerge::$$customFields\ListViewMerge::$$customFields
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$customFields  
Inherited_from
\ListViewMerge::$$customFields  
Propertyprotected  $customPanelIds= 'array()'
inherited

The ids of the panels found in custom metadata fuke

Inherited from: \EditViewMerge::$$customPanelIds\ListViewMerge::$$customPanelIds
Default valuearray()Details
Type
n/a
Inherited_from
\EditViewMerge::$$customPanelIds  
Inherited_from
\ListViewMerge::$$customPanelIds  
PropertyprotectedSTRING  $defaultPanel= ''default''
inherited

The default panel we place the fields in if we aren't using the best match algorithim

Inherited from: \EditViewMerge::$$defaultPanel\ListViewMerge::$$defaultPanel
Default value'default'Details
Type
STRING
Inherited_from
\EditViewMerge::$$defaultPanel  
Inherited_from
\ListViewMerge::$$defaultPanel  
Propertyprotected  $fieldConversionMapping= 'array( 'Campaigns' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Cases' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Contracts' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Leads' => array('created_by'=>'date_entered'), 'Meetings' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'ProspectLists' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Prospects' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), )'
Default valuearray( 'Campaigns' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Cases' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Contracts' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Leads' => array('created_by'=>'date_entered'), 'Meetings' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'ProspectLists' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), 'Prospects' => array('created_by_name'=>'date_entered', 'modified_by_name'=>'date_modified'), )Details
Type
n/a
Inherited_from
\EditViewMerge::$$fieldConversionMapping  
Inherited_from
\ListViewMerge::$$fieldConversionMapping  
Propertyprotected\FILEPOINTER  $fp= 'NULL'
inherited

The file pointer to log to if set to NULL it will use the GLOBALS['log'] if available and log to debug

Inherited from: \EditViewMerge::$$fp\ListViewMerge::$$fp
Default valueNULLDetails
Type
\FILEPOINTER
Inherited_from
\EditViewMerge::$$fp  
Inherited_from
\ListViewMerge::$$fp  
PropertyprotectedBOOLEAN  $isMultiPanel= 'true'
inherited

If true then it works as though it's a multipanel

Inherited from: \EditViewMerge::$$isMultiPanel\ListViewMerge::$$isMultiPanel
Default valuetrueDetails
Type
BOOLEAN
Inherited_from
\EditViewMerge::$$isMultiPanel  
Inherited_from
\ListViewMerge::$$isMultiPanel  
PropertyprotectedINT  $maxCols= '2'
inherited

the max number of columns for this view

Inherited from: \EditViewMerge::$$maxCols\ListViewMerge::$$maxCols
Default value2Details
Type
INT
Inherited_from
\EditViewMerge::$$maxCols  
Inherited_from
\ListViewMerge::$$maxCols  
PropertyprotectedARRAY  $mergedFields= 'array()'
inherited

this will store an associative array contianing all the merged fields

Inherited from: \EditViewMerge::$$mergedFields\ListViewMerge::$$mergedFields
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$mergedFields  
Inherited_from
\ListViewMerge::$$mergedFields  
PropertyprotectedSTRING  $module= ''module''
inherited

the name of the module to be merged

Inherited from: \EditViewMerge::$$module\ListViewMerge::$$module
Default value'module'Details
Type
STRING
Inherited_from
\EditViewMerge::$$module  
Inherited_from
\ListViewMerge::$$module  
PropertyprotectedARRAY  $newData= 'array()'
inherited

this will store the meta data for the new file

Inherited from: \EditViewMerge::$$newData\ListViewMerge::$$newData
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$newData  
Inherited_from
\ListViewMerge::$$newData  
PropertyprotectedARRAY  $newFields= 'array()'
inherited

this will store an associative array contianing all the fields that are used in the new meta data file

Inherited from: \EditViewMerge::$$newFields\ListViewMerge::$$newFields
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$newFields  
Inherited_from
\ListViewMerge::$$newFields  
Propertyprotected  $newPanelIds= 'array()'
inherited

The ids of the panels found in original metadata fuke

Inherited from: \EditViewMerge::$$newPanelIds\ListViewMerge::$$newPanelIds
Default valuearray()Details
Type
n/a
Inherited_from
\EditViewMerge::$$newPanelIds  
Inherited_from
\ListViewMerge::$$newPanelIds  
PropertyprotectedARRAY  $originalData= 'array()'
inherited

this will store the meta data for the original file

Inherited from: \EditViewMerge::$$originalData\ListViewMerge::$$originalData
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$originalData  
Inherited_from
\ListViewMerge::$$originalData  
PropertyprotectedARRAY  $originalFields= 'array()'
inherited

this will store an associative array contianing all the fields that are used in the original meta data file

Inherited from: \EditViewMerge::$$originalFields\ListViewMerge::$$originalFields
Default valuearray()Details
Type
ARRAY
Inherited_from
\EditViewMerge::$$originalFields  
Inherited_from
\ListViewMerge::$$originalFields  
Propertyprotected  $originalPanelIds= 'array()'
inherited

The ids of the panels found in original metadata fuke

Inherited from: \EditViewMerge::$$originalPanelIds\ListViewMerge::$$originalPanelIds
Default valuearray()Details
Type
n/a
Inherited_from
\EditViewMerge::$$originalPanelIds  
Inherited_from
\ListViewMerge::$$originalPanelIds  
PropertyprotectedSTRING  $panelName= ''panels''
inherited

The name of the panels section in the meta data

Inherited from: \EditViewMerge::$$panelName\ListViewMerge::$$panelName
Default value'panels'Details
Type
STRING
Inherited_from
\EditViewMerge::$$panelName  
Inherited_from
\ListViewMerge::$$panelName  
Propertyprotected\unknown_type  $scanForMultiPanel= 'true'
inherited

Determines if getFields should analyze panels to determine if it is a MultiPanel

Inherited from: \EditViewMerge::$$scanForMultiPanel\ListViewMerge::$$scanForMultiPanel
Default valuetrueDetails
Type
\unknown_type
Inherited_from
\EditViewMerge::$$scanForMultiPanel  
Inherited_from
\ListViewMerge::$$scanForMultiPanel  
Propertyprotected  $templateMetaName= ''templateMeta''
inherited

The name of the templateMeta data secion in the meta data

Inherited from: \EditViewMerge::$$templateMetaName\ListViewMerge::$$templateMetaName
Default value'templateMeta'Details
Type
n/a
Inherited_from
\EditViewMerge::$$templateMetaName  
Inherited_from
\ListViewMerge::$$templateMetaName  
PropertyprotectedSTRING  $varName= ''subpanel_layout''

The variable name that is used with the file for example in editviewdefs and detailviewdefs it is $viewdefs

Default value'subpanel_layout'Details
Type
STRING
PropertyprotectedSTRING  $viewDefs= ''SubPanel''

Enter the name of the parameter used in the $varName for example in editviewdefs and detailviewdefs it is 'EditView' and 'DetailView' respectively - $viewdefs['EditView']

Default value'SubPanel'Details
Type
STRING

Methods

methodprotectedareMatchingValues( \MULTI $val1, \MULTI $val2 ) : BOOLEAN
inherited

returns true if $val1 and $val2 match otherwise it returns false

Inherited from: \EditViewMerge::areMatchingValues()\ListViewMerge::areMatchingValues()
Parameters
Name Type Description
$val1 \MULTI
  • a value to compare to val2
$val2 \MULTI
  • a value to compare to val1
Returns
Type Description
BOOLEAN - if $val1 and $val2 match
methodpublicarrayMerge( ARRAY $gimp, ARRAY $dom ) : ARRAY
inherited

Recursiveley merges two arrays

Inherited from: \EditViewMerge::arrayMerge()\ListViewMerge::arrayMerge()
Parameters
Name Type Description
$gimp ARRAY
  • if keys match this arrays values are overriden
$dom ARRAY
  • if keys match this arrays values will override the others
Returns
Type Description
ARRAY $merged - the merges array
methodprotectedbuildPanels( ) : ARRAY
inherited

This builds the array of fields from the merged fields in the appropriate order when building the panels for a list view the most important thing is order so we ensure the fields that came from the custom file keep their order then we add any new fields at the end

Inherited from: \ListViewMerge::buildPanels()
Returns
Type Description
ARRAY
methodprotectedclear( ) : void
inherited

Clears out the values of the arrays so that the same object can be utilized

Inherited from: \EditViewMerge::clear()\ListViewMerge::clear()
methodpublicgetData( ) : ARRAY
inherited

This will return the meta data of the merged file

Inherited from: \EditViewMerge::getData()\ListViewMerge::getData()
Returns
Type Description
ARRAY - the meta data of the merged file
methodprotectedgetFields( ARRAY $panels,  $multiple = true ) : ARRAY
inherited

This takes in a list of panels and returns an associative array of field names to the meta-data of the field as well as the locations of that field Since ListViews don't have the concept of rows and columns it takes the panel and the row to be the field name

Inherited from: \ListViewMerge::getFields()
Parameters
Name Type Description
$panels ARRAY
  • this is the 'panel' section of the meta-data for list views all the meta data is one panel since it is just a list of fields
$multiple
Returns
Type Description
ARRAY $fields - an associate array of fields and their meta-data as well as their location
methodprotectedgetPanelIds(  $panels ) : void
inherited

getPanelIds

Inherited from: \EditViewMerge::getPanelIds()\ListViewMerge::getPanelIds()
Parameters
Name Type Description
$panels
methodprotectedloadData( STRING $module, STRING $original_file, STRING $new_file, STRING $custom_file ) : void

Loads the meta data of the original, new, and custom file into the variables originalData, newData, and customData respectively it then transforms them into a structure that EditView Merge would understand

Parameters
Name Type Description
$module STRING
  • name of the module's files that are to be merged
$original_file STRING
  • path to the file that originally shipped with sugar
$new_file STRING
  • path to the new file that is shipping with the patch
$custom_file STRING
  • path to the custom file
methodprotectedlog( \MULTI $message ) : void
inherited

Logs the given message if the message is not a string it will export it first. If $this->fp is NULL then it will try to log to the $GLOBALS['log'] if it is available

Inherited from: \EditViewMerge::log()\ListViewMerge::log()
Parameters
Name Type Description
$message \MULTI
methodpublicmerge( STRING $module, STRING $original_file, STRING $new_file, STRING $custom_file = false, BOOLEAN $save = true ) : BOOLEAN
inherited

public function that will merge meta data from an original sugar file that shipped with the product, a customized file, and a new file shipped with an upgrade

Inherited from: \EditViewMerge::merge()\ListViewMerge::merge()
Parameters
Name Type Description
$module STRING
  • name of the module's files that are to be merged
$original_file STRING
  • path to the file that originally shipped with sugar
$new_file STRING
  • path to the new file that is shipping with the patch
$custom_file STRING
  • path to the custom file
$save BOOLEAN
  • boolean on if it should save the results to the custom file or not
Returns
Type Description
BOOLEAN - if the merged file was saved if false is passed in for the save parameter it always returns true
methodprotectedmergeField( ARRAY $orig, ARRAY $new, ARRAY $custom ) : ARRAY
inherited

Merges the meta data of a single field

Inherited from: \ListViewMerge::mergeField()
Parameters
Name Type Description
$orig ARRAY
  • the original meta-data for this field
$new ARRAY
  • the new meta-data for this field
$custom ARRAY
  • the custom meta-data for this field
Returns
Type Description
ARRAY $merged - the merged meta-data
methodprotectedmergeFields( ) : void
inherited

Merges the fields together and stores them in $this->mergedFields

Inherited from: \ListViewMerge::mergeFields()
methodprotectedmergeMetaData( ) : void
inherited

Parses out the fields for each files meta data and then calls on mergeFields and setPanels

Inherited from: \EditViewMerge::mergeMetaData()\ListViewMerge::mergeMetaData()
methodprotectedmergeTemplateMeta( ) : void
inherited

Merge the templateMeta entry for the view defs. Also assume that any changes made in the custom files should have precedence since they must be changed manually, even over new files that may be provided in the upgarde patch.

Inherited from: \EditViewMerge::mergeTemplateMeta()\ListViewMerge::mergeTemplateMeta()
methodpublicsave( STRING $to ) : BOOLEAN

This will save the merged data to a file

Parameters
Name Type Description
$to STRING
  • path of the file to save it to
Returns
Type Description
BOOLEAN - success or failure of the save
methodpublicsetBestMatch( BOOLEAN $on = true ) : void
inherited

Allows the user to choose to use the best match algorithim or not

Inherited from: \EditViewMerge::setBestMatch()\ListViewMerge::setBestMatch()
Parameters
Name Type Description
$on BOOLEAN
methodpublicsetDefaultPanel( STRING $name = 'default' ) : void
inherited

Allows users to set the name to use as the default panel in the meta data

Inherited from: \EditViewMerge::setDefaultPanel()\ListViewMerge::setDefaultPanel()
Parameters
Name Type Description
$name STRING
  • name of the default panel
methodpublicsetLogFile( STRING $file ) : void
inherited

opens the file with the 'a' parameter and use it to log messages to

Inherited from: \EditViewMerge::setLogFile()\ListViewMerge::setLogFile()
Parameters
Name Type Description
$file STRING
  • path to file we wish to log to
methodpublicsetLogFilePointer( \FILEPOINTER $fp ) : void
inherited

Allows the user to set a filepointer that is already open to log to

Inherited from: \EditViewMerge::setLogFilePointer()\ListViewMerge::setLogFilePointer()
Parameters
Name Type Description
$fp \FILEPOINTER
methodprotectedsetPanels( ) : void

We take mergeData which is a copy of the new meta data prior to merging and set it's list_fields variable to the merged panels

Documentation was generated by DocBlox 0.18.1.