include/MVC/Controller/SugarController.php

Show: inherited
Table of Contents

\SugarController

Package: SugarCRM

Main SugarCRM controller

Children
\UserPreferencesController
\ModuleBuilderController
\SugarFavoritesController
\ProductCategoriesController
\ReportsController
\ImportController
\UsersController
\TeamsController
\NotesController
\CampaignsController
\OAuthTokensController
\NotificationsController
\EmployeesController
\ContractTypesController
\ProductTemplatesController
\CalendarController
\ConfiguratorController
\EmailManController
\MailMergeController
\LeadsController
\ConnectorsController
\ContactsController
\AdministrationController
\ExpressionEngineController
\WorkflowController
\OAuthKeysController
\EAPMController
\MergeRecordsController
\FileController
Api
 

Properties

Propertyprotectedbool  $_processed= 'false'

Whether or not the action has been handled by $process_tasks

Default valuefalseDetails
Type
bool
Propertypublic  $action= ''index''

The name of the current action.

Default value'index'Details
Type
n/a
Propertypublic  $action_case_file= 'array( 'editview'=>'EditView', 'detailview'=>'DetailView', 'listview'=>'ListView' )'
static

Map case sensitive filenames to action. This is used for linux/unix systems where filenames are case sensitive

Default valuearray( 'editview'=>'EditView', 'detailview'=>'DetailView', 'listview'=>'ListView' )Details
Type
n/a
Propertyprotected  $action_file_map= 'array()'

Map an action directly to a file. This will be loaded from action_file_map.php

Default valuearray()Details
Type
n/a
Propertyprotected  $action_remap= 'array('index'=>'listview')'

remap actions in here e.g. make all detail views go to edit views $action_remap = array('detailview'=>'editview');

Default valuearray('index'=>'listview')Details
Type
n/a
Propertyprotected  $action_view_map= 'array()'

Map an action directly to a view. This will be loaded from action_view_map.php

Default valuearray()Details
Type
n/a
Propertypublic  $bean= 'null'

If a bean is present that set it.

Default valuenullDetails
Type
n/a
Propertyprotected  $do_action= ''index''

If the action was remapped it will be set to do_action and then we will just use do_action for the actual action to perform.

Default value'index'Details
Type
n/a
Propertypublic  $hasAccess= 'true'

This can be set from the application to tell us whether we have authorization to process the action. If this is set we will default to the noaccess view.

Default valuetrueDetails
Type
n/a
Propertypublic  $module= ''Home''

The name of the current module.

Default value'Home'Details
Type
n/a
Propertypublic  $process_tasks= 'array( 'blockFileAccess', 'handleEntryPoint', 'remapWirelessAction', 'callLegacyCode', 'remapAction', 'handle_action', 'handleActionMaps', )'

List of options to run through within the process() method.

This list is meant to easily allow additions for new functionality as well as the ability to add a controller's own handling.

Default valuearray( 'blockFileAccess', 'handleEntryPoint', 'remapWirelessAction', 'callLegacyCode', 'remapAction', 'handle_action', 'handleActionMaps', )Details
Type
n/a
Propertypublic  $record= ''''

The id of the current record.

Default value''Details
Type
n/a
Propertypublic  $redirect_url= ''''

url to redirect to

Default value''Details
Type
n/a
Propertypublic  $return_action= 'null'

The name of the return action.

Default valuenullDetails
Type
n/a
Propertypublic  $return_id= 'null'

The id of the return record.

Default valuenullDetails
Type
n/a
Propertypublic  $return_module= 'null'

The name of the return module.

Default valuenullDetails
Type
n/a
Propertypublic  $target_module= 'null'

The name of the target module.

Default valuenullDetails
Type
n/a
Propertyprotected  $tasks= 'array( 'pre_action', 'do_action', 'post_action' )'

This array holds the methods that handleAction() will invoke, in sequence.

Default valuearray( 'pre_action', 'do_action', 'post_action' )Details
Type
n/a
Propertypublic  $view= ''classic''

any subcontroller can modify this to change the view

Default value'classic'Details
Type
n/a
Propertypublic  $view_object_map= 'array()'

this array will hold the mappings between a key and an object for use within the view.

Default valuearray()Details
Type
n/a

Methods

methodpublicSugarController( ) : void

Constructor. This ie meant tot load up the module, action, record as well as the mapping arrays.

methodprotectedaction_callmethoddashlet( ) : void

this method id used within a Dashlet when performing an ajax call

methodprotectedaction_configuredashlet( ) : void

this method is used within a Dashlet when the options configuration is posted

methodprotectedaction_default( ) : void

Action to handle when using a file as was done in previous versions of Sugar.

methodprotectedaction_delete( ) : void

Perform the actual deletion.

methodprotectedaction_deleteattachment( ) : void

Global method to delete an attachment

If the bean does not have a deleteAttachment method it will return 'false' as a string

methodprotectedaction_listview( ) : void

Perform the listview action

methodprotectedaction_massupdate( ) : void

Perform the actual massupdate.

methodpublicaction_save( ) : void

Perform the actual save

methodpublicaction_spot( ) : void

methodprivateblockFileAccess( ) : true

Given the module and action, determine whether the super/admin has prevented access to this url. In addition if any links specified for this module, load the links into GLOBALS

Returns
Type Description
true if we want to stop processing, false if processing should continue
methodprotectedcallLegacyCode( ) : void

Meant to handle old views e.g. DetailView.php.

methodpubliccheckEntryPointRequiresAuth( \$entrypoint $entryPoint ) : bool

Checks to see if the requested entry point requires auth

Parameters
Name Type Description
$entryPoint \$entrypoint

string name of the entrypoint

Returns
Type Description
bool true if auth is required, false if not
methodprivatedo_action( ) : void

Perform the specified action.

This can be overridde in a sub-class

methodpublicexecute( ) : void
final

This method is called from SugarApplication->execute and it will bootstrap the entire controller process

methodpublicgetActionFilename(  $action ) : void
static

getActionFilename

Parameters
Name Type Description
$action
methodprivatehandleActionMaps( ) : void

If the action has been remapped to a different action as defined in action_file_map.php or action_view_map.php load those maps here.

methodprivatehandleEntryPoint( ) : void

This code is part of the entry points reworking. We have consolidated all entry points to go through index.php. Now in order to bring up an entry point it will follow the format: 'index.php?entryPoint=download' the download entry point is mapped in the following file: entry_point_registry.php

methodprotectedhandleException( \Exception $e ) : void

Handle exception

Parameters
Name Type Description
$e \Exception
methodprotectedhandle_action( ) : true

This method is called from the process method. I could also be called within an action_* method.

It allows a developer to override any one of these methods contained within, or if the developer so chooses they can override the entire action_* method.

Returns
Type Description
true if any one of the pre_, do_, or post_ methods have been defined, false otherwise. This is important b/c if none of these methods exists, then we will run the action_default() method.
methodprotectedhasFunction( \function $function ) : true

Determine if a given function exists on the objects

Parameters
Name Type Description
$function \function
  • the function to check
Returns
Type Description
true if the method exists on the object, false otherwise
methodpublicloadBean( ) : void

Given a record id load the bean. This bean is accessible from any sub controllers.

methodprivateloadMapping(  $var,  $merge = false ) : void

Generic load method to load mapping arrays.

Parameters
Name Type Description
$var
$merge
methodprivateloadMappings( ) : void

Load map files for use within the Controller

methodprivateloadPropertiesFromRequest( ) : void

Set properties on the Controller from the $_REQUEST

methodprotectedno_access( ) : void

The default action handler for instances where we do not have access to process.

methodprotectedno_action( ) : void

If there is no action found then display an error to the user.

methodprivatepost_action( ) : void

Perform an action after to the specified action has occurred.

This can be overridde in a sub-class

methodprotectedpost_delete( ) : void

Specify what happens after the deletion has occurred.

methodprotectedpost_massupdate( ) : void

Specify what happens after the massupdate has occurred.

methodprotectedpost_save( ) : void

Specify what happens after the save has occurred.

methodpublicpreProcess( ) : void

Meant to be overridden by a subclass and allows for specific functionality to be injected prior to the process() method being called.

methodprivatepre_action( ) : void

Perform an action prior to the specified action.

This can be overridde in a sub-class

methodpublicpre_save( ) : void

Do some processing before saving the bean to the database.

methodpublicprocess( ) : void

if we have a function to support the action use it otherwise use the default action

1) check for file 2) check for action

methodprivateprocessView( ) : void

Display the appropriate view.

methodprotectedredirect( ) : void

Perform redirection based on the redirect_url

methodprotectedremapAction( ) : void

Actually remap the action if required.

methodprivateremapWirelessAction( ) : void

Remap the action to the wireless equivalent if the module supports it and the user is on a mobile device. Also, map wireless actions to normal ones if the user is not using a wireless device.

methodpublicsetModule( object $module ) : void

Set the module on the Controller

Parameters
Name Type Description
$module object
methodprotectedset_redirect( string $url ) : void

Set the url to which we will want to redirect

Parameters
Name Type Description
$url string

url - the url to which we will want to redirect

methodpublicsetup(  $module = '' ) : void

Called from SugarApplication and is meant to perform the setup operations on the controller.

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