function get_module_view_defs($moduleName, $type, $view)
 {
     require_once 'include/MVC/View/SugarView.php';
     $metadataFile = null;
     $results = array();
     if (empty($moduleName)) {
         return $results;
     }
     $view = strtolower($view);
     if ($view == 'subpanel') {
         $results = $this->get_subpanel_defs($moduleName, $type);
     } else {
         $v = new SugarView(null, array());
         $v->module = $moduleName;
         $v->type = $view;
         $fullView = ucfirst($view) . 'View';
         $metadataFile = $v->getMetaDataFile();
         require_once $metadataFile;
         if ($view == 'list') {
             $results = $listViewDefs[$moduleName];
         } else {
             $results = $viewdefs[$moduleName][$fullView];
         }
     }
     //Add field level acls.
     $results = $this->addFieldLevelACLs($moduleName, $type, $view, $results);
     return $results;
 }
 function display()
 {
     $GLOBALS['system_notification_buffer'] = array();
     $GLOBALS['buffer_system_notifications'] = true;
     $GLOBALS['system_notification_count'] = 0;
     $sv = new SugarView();
     $sv->includeClassicFile('modules/Administration/DisplayWarnings.php');
     echo $this->_formatNotificationsForQuickDisplay($GLOBALS['system_notification_buffer'], "modules/Notifications/tpls/systemQuickView.tpl");
     $this->clearFTSFlags();
 }
 function get_module_view_defs($moduleName, $type, $view)
 {
     require_once 'include/MVC/View/SugarView.php';
     $metadataFile = null;
     $results = array();
     if (empty($moduleName)) {
         return $results;
     }
     $view = strtolower($view);
     switch (strtolower($type)) {
         case 'wireless':
             if ($view == 'list') {
                 require_once 'include/SugarWireless/SugarWirelessListView.php';
                 $GLOBALS['module'] = $moduleName;
                 //WirelessView keys off global variable not instance variable...
                 $v = new SugarWirelessListView();
                 $results = $v->getMetaDataFile();
                 $results = self::formatWirelessListViewResultsToArray($results);
             } elseif ($view == 'subpanel') {
                 $results = $this->get_subpanel_defs($moduleName, $type);
             } else {
                 require_once 'include/SugarWireless/SugarWirelessView.php';
                 $v = new SugarWirelessView();
                 $v->module = $moduleName;
                 $fullView = ucfirst($view) . 'View';
                 $meta = $v->getMetaDataFile('Wireless' . $fullView);
                 $metadataFile = $meta['filename'];
                 require $metadataFile;
                 //Wireless detail metadata may actually be just edit metadata.
                 $results = isset($viewdefs[$meta['module_name']][$fullView]) ? $viewdefs[$meta['module_name']][$fullView] : $viewdefs[$meta['module_name']]['EditView'];
             }
             break;
         case 'default':
         default:
             if ($view == 'subpanel') {
                 $results = $this->get_subpanel_defs($moduleName, $type);
             } else {
                 $v = new SugarView(null, array());
                 $v->module = $moduleName;
                 $v->type = $view;
                 $fullView = ucfirst($view) . 'View';
                 $metadataFile = $v->getMetaDataFile();
                 require_once $metadataFile;
                 if ($view == 'list') {
                     $results = $listViewDefs[$moduleName];
                 } else {
                     $results = $viewdefs[$moduleName][$fullView];
                 }
             }
     }
     //Add field level acls.
     $results = $this->addFieldLevelACLs($moduleName, $type, $view, $results);
     return $results;
 }
Example #4
0
 function ViewMacro()
 {
     parent::SugarView();
     $this->connection = getZendeskConnection();
     $this->bean = new zd_Tickets();
     $this->bean->load_from_db($_REQUEST['record']);
 }
Example #5
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     parent::SugarView();
     $this->options['show_header'] = false;
     $this->options['show_footer'] = false;
     $this->options['show_javascript'] = false;
 }
Example #6
0
 /**
  * Constructor.
  */
 public function __construct($bean = null, $view_object_map = array())
 {
     parent::__construct($bean, $view_object_map);
     $this->options['show_header'] = false;
     $this->options['show_footer'] = false;
     $this->options['show_javascript'] = false;
 }
 /**
  * @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();
     }
 }
 function preDisplay()
 {
     global $app_list_strings;
     parent::preDisplay();
     $this->calcularInfo();
     $this->infoParties();
 }
Example #9
0
 /**
  * @see SugarView::_getModuleTab()
  */
 protected function _getModuleTab()
 {
     if (!empty($_REQUEST['merge_module'])) {
         return $_REQUEST['merge_module'];
     }
     return parent::_getModuleTab();
 }
Example #10
0
 public function __construct()
 {
     parent::SugarView();
     // this request vars check in controller
     $this->report_module = $_REQUEST['report_module'];
     $this->record = $_REQUEST['record'];
 }
Example #11
0
 public function __construct()
 {
     if (isset($_REQUEST['as_frame']) and $_REQUEST['as_frame'] == "true") {
         $this->options = array('show_header' => true, 'show_title' => false, 'show_subpanels' => false, 'show_search' => false, 'show_footer' => false, 'show_javascript' => true, 'view_print' => true);
         $this->showTitle = false;
     }
     parent::SugarView();
 }
Example #12
0
 function ViewEditFormula()
 {
     $this->options['show_footer'] = false;
     if (isset($_REQUEST['embed']) && $_REQUEST['embed']) {
         $this->options['show_header'] = false;
     }
     parent::SugarView();
 }
Example #13
0
 function ViewSugarpdf()
 {
     parent::SugarView();
     if (isset($_REQUEST["sugarpdf"])) {
         $this->sugarpdf = $_REQUEST["sugarpdf"];
     } else {
         header('Location:index.php?module=' . $_REQUEST['module'] . '&action=DetailView&record=' . $_REQUEST['record']);
     }
 }
Example #14
0
 /**
  * Constructor
  *
  * @see SugarView::SugarView()
  */
 public function __construct()
 {
     $this->options['show_title'] = true;
     $this->options['show_header'] = true;
     $this->options['show_footer'] = true;
     $this->options['show_javascript'] = true;
     $this->options['show_subpanels'] = false;
     $this->options['show_search'] = false;
     parent::__construct();
 }
Example #15
0
 /**
  * Constructor
  *
  * @see SugarView::SugarView()
  */
 public function ViewAjax()
 {
     $this->options['show_title'] = false;
     $this->options['show_header'] = false;
     $this->options['show_footer'] = false;
     $this->options['show_javascript'] = false;
     $this->options['show_subpanels'] = false;
     $this->options['show_search'] = false;
     parent::SugarView();
 }
Example #16
0
 public function __construct()
 {
     global $app_strings;
     parent::__construct();
     foreach ($this->vars as $var) {
         if (!isset($_REQUEST[$var])) {
             sugar_die($app_strings['ERR_MISSING_REQUIRED_FIELDS'] . $var);
         }
         $this->{$var} = $_REQUEST[$var];
     }
 }
Example #17
0
 /**
  * @see SugarView::getMenu()
  */
 public function getMenu($module = null)
 {
     global $mod_strings, $current_language;
     if (empty($module)) {
         $module = $_REQUEST['import_module'];
     }
     $old_mod_strings = $mod_strings;
     $mod_strings = return_module_language($current_language, $module);
     $returnMenu = parent::getMenu($module);
     $mod_strings = $old_mod_strings;
     return $returnMenu;
 }
Example #18
0
 /**
  * display the form
  */
 public function display()
 {
     global $db, $timedate, $current_language;
     parent::display();
     $index = BeanFactory::getBean("AOD_Index");
     $index = $index->getIndex();
     $beanList = $index->getIndexableModules();
     $moduleCounts = array();
     foreach ($beanList as $beanModule => $beanName) {
         $bean = BeanFactory::getBean($beanModule);
         if (!$bean || !method_exists($bean, "getTableName") || !$bean->getTableName()) {
             continue;
         }
         $query = "SELECT COUNT(DISTINCT b.id) FROM " . $bean->getTableName() . " b WHERE b.deleted = 0";
         $moduleCounts[$beanModule] = $db->getOne($query);
     }
     $revisionCount = array_sum($moduleCounts);
     $indexedCount = $db->getOne("SELECT COUNT(*) FROM aod_indexevent WHERE deleted = 0 AND success = 1");
     $failedCount = $db->getOne("SELECT COUNT(*) FROM aod_indexevent WHERE deleted = 0 AND success = 0");
     $indexFiles = count(glob($index->location . "/*.cfs"));
     $this->ss->assign("revisionCount", $revisionCount);
     $this->ss->assign("indexedCount", $indexedCount);
     $this->ss->assign("failedCount", $failedCount);
     $this->ss->assign("index", $index);
     $this->ss->assign("indexFiles", $indexFiles);
     echo $this->ss->fetch('modules/AOD_Index/tpls/indexdata.tpl');
     if ($failedCount) {
         $seed = BeanFactory::newBean("AOD_IndexEvent");
         $lv = new ListViewSmarty();
         $lv->lvd->additionalDetails = false;
         $mod_strings = return_module_language($current_language, $seed->module_dir);
         require 'modules/' . $seed->module_dir . '/metadata/listviewdefs.php';
         if (file_exists('custom/modules/' . $seed->module_dir . '/metadata/listviewdefs.php')) {
             require 'custom/modules/' . $seed->module_dir . '/metadata/listviewdefs.php';
         }
         $lv->displayColumns = $listViewDefs[$seed->module_dir];
         $lv->quickViewLinks = false;
         $lv->export = false;
         $lv->mergeduplicates = false;
         $lv->multiSelect = false;
         $lv->delete = false;
         $lv->select = false;
         $lv->showMassupdateFields = false;
         $lv->email = false;
         $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', 'success = 0', '', 0, 10);
         echo '<br /><br />' . get_form_header($GLOBALS['mod_strings']['LBL_FAILED_RECORDS'] . ' (' . $lv->data['pageData']['offsets']['total'] . ')', '', false);
         if ($lv->data['pageData']['offsets']['total'] == 0) {
             echo "No data";
         } else {
             echo $lv->display();
         }
     }
 }
Example #19
0
 public function __construct()
 {
     $this->fullView = !empty($_REQUEST['full']) ? TRUE : FALSE;
     if ($this->fullView) {
         $this->options = array('show_title' => true, 'show_header' => true, 'show_footer' => true, 'show_javascript' => true, 'show_subpanels' => false, 'show_search' => false);
         $this->templateName = 'fts_full.tpl';
     } else {
         $this->options = array('show_title' => false, 'show_header' => false, 'show_footer' => false, 'show_javascript' => false, 'show_subpanels' => false, 'show_search' => false);
         $this->templateName = 'fts_spot.tpl';
     }
     parent::__construct();
 }
 public function __construct()
 {
     parent::__construct();
     foreach ($this->vars as $var) {
         if (!isset($_REQUEST[$var])) {
             sugar_die("Required paramter {$var} not set in ViewRelFields");
         }
         $this->{$var} = $_REQUEST[$var];
     }
     $mb = new ModuleBuilder();
     $this->package = empty($_REQUEST['package']) || $_REQUEST['package'] == 'studio' ? "" : $mb->getPackage($_REQUEST['package']);
 }
Example #21
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();
 }
Example #22
0
 function __construct()
 {
     parent::SugarView();
     global $current_user;
     if (!$current_user->isDeveloperForModule("Leads")) {
         die("Unauthorized Access to Administration");
     }
     $this->jsonHelper = getJSONobj();
     $this->parser = new ConvertLayoutMetadataParser("Contacts");
     if (isset($_REQUEST['updateConvertDef']) && $_REQUEST['updateConvertDef'] && !empty($_REQUEST['data'])) {
         $this->parser->updateConvertDef(object_to_array_recursive($this->jsonHelper->decode(html_entity_decode_utf8($_REQUEST['data']))));
         // clear the cache for this module only
         MetaDataManager::refreshModulesCache(array('Leads'));
     }
 }
 function reg_invoicesViewAjaxmain()
 {
     $this->options['show_title'] = false;
     $this->options['show_header'] = false;
     $this->options['show_footer'] = false;
     $this->options['show_javascript'] = false;
     $this->options['show_subpanels'] = false;
     $this->options['show_search'] = false;
     parent::SugarView();
     $this->options['show_title'] = false;
     $this->options['show_header'] = false;
     $this->options['show_footer'] = false;
     $this->options['show_javascript'] = false;
     $this->options['show_subpanels'] = false;
     $this->options['show_search'] = false;
 }
Example #24
0
 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();
 }
Example #25
0
 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();
 }
Example #26
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'])) {
         $configurator = new Configurator();
         $configurator->config['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
         $configurator->config['default_theme'] = $_REQUEST['default_theme'];
         $configurator->handleOverride();
     }
     parent::process();
 }
Example #27
0
 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();
 }
Example #28
0
 function ViewAssociated()
 {
     parent::SugarView();
     $zendesk_helper = new ZendeskHelper();
     $this->focus = new $_REQUEST['focus']();
     $this->focus = $this->focus->retrieve($_REQUEST['rec']);
     $this->per_page = $zendesk_helper->getConfigValue('per_page', 6);
     $this->sort = $zendesk_helper->getConfigValue('sort', '1') == 1 ? 'desc' : 'asc';
     $this->order_by = $zendesk_helper->getConfigValue('order_by', 'priority');
     $this->status_filter = $zendesk_helper->getConfigValue('status_filter', 'any');
     $this->priority_filter = $zendesk_helper->getConfigValue('priority_filter', 'lsolved');
     $this->type_filter = $zendesk_helper->getConfigValue('type_filter', 'any');
     if ($_REQUEST['page']) {
         $this->page = $_REQUEST['page'];
     }
     if ($_REQUEST['sort']) {
         $this->sort = $_REQUEST['sort'];
     }
     if ($_REQUEST['order_by']) {
         $this->order_by = $_REQUEST['order_by'];
     }
     if ($_REQUEST['status_filter']) {
         $this->status_filter = $_REQUEST['status_filter'];
     }
     if ($_REQUEST['priority_filter']) {
         $this->priority_filter = $_REQUEST['priority_filter'];
     }
     if ($_REQUEST['type_filter']) {
         $this->type_filter = $_REQUEST['type_filter'];
     }
     $this->error_message = null;
     try {
         $this->connection = getZendeskConnection();
     } catch (Exception $e) {
         $this->error_message = $e->getMessage();
     }
 }
Example #29
0
function get_fts_list($qry_arr, $isMultiSelect = false, $ajaxSort = false)
{
    global $current_language, $current_user;
    global $urlPrefix, $currentModule, $theme;
    $current_module_strings = return_module_language($current_language, 'KBDocuments');
    // focus_list is the means of passing data to a ListView.
    global $focus_list;
    require_once 'include/ListView/ListViewSmarty.php';
    $view = new SugarView();
    $view->type = 'list';
    $view->module = 'KBDocuments';
    $metadataFile = $view->getMetaDataFile();
    require_once $metadataFile;
    require_once 'modules/KBDocuments/KBListViewData.php';
    // clear the display columns back to default when clear query is called
    if (!empty($_REQUEST['clear_query']) && $_REQUEST['clear_query'] == 'true') {
        $current_user->setPreference('ListViewDisplayColumns', array(), 0, $currentModule);
    }
    $savedDisplayColumns = $current_user->getPreference('ListViewDisplayColumns', $currentModule);
    // get user defined display columns
    $json = getJSONobj();
    $seedDocument = BeanFactory::getBean('KBDocuments');
    // seed bean
    // setup listview smarty
    $lv = new ListViewSmarty();
    $lv->lvd = new KBListViewData();
    $displayColumns = array();
    // check $_REQUEST if new display columns from post
    if (!empty($_REQUEST['displayColumns'])) {
        foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
            if (!empty($listViewDefs['KBDocuments'][$col])) {
                $displayColumns[$col] = $listViewDefs['KBDocuments'][$col];
            }
        }
    } elseif (!empty($savedDisplayColumns)) {
        // use user defined display columns from preferences
        $displayColumns = $savedDisplayColumns;
    } else {
        // use columns defined in listviewdefs for default display columns
        foreach ($listViewDefs['KBDocuments'] as $col => $params) {
            if (!empty($params['default']) && $params['default']) {
                $displayColumns[$col] = $params;
            }
        }
    }
    //disable mass update form
    $params = array('massupdate' => false);
    //process orderBy if set in request
    if (!empty($_REQUEST['orderBy'])) {
        $params['orderBy'] = $_REQUEST['orderBy'];
        $params['overrideOrder'] = true;
        if (!empty($_REQUEST['sortOrder'])) {
            $params['sortOrder'] = $_REQUEST['sortOrder'];
        }
    }
    //if ajax sort is set, then pass in param to display columns array that will change
    //the sort urls to be javascript based within tpl
    if ($ajaxSort) {
        foreach ($displayColumns as $col => $coldata) {
            $coldata['ajaxSort'] = true;
            $displayColumns[$col] = $coldata;
        }
    }
    $lv->displayColumns = $displayColumns;
    //grab the where and custom from clauses from passed in query
    $where = '';
    //check to see if param is a string
    if (is_string($qry_arr)) {
        //only the where string is passed in, just populate the where
        $where = $qry_arr;
    } elseif (is_array($qry_arr)) {
        //array was passed in, populate the where and custom_from
        if (isset($qry_arr['where'])) {
            $where = $qry_arr['where'];
        }
        if (isset($qry_arr['custom_from'])) {
            $params['custom_from'] = $qry_arr['custom_from'];
        }
    }
    if (!isset($where)) {
        $where = "";
    }
    global $listViewDefs;
    //disable some features.
    $lv->multiSelect = $isMultiSelect;
    $lv->lvd->additionalDetailsAjax = false;
    $lv->export = false;
    $lv->show_mass_update_form = false;
    $lv->show_action_dropdown = false;
    $lv->delete = false;
    $lv->select = false;
    $lv->setup($seedDocument, 'modules/KBDocuments/SearchListView.tpl', $where, $params);
    $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : ' - ' . $_REQUEST['saved_search_select_name'];
    //if this is a sort from browse tab, then set the ajaxsort flag to true
    if ($ajaxSort) {
        $lv->data['pageData']['urls']['ajaxSort'] = true;
    }
    //begin code that will remove single and double quotes for javascript use
    $temp_Data = array();
    //iterate through each record returned in list
    if (isset($lv->data['data']) && $lv->data['data'] != null) {
        foreach ($lv->data['data'] as $arrRec) {
            //if document name is set, then process
            if (isset($arrRec['KBDOCUMENT_NAME']) && !empty($arrRec['KBDOCUMENT_NAME'])) {
                $GLOBALS['log']->info("name of record getting quotes stripped is: " . $arrRec['KBDOCUMENT_NAME']);
                if (!empty($arrRec['KBDOCUMENT_NAME'])) {
                    $temp_name = $arrRec['KBDOCUMENT_NAME'];
                }
                //replace single and double quotes with empty string
                $temp_name = str_replace('&#039;', '', $temp_name);
                $temp_name = str_replace('\'', '', $temp_name);
                $temp_name = str_replace('&quot;', '', $temp_name);
                $temp_name = str_replace('"', '', $temp_name);
                //set to new element variable that will be used for javascript
                $arrRec['KBDOCUMENT_NAME_js'] = $temp_name;
                $temp_Data[] = $arrRec;
            }
        }
    }
    //set records back into data array
    $lv->data['data'] = $temp_Data;
    //return display string, note that display is taking false as parameter so as to disable
    //massupdate form
    return $lv->display(false);
}
Example #30
0
 public function __construct($bean = null, $view_object_map = array())
 {
     parent::__construct($bean, $view_object_map);
     $this->currentStep = isset($_REQUEST['current_step']) ? $_REQUEST['current_step'] + 1 : 1;
 }