本文整理汇总了PHP中SugarView::process方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarView::process方法的具体用法?PHP SugarView::process怎么用?PHP SugarView::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarView
的用法示例。
在下文中一共展示了SugarView::process方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if default_theme is valid
if (isset($_REQUEST['default_theme']) && !in_array($_REQUEST['default_theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("Default theme is invalid.");
}
if (isset($_REQUEST['disabled_themes'])) {
$toDecode = html_entity_decode($_REQUEST['disabled_themes'], ENT_QUOTES);
$disabledThemes = json_decode($toDecode, true);
if (($key = array_search(SugarThemeRegistry::current()->__toString(), $disabledThemes)) !== FALSE) {
unset($disabledThemes[$key]);
}
$_REQUEST['disabled_themes'] = implode(',', $disabledThemes);
$configurator = new Configurator();
$configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
$configurator->config['default_theme'] = $_REQUEST['default_theme'];
$configurator->handleOverride();
echo "true";
} else {
parent::process();
}
}
示例2: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (is_admin($current_user) && isset($_REQUEST['disabled_themes'])) {
$_REQUEST['disabled_themes'] = explode(',', $_REQUEST['disabled_themes']);
if (($key = array_search(SugarThemeRegistry::current()->__toString(), $_REQUEST['disabled_themes'])) !== FALSE) {
unset($_REQUEST['disabled_themes'][$key]);
}
$_REQUEST['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
$configurator = new Configurator();
$configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
$configurator->handleOverride();
}
parent::process();
}
示例3: process
function process()
{
$account = BeanFactory::getBean('xeBayAccounts', $this->bean->xebayaccount_id);
$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];
$questionType = $_REQUEST['question_type'];
$itemID = $_REQUEST['item_id'];
if (empty($message) || empty($subject) || empty($itemID)) {
header("Location: index.php?module=xeBayOrders&action=DetailView&record={$this->bean->id}");
}
$x = new AddMemberMessageAAQToPartner();
$res = $x->addMemberMessage(array('AccountID' => $account->id, 'AuthToken' => $account->ebay_auth_token, 'ItemID' => $itemID, 'Body' => $message, 'QuestionType' => $questionType, 'RecipientID' => $this->bean->buyer_user_id, 'Subject' => $subject));
if ($res == true) {
header("Location: index.php?module=xeBayOrders&action=DetailView&record={$this->bean->id}");
}
parent::process();
}
示例4: testprocess
public function testprocess()
{
$SugarView = new SugarView();
$SugarView->module = 'Users';
$GLOBALS['app'] = new SugarApplication();
//execute the method and check if it works and doesn't throws an exception
//secondly check if it outputs any content to browser
try {
ob_start();
$SugarView->process();
$renderedContent = ob_get_contents();
ob_end_clean();
$this->assertGreaterThan(0, strlen($renderedContent));
} catch (Exception $e) {
$this->fail();
}
}
示例5: process
function process()
{
$account = BeanFactory::getBean('xeBayAccounts', $this->bean->xebayaccount_id);
$subject = $_REQUEST['subject'];
$response = $_REQUEST['response'];
if (empty($response)) {
header("Location: index.php?module=xeBayMessages&action=index");
}
$x = new AddMemberMessageRTQ();
$res = $x->addMemberMessage(array('AccountID' => $account->id, 'AuthToken' => $account->ebay_auth_token, 'ItemID' => $this->bean->item_id, 'Body' => $response, 'ParentMessageID' => $this->bean->message_id, 'RecipientID' => $this->bean->sender_id));
if ($res == true) {
$this->bean->insert_response($response);
$this->message_status = 'Answered';
$this->bean->save();
header("Location: index.php?module=xeBayMessages&action=index");
}
parent::process();
}
示例6: process
function process()
{
$numberOfDays = isset($_REQUEST['number_of_days']) ? $_REQUEST['number_of_days'] : 1;
$orders = new GetOrders();
$accounts = array();
if (!empty($_REQUEST['ebay_account_name'])) {
$name = $_REQUEST['ebay_account_name'];
$bean = BeanFactory::getBean('xeBayAccounts');
$accounts = $bean->get_accounts($name);
}
date_default_timezone_set("America/Los_Angeles");
set_time_limit(60 * 30);
foreach ($accounts as $id => $authToken) {
$result = $orders->retrieveOrders(array('NumberOfDays' => $numberOfDays, 'OrderStatus' => 'Completed', 'AccountID' => $id, 'AuthToken' => $authToken));
}
parent::process();
// $this->display();
}
示例7: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if default_theme is valid
if (isset($_REQUEST['default_theme']) && !in_array($_REQUEST['default_theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("Default theme is invalid.");
}
if (isset($_REQUEST['disabled_themes'])) {
$configurator = new Configurator();
$configurator->config['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
$configurator->config['default_theme'] = $_REQUEST['default_theme'];
$configurator->handleOverride();
}
parent::process();
}
示例8: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if the theme is valid
if (!isset($_REQUEST['theme']) || !in_array($_REQUEST['theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("theme is invalid.");
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
$theme_config = SugarThemeRegistry::getThemeConfig($_REQUEST['theme']);
$configurator = new Configurator();
foreach ($theme_config as $name => $def) {
if (isset($_REQUEST[$name])) {
if ($_REQUEST[$name] == 'true') {
$_REQUEST[$name] = true;
} else {
if ($_REQUEST[$name] == 'false') {
$_REQUEST[$name] = false;
}
}
$configurator->config['theme_settings'][$_REQUEST['theme']][$name] = $_REQUEST[$name];
}
}
$configurator->handleOverride();
SugarApplication::redirect('index.php?module=Administration&action=ThemeSettings');
exit;
}
parent::process();
}
示例9: process
function process()
{
$api = new GetFeedback();
foreach ($this->accounts as $id => $authToken) {
$result = $api->retrieveFeedback(array('AuthToken' => $authToken));
}
$bean = BeanFactory::getBean('xeBayOrders');
$shippedTime30Days = date('Y-m-d H:i:s', strtotime($GLOBALS['timedate']->nowDb() . ' -30 days'));
$where = "handled_status='handled' AND shipped_time>'{$shippedTime30Days}' AND feedback_received='0'";
$beans = $bean->get_full_list("", $where);
if ($beans !== null) {
foreach ($beans as &$bean) {
$shipped_time = strtotime($bean->shipped_time);
$current_time = strtotime($GLOBALS['timedate']->nowDb());
$diff_time = intval(($current_time - $shipped_time) / 3600 / 24);
if ($diff_time > 22) {
if ($bean->buyer_comfort_status != '25th Day') {
$this->send_comfort_message($bean, '25th Day', $diff_time);
$this->lessThan30Days[] = $bean->sales_record_number;
}
} else {
if ($diff_time > 15) {
if ($bean->buyer_comfort_status != '15th Day') {
$this->send_comfort_message($bean, '15th Day', $diff_time);
$this->lessThan25Days[] = $bean->sales_record_number;
}
} else {
if ($diff_time > 7) {
if ($bean->buyer_comfort_status != '7th Day') {
$this->send_comfort_message($bean, '7th Day', $diff_time);
$this->lessThan15Days[] = $bean->sales_record_number;
}
} else {
$this->lessThan7Days[] = $bean->sales_record_number;
}
}
}
}
}
parent::process();
}