예제 #1
0
 protected function setupAdvancedTabUserSettings()
 {
     global $current_user, $locale, $app_strings, $app_list_strings, $sugar_config;
     // This is for the "Advanced" tab, it's not controlled by the metadata UI so we have to do more for it.
     $this->ss->assign('EXPORT_DELIMITER', $this->bean->getPreference('export_delimiter'));
     if ($this->bean->receive_notifications || !isset($this->bean->id) && $admin->settings['notify_send_by_default']) {
         $this->ss->assign("RECEIVE_NOTIFICATIONS", "checked");
     }
     //jc:12293 - modifying to use the accessor method which will translate the
     //available character sets using the translation files
     $export_charset = $locale->getExportCharset('', $this->bean);
     $export_charset_options = $locale->getCharsetSelect();
     $this->ss->assign('EXPORT_CHARSET', get_select_options_with_id($export_charset_options, $export_charset));
     $this->ss->assign('EXPORT_CHARSET_DISPLAY', $export_charset);
     //end:12293
     if ($this->bean->getPreference('use_real_names') == 'on' || empty($this->bean->id) && isset($GLOBALS['sugar_config']['use_real_names']) && $GLOBALS['sugar_config']['use_real_names'] && $this->bean->getPreference('use_real_names') != 'off') {
         $this->ss->assign('USE_REAL_NAMES', 'CHECKED');
     }
     if ($this->bean->getPreference('mailmerge_on') == 'on') {
         $this->ss->assign('MAILMERGE_ON', 'checked');
     }
     if ($this->bean->getPreference('no_opps') == 'on') {
         $this->ss->assign('NO_OPPS', 'CHECKED');
     }
     $reminder_time = $this->bean->getPreference('reminder_time');
     if (empty($reminder_time)) {
         $reminder_time = -1;
     }
     $email_reminder_time = $this->bean->getPreference('email_reminder_time');
     if (empty($email_reminder_time)) {
         $email_reminder_time = -1;
     }
     $this->ss->assign("REMINDER_TIME_OPTIONS", $app_list_strings['reminder_time_options']);
     $this->ss->assign("EMAIL_REMINDER_TIME_OPTIONS", $app_list_strings['reminder_time_options']);
     $this->ss->assign("REMINDER_TIME", $reminder_time);
     $this->ss->assign("EMAIL_REMINDER_TIME", $email_reminder_time);
     $remindersDefaultPreferences = Reminder::loadRemindersDefaultValuesData();
     $this->ss->assign("REMINDER_CHECKED", $remindersDefaultPreferences['popup']);
     $this->ss->assign("EMAIL_REMINDER_CHECKED", $remindersDefaultPreferences['email']);
     $this->ss->assign("REMINDER_TABINDEX", "12");
     $publish_key = $this->bean->getPreference('calendar_publish_key');
     $this->ss->assign('CALENDAR_PUBLISH_KEY', $publish_key);
     $publish_url = $sugar_config['site_url'] . '/vcal_server.php';
     $token = "/";
     //determine if the web server is running IIS
     //if so then change the publish url
     if (isset($_SERVER) && !empty($_SERVER['SERVER_SOFTWARE'])) {
         $position = strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'iis');
         if ($position !== false) {
             $token = '?parms=';
         }
     }
     $publish_url .= $token . "type=vfb&source=outlook&key=<span id=\"cal_pub_key_span\">{$publish_key}</span>";
     if (!empty($this->bean->email1)) {
         $publish_url .= '&email=' . $this->bean->email1;
     } else {
         $publish_url .= '&user_name=' . $this->bean->user_name;
     }
     $ical_url = $sugar_config['site_url'] . "/ical_server.php?type=ics&key=<span id=\"ical_pub_key_span\">{$publish_key}</span>";
     if (!empty($this->bean->email1)) {
         $ical_url .= '&email=' . $this->bean->email1;
     } else {
         $ical_url .= '&user_name=' . $this->bean->user_name;
     }
     $this->ss->assign("CALENDAR_PUBLISH_URL", $publish_url);
     $this->ss->assign("CALENDAR_SEARCH_URL", $sugar_config['site_url'] . "/vcal_server.php/type=vfb&key=<span id=\"search_pub_key_span\">{$publish_key}</span>&email=%NAME%@%SERVER%");
     $this->ss->assign("CALENDAR_ICAL_URL", $ical_url);
     $this->ss->assign("SETTINGS_URL", $sugar_config['site_url']);
 }