Esempio n. 1
0
 function display()
 {
     global $app_list_strings;
     $this->ss->assign('APP_LIST', $app_list_strings);
     if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'set_target') {
         require_once 'modules/Campaigns/utils.php';
         //call function to create campaign logs
         $mess = track_campaign_prospects($this->bean);
         $confirm_msg = "var ajax_C_LOG_Status = new SUGAR.ajaxStatusClass(); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",1000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 1500); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",2000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 5000); ";
         $this->ss->assign("MSG_SCRIPT", $confirm_msg);
     }
     if ($this->bean->campaign_type == 'Email' || $this->bean->campaign_type == 'NewsLetter') {
         $this->ss->assign("ADD_BUTTON_STATE", "submit");
         $this->ss->assign("TARGET_BUTTON_STATE", "hidden");
     } else {
         $this->ss->assign("ADD_BUTTON_STATE", "hidden");
         $this->ss->assign("DISABLE_LINK", "display:none");
         $this->ss->assign("TARGET_BUTTON_STATE", "submit");
     }
     $currency = new Currency();
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($this->bean->currency_id);
         if ($currency->deleted != 1) {
             $this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
         } else {
             $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
         }
     } else {
         $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
     }
     parent::display();
     //We want to display subset of available, panels, so we will call subpanel
     //object directly instead of using sugarview.
     $GLOBALS['focus'] = $this->bean;
     require_once 'include/SubPanel/SubPanelTiles.php';
     $subpanel = new SubPanelTiles($this->bean, $this->module);
     //get available list of subpanels
     $alltabs = $subpanel->subpanel_definitions->get_available_tabs();
     if (!empty($alltabs)) {
         //iterate through list, and filter out all but 3 subpanels
         foreach ($alltabs as $key => $name) {
             if ($name != 'prospectlists' && $name != 'emailmarketing' && $name != 'tracked_urls') {
                 //exclude subpanels that are not prospectlists, emailmarketing, or tracked urls
                 $subpanel->subpanel_definitions->exclude_tab($name);
             }
         }
         //only show email marketing subpanel for email/newsletter campaigns
         if ($this->bean->campaign_type != 'Email' && $this->bean->campaign_type != 'NewsLetter') {
             //exclude emailmarketing subpanel if not on an email or newsletter campaign
             $subpanel->subpanel_definitions->exclude_tab('emailmarketing');
             // Bug #49893  - 20120120 - Captivea (ybi) - Remove trackers subpanels if not on an email/newsletter campaign (useless subpannl)
             $subpanel->subpanel_definitions->exclude_tab('tracked_urls');
         }
     }
     //show filtered subpanel list
     echo $subpanel->display();
 }
Esempio n. 2
0
 function display()
 {
     if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'set_target') {
         require_once 'modules/Campaigns/utils.php';
         //call function to create campaign logs
         $mess = track_campaign_prospects($this->bean);
         $confirm_msg = "var ajax_C_LOG_Status = new SUGAR.ajaxStatusClass(); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",1000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 1500); \n            window.setTimeout(\"ajax_C_LOG_Status.showStatus('" . $mess . "')\",2000); \n            window.setTimeout('ajax_C_LOG_Status.hideStatus()', 5000); ";
         $this->ss->assign("MSG_SCRIPT", $confirm_msg);
     }
     # tracy: use the sms.lang.php language file to override the regular Campaign lang
     if ($this->bean->campaign_type == "SMS") {
         global $mod_strings;
         $mod_strings['LBL_QUEUE_BUTTON_LABEL'] = "Send SMS";
     }
     if ($this->bean->campaign_type == 'Email' || $this->bean->campaign_type == 'NewsLetter' || $this->bean->campaign_type == 'SMS') {
         $this->ss->assign("ADD_BUTTON_STATE", "submit");
         $this->ss->assign("TARGET_BUTTON_STATE", "hidden");
     } else {
         $this->ss->assign("ADD_BUTTON_STATE", "hidden");
         $this->ss->assign("DISABLE_LINK", "display:none");
         $this->ss->assign("TARGET_BUTTON_STATE", "submit");
     }
     $currency = new Currency();
     if (isset($this->bean->currency_id) && !empty($this->bean->currency_id)) {
         $currency->retrieve($this->bean->currency_id);
         if ($currency->deleted != 1) {
             $this->ss->assign('CURRENCY', $currency->iso4217 . ' ' . $currency->symbol);
         } else {
             $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
         }
     } else {
         $this->ss->assign('CURRENCY', $currency->getDefaultISO4217() . ' ' . $currency->getDefaultCurrencySymbol());
     }
     parent::display();
     //We want to display subset of available, panels, so we will call subpanel
     //object directly instead of using sugarview.
     $GLOBALS['focus'] = $this->bean;
     require_once 'include/SubPanel/SubPanelTiles.php';
     $subpanel = new SubPanelTiles($this->bean, $this->module);
     //get available list of subpanels
     # tracy: change the title key of email marketing subpanel for SMS
     if ($this->bean->campaign_type == "SMS") {
         $subpanel->subpanel_definitions->layout_defs['subpanel_setup']['emailmarketing']['title_key'] = "SMS Маркетинг";
     }
     $alltabs = $subpanel->subpanel_definitions->get_available_tabs();
     if (!empty($alltabs)) {
         //iterate through list, and filter out all but 3 subpanels
         foreach ($alltabs as $key => $name) {
             if ($this->bean->campaign_type == 'SMS' && $name == 'tracked_urls') {
                 # tracy: hide trackers for SMS
                 $subpanel->subpanel_definitions->exclude_tab($name);
             } elseif ($name != 'prospectlists' && $name != 'emailmarketing' && $name != 'tracked_urls') {
                 //exclude subpanels that are not prospectlists, emailmarketing, or tracked urls
                 $subpanel->subpanel_definitions->exclude_tab($name);
             }
         }
         //only show email marketing subpanel for email/newsletter campaigns
         # tracy: include SMS
         if ($this->bean->campaign_type != 'Email' && $this->bean->campaign_type != 'NewsLetter' && $this->bean->campaign_type != 'SMS') {
             //exclude subpanels that are not prospectlists, emailmarketing, or tracked urls
             $subpanel->subpanel_definitions->exclude_tab('emailmarketing');
         }
     }
     //show filtered subpanel list
     $this->options['show_subpanels'] = 0;
     echo $subpanel->display();
 }