本文整理汇总了PHP中SugarController类的典型用法代码示例。如果您正苦于以下问题:PHP SugarController类的具体用法?PHP SugarController怎么用?PHP SugarController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SugarController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getController
/**
* Obtain an instance of the correct controller.
*
* @return an instance of SugarController
*/
function getController($module)
{
$class = ucfirst($module) . 'Controller';
if (file_exists('custom/modules/' . $module . '/controller.php')) {
$customClass = 'Custom' . $class;
require_once 'custom/modules/' . $module . '/controller.php';
if (class_exists($customClass)) {
$controller = new $customClass();
} else {
if (class_exists($class)) {
$controller = new $class();
}
}
} elseif (file_exists('modules/' . $module . '/controller.php')) {
require_once 'modules/' . $module . '/controller.php';
if (class_exists($class)) {
$controller = new $class();
}
} else {
$controller = new SugarController();
}
//setup the controller
$controller->setup($module);
return $controller;
}
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:30,代码来源:ControllerFactory.php
示例2: display
function display()
{
$this->dv->process();
echo '<style type="text/css">@import url("custom/modules/ACLRoles/styles/securitygroups.css"); </style>';
$file = SugarController::getActionFilename($this->action);
$this->includeClassicFile('modules/' . $this->module . '/' . $file . '.php');
}
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:7,代码来源:view.classic.php
示例3: getController
/**
* Obtain an instance of the correct controller.
*
* @return an instance of SugarController
*/
function getController($module)
{
if (SugarAutoLoader::requireWithCustom("modules/{$module}/controller.php")) {
$class = SugarAutoLoader::customClass(ucfirst($module) . 'Controller');
} else {
SugarAutoLoader::requireWithCustom('include/MVC/Controller/SugarController.php');
$class = SugarAutoLoader::customClass('SugarController');
}
if (class_exists($class, false)) {
$controller = new $class();
}
if (empty($controller)) {
$controller = new SugarController();
}
//setup the controller
$controller->setup($module);
return $controller;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:ControllerFactory.php
示例4: display
/**
* @see SugarView::display()
*/
public function display()
{
// Call SugarController::getActionFilename to handle case sensitive file names
$file = SugarController::getActionFilename($this->action);
$classic = SugarAutoLoader::existingCustomOne('modules/' . $this->module . '/' . $file . '.php');
if ($classic) {
$this->includeClassicFile($classic);
return true;
}
return false;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:view.classic.php
示例5: display
/**
* @see SugarView::display()
*/
public function display()
{
// Call SugarController::getActionFilename to handle case sensitive file names
$file = SugarController::getActionFilename($this->action);
if (file_exists('custom/modules/' . $this->module . '/' . $file . '.php')) {
$this->includeClassicFile('custom/modules/' . $this->module . '/' . $file . '.php');
return true;
} elseif (file_exists('modules/' . $this->module . '/' . $file . '.php')) {
$this->includeClassicFile('modules/' . $this->module . '/' . $file . '.php');
return true;
}
return false;
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:16,代码来源:view.classic.php
示例6: display
/**
* @see SugarView::display()
*/
public function display()
{
if ($this->bean instanceof SugarBean && isset($this->view_object_map['remap_action']) && !$this->bean->ACLAccess($this->view_object_map['remap_action'])) {
ACLController::displayNoAccess(true);
return false;
}
// Call SugarController::getActionFilename to handle case sensitive file names
$file = SugarController::getActionFilename($this->action);
$classic_file = SugarAutoLoader::existingCustomOne('modules/' . $this->module . '/' . $file . '.php');
if ($classic_file) {
$this->includeClassicFile($classic_file);
return true;
}
return false;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:view.classic.php
示例7: action_save
function action_save()
{
$old_id = null;
$isLinked = false;
if (isset($_POST['isLinked'])) {
$isLinked = $_POST['isLinked'] == 'true' ? true : false;
}
// create new version of Addition and update Contract idsofadditions field since we are creating new version of Addition
if (!$isLinked && !empty($this->bean->contractid)) {
if (!$this->bean->is_latest) {
$latestVersion = $this->bean->getLatestRevision();
$old_id = $latestVersion->id;
$this->bean->version = intval($latestVersion->version + 1);
} else {
$old_id = $this->bean->id;
$this->bean->version = intval($this->bean->version + 1);
}
//$GLOBALS['log']->fatal('going branch 1');
unset($this->bean->id);
unset($this->bean->{$this->bean->table_name . '_number'});
$this->bean->deleted = 0;
$this->bean->nextrevisions = '';
$this->bean->is_latest = 1;
//1.7.6
$this->bean->previousrevision = $old_id;
SugarController::action_save();
//retrieve saved bean for oqc...number that is created during save
$oqc_fld_number = $this->bean->table_name . '_number';
$savedBean = new $this->bean->object_name();
if ($savedBean->retrieve($this->bean->id)) {
$this->bean->{$oqc_fld_number} = intval($savedBean->{$oqc_fld_number});
}
// 1.7.6 Keep generated svnumber for all future references
if (empty($this->bean->svnumber)) {
$this->bean->fill_in_svnumber();
}
$this->bean->oqc_delete_relationships($this->bean->id);
// deleting documents and services- will be recreated during save
//Recreate relationship to original contract
$contract = 'oqc_contract';
$this->bean->load_relationship($contract);
$this->bean->oqc_contract->add($this->bean->contractid);
//Update idsofadditions linked of contract
$linkedContract = new oqc_Contract();
if ($linkedContract->retrieve($this->bean->contractid)) {
$linkedContract->idsofadditions = str_replace($old_id, $this->bean->id, $linkedContract->idsofadditions);
$linkedContract->save();
}
} elseif ($isLinked) {
if ($this->bean->deleted == 1) {
$this->bean->mark_undeleted($this->bean->id);
}
$this->bean->deleted = 0;
$this->bean->is_latest = 1;
//$GLOBALS['log']->fatal('going branch 3');
//retrieve saved bean for oqc...number that is created during save
$oqc_fld_number = $this->bean->table_name . '_number';
$savedBean = new $this->bean->object_name();
if ($savedBean->retrieve($this->bean->id)) {
$this->bean->{$oqc_fld_number} = intval($savedBean->{$oqc_fld_number});
}
// 1.7.6 Keep generated svnumber for all future references
if (empty($this->bean->svnumber)) {
$this->bean->fill_in_svnumber();
}
$this->bean->oqc_delete_relationships($this->bean->id);
// deleting documents and services- will be recreated during save
//Recreate relationship to original contract
$contract = 'oqc_contract';
$this->bean->load_relationship($contract);
$this->bean->oqc_contract->add($this->bean->contractid);
// Add new addition to the list of idsofadditions
$linkedContract = new oqc_Contract();
if ($linkedContract->retrieve($this->bean->contractid)) {
$linkedContract->idsofadditions = $linkedContract->idsofadditions . " " . $this->bean->id;
$linkedContract->save();
}
}
if (isset($_POST['servicesVAT'])) {
$this->bean->vat = $_POST['servicesVAT'];
} else {
if (isset($_POST['servicesOnceVAT'])) {
$this->bean->vat = $_POST['servicesOnceVAT'];
}
}
$this->saveAttachedDocuments();
$this->saveTextblocks();
$this->saveServices();
if (!isset($_POST['assigned_user_id'])) {
$this->bean->assigned_user_id = $this->bean->created_by;
}
//2.1 set this only if it is not in $_POST
SugarController::action_save();
// redirect to new version
$this->return_id = $this->bean->id;
$this->return_module = $this->module;
// If previous version exist, hide it and update nextrevision field
if ($old_id != '') {
$oldBean = new $this->bean->object_name();
if ($oldBean->retrieve($old_id)) {
//.........这里部分代码省略.........
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:101,代码来源:controller.php
示例8: MailMergeController
function MailMergeController()
{
parent::SugarController();
}
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:4,代码来源:controller.php
示例9: KReportsController
public function KReportsController()
{
ini_set('display_errors', '0');
parent::SugarController();
}
开发者ID:ambientelivre,项目名称:GeneratorTargetList,代码行数:5,代码来源:controller.php
示例10: EmployeesController
function EmployeesController()
{
parent::SugarController();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:4,代码来源:controller.php
示例11: process
function process()
{
if (!is_admin($GLOBALS['current_user']) && in_array($this->action, $this->admin_actions)) {
$this->hasAccess = false;
}
parent::process();
}
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:7,代码来源:controller.php
示例12: execute
/**
* Perform execution of the application. This method is called from index2.php
*
* @param Request $request
*/
function execute(Request $request)
{
global $sugar_config;
if (!empty($sugar_config['default_module'])) {
$this->default_module = $sugar_config['default_module'];
}
$module = $this->default_module;
if (!empty($_REQUEST['module'])) {
$module = $_REQUEST['module'];
}
insert_charset_header();
$this->setupPrint();
$this->controller = ControllerFactory::getController($module);
// if the entry point is defined to not need auth, then don't authenicate
if (!$request->has('entryPoint') || $this->controller->checkEntryPointRequiresAuth($request->query('entryPoint'))) {
$this->loadUser();
$this->ACLFilter();
$this->preProcess();
$this->getController()->preProcess();
$this->checkHTTPReferer();
}
SugarThemeRegistry::buildRegistry();
$this->loadLanguages();
$this->checkDatabaseVersion();
$this->loadDisplaySettings();
$this->loadLicense();
$this->loadGlobals();
$this->setupResourceManagement($module);
$this->getController()->execute();
sugar_cleanup();
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:36,代码来源:SugarApplication.php
示例13: pre_save
public function pre_save()
{
require_once 'include/upload_file.php';
$upload_file = new UploadFile('filename_file');
if (isset($_FILES['filename_file']) && $upload_file->confirm_upload()) {
$filename = $upload_file->get_stored_file_name();
$file_ext = $upload_file->file_ext;
if (empty($this->bean->id)) {
$this->bean->id = create_guid();
$this->bean->new_with_id = true;
}
$account = null;
if (isset($_POST['xphotobucketaccount_id'])) {
$account = BeanFactory::getBean('xPhotobucketAccounts', $_POST['xphotobucketaccount_id']);
}
// $resp = $account->upload_media('image', $upload_file->temp_file_location, "{$this->bean->id}.{$file_ext}", $_POST['name']);
$resp = $account->upload_media('base64', base64_encode(file_get_contents($upload_file->temp_file_location)), "{$this->bean->id}.{$file_ext}", $_POST['name']);
$this->bean->browse_url = $resp['browseurl'];
$this->bean->image_url = $resp['url'];
$this->bean->thumb_url = $resp['thumb'];
} else {
echo "Upload file error";
sugar_cleanup(true);
}
parent::pre_save();
}
开发者ID:sunmo,项目名称:snowlotus,代码行数:26,代码来源:controller.php
示例14: process
public function process()
{
if (!is_admin($GLOBALS['current_user']) && !is_admin_for_module($GLOBALS['current_user'], 'Contracts')) {
$this->hasAccess = false;
}
parent::process();
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:controller.php
示例15:
function action_listview()
{
if ($_REQUEST['state_in_chart']) {
$this->correctStateFilterFromChart();
}
parent::action_listview();
}
开发者ID:pixprod,项目名称:Regoluna-Invoices-for-SugarCRM,代码行数:7,代码来源:controller.php
示例16: preProcess
public function preProcess()
{
parent::preProcess();
global $current_user;
if (!$current_user->isAdmin()) {
sugar_die("Non-admin users are not allowed to access the admin area.");
}
}
开发者ID:mihir-parikh,项目名称:sugarcrm_playground,代码行数:8,代码来源:controller.php
示例17: post_delete
protected function post_delete()
{
if (!empty($_REQUEST['return_url'])) {
$_REQUEST['return_url'] = urldecode($_REQUEST['return_url']);
$this->redirect_url = $_REQUEST['return_url'];
} else {
parent::post_delete();
}
}
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:9,代码来源:controller.php
示例18: process
function process()
{
$GLOBALS['log']->info(get_class($this) . ":");
global $current_user;
$access = $current_user->getDeveloperModules();
if ($current_user->isAdmin() || $current_user->isDeveloperForAnyModule() && !isset($_REQUEST['view_module']) && (isset($_REQUEST['action']) && $_REQUEST['action'] != 'package') || isset($_REQUEST['view_module']) && (in_array($_REQUEST['view_module'], $access) || empty($_REQUEST['view_module'])) || isset($_REQUEST['type']) && ($_REQUEST['type'] == 'dropdowns' && $current_user->isDeveloperForAnyModule() || $_REQUEST['type'] == 'studio' && displayStudioForCurrentUser() == true)) {
$this->hasAccess = true;
} else {
$this->hasAccess = false;
}
parent::process();
}
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:12,代码来源:controller.php
示例19: process
function process()
{
$GLOBALS['log']->info(get_class($this) . ":");
global $current_user;
$access = get_admin_modules_for_user($current_user);
if (is_admin($current_user) || is_admin_for_any_module($current_user) && !isset($_REQUEST['view_module']) && (isset($_REQUEST['action']) && $_REQUEST['action'] != 'package') || isset($_REQUEST['view_module']) && (in_array($_REQUEST['view_module'], $access) || empty($_REQUEST['view_module'])) || isset($_REQUEST['type']) && ($_REQUEST['type'] == 'dropdowns' && is_admin_for_any_module($current_user) || $_REQUEST['type'] == 'studio' && displayStudioForCurrentUser() == true)) {
$this->hasAccess = true;
} else {
$this->hasAccess = false;
}
parent::process();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:12,代码来源:controller.php
示例20: process
function process()
{
if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'basic_search') {
$this->modifySearch('subject_basic');
$this->modifySearch('description_basic');
} else {
if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
$this->modifySearch('name_advanced');
$this->modifySearch('description_advanced');
}
}
parent::process();
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:13,代码来源:controller.php
注:本文中的SugarController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论