コード例 #1
0
 /**
  * @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
0
 /**
  * @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
0
ファイル: view.send.php プロジェクト: sunmo/snowlotus
 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
0
 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
0
ファイル: view.reply.php プロジェクト: sunmo/snowlotus
 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
0
ファイル: view.importorder.php プロジェクト: sunmo/snowlotus
 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
0
ファイル: view.themesettings.php プロジェクト: NALSS/SuiteCRM
 /**
  * @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
0
 /**
  * @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
0
ファイル: view.automessage.php プロジェクト: sunmo/snowlotus
 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();
 }