modules/UpgradeWizard/SugarMerge/EditViewMerge.php

Show: inherited
Table of Contents

\EditViewMerge

Package: SugarCRM

This is the base class that all other SugarMerge objects extend

Children
\QuickCreateMerge
\ListViewMerge
\DetailViewMerge

Properties

PropertyprotectedBOOLEAN  $bestMatch= 'true'

If we should use the best match algorithim

Default valuetrueDetails
Type
BOOLEAN
PropertyprotectedARRAY  $customData= 'array()'

this will store the meta data for the custom file

Default valuearray()Details
Type
ARRAY
PropertyprotectedARRAY  $customFields= 'array()'

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

Default valuearray()Details
Type
ARRAY
Propertyprotected  $customPanelIds= 'array()'

The ids of the panels found in custom metadata fuke

Default valuearray()Details
Type
n/a
PropertyprotectedSTRING  $defaultPanel= ''default''

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

Default value'default'Details
Type
STRING
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'), )'

Special case conversion

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
Propertyprotected\FILEPOINTER  $fp= 'NULL'

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

Default valueNULLDetails
Type
\FILEPOINTER
PropertyprotectedBOOLEAN  $isMultiPanel= 'true'

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

Default valuetrueDetails
Type
BOOLEAN
PropertyprotectedINT  $maxCols= '2'

the max number of columns for this view

Default value2Details
Type
INT
PropertyprotectedARRAY  $mergedFields= 'array()'

this will store an associative array contianing all the merged fields

Default valuearray()Details
Type
ARRAY
PropertyprotectedSTRING  $module= ''module''

the name of the module to be merged

Default value'module'Details
Type
STRING
PropertyprotectedARRAY  $newData= 'array()'

this will store the meta data for the new file

Default valuearray()Details
Type
ARRAY
PropertyprotectedARRAY  $newFields= 'array()'

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

Default valuearray()Details
Type
ARRAY
Propertyprotected  $newPanelIds= 'array()'

The ids of the panels found in original metadata fuke

Default valuearray()Details
Type
n/a
PropertyprotectedARRAY  $originalData= 'array()'

this will store the meta data for the original file

Default valuearray()Details
Type
ARRAY
PropertyprotectedARRAY  $originalFields= 'array()'

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

Default valuearray()Details
Type
ARRAY
Propertyprotected  $originalPanelIds= 'array()'

The ids of the panels found in original metadata fuke

Default valuearray()Details
Type
n/a
PropertyprotectedSTRING  $panelName= ''panels''

The name of the panels section in the meta data

Default value'panels'Details
Type
STRING
Propertyprotected\unknown_type  $scanForMultiPanel= 'true'

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

Default valuetrueDetails
Type
\unknown_type
Propertyprotected  $templateMetaName= ''templateMeta''

The name of the templateMeta data secion in the meta data

Default value'templateMeta'Details
Type
n/a
PropertyprotectedSTRING  $varName= ''viewdefs''

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

Default value'viewdefs'Details
Type
STRING
PropertyprotectedSTRING  $viewDefs= ''EditView''

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'EditView'Details
Type
STRING

Methods

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

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

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

Recursiveley merges two arrays

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

Walks through the merged fields and places them in the appropriate place based on their location parameter as well as the choosen algorithim

Returns
Type Description
ARRAY $panels - the new panels section for the merged file
methodprotectedclear( ) : void

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

methodpublicgetData( ) : ARRAY

This will return the meta data of the merged file

Returns
Type Description
ARRAY - the meta data of the merged file
methodprotectedgetFields( ARRAY $panels ) : ARRAY

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

Parameters
Name Type Description
$panels ARRAY
  • this is the 'panel' section of the meta-data
Returns
Type Description
ARRAY $fields - an associate array of fields and their meta-data as well as their location
methodprotectedgetPanelIds(  $panels ) : void

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

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

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

Parameters
Name Type Description
$message \MULTI
methodpublicmerge( STRING $module, STRING $original_file, STRING $new_file, STRING $custom_file = false, BOOLEAN $save = true ) : BOOLEAN

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

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

Merges the meta data of a single field

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

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

methodprotectedmergeMetaData( ) : void

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

methodprotectedmergeTemplateMeta( ) : void

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.

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

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

Parameters
Name Type Description
$on BOOLEAN
methodpublicsetDefaultPanel( STRING $name = 'default' ) : void

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

Parameters
Name Type Description
$name STRING
  • name of the default panel
methodpublicsetLogFile( STRING $file ) : void

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

Parameters
Name Type Description
$file STRING
  • path to file we wish to log to
methodpublicsetLogFilePointer( \FILEPOINTER $fp ) : void

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

Parameters
Name Type Description
$fp \FILEPOINTER
methodprotectedsetPanels( ) : void

Sets the panel section for the meta-data after it has been merged

Documentation was generated by DocBlox 0.18.1.