public function display() { global $current_user; echo $this->getModuleTitle(); $this->ss->assign("RETURN_MODULE", $_REQUEST['return_module']); $this->ss->assign("RETURN_ACTION", $_REQUEST['return_action']); $this->ss->assign("RETURN_ID", $_REQUEST['return_id']); $zendesk_helper = new ZendeskHelper(); $zendesk_instance = $zendesk_helper->getConfigValue('instance'); if ($zendesk_instance == null) { echo "Thank you for installing Zendesk for SugarCRM.<br/>"; echo "Administrators, please start with <a href='index.php?module=zd_Tickets&action=config'>configuring your Zendesk credentials</a>."; } else { $connection = getZendeskConnection(); $this->ss->assign('zendesk_instance', $connection->url()); $this->ss->assign('current_user_id', '_' . $current_user->user_name); $this->ss->assign('zendesk_login', $zendesk_helper->getPersonalConfigValue('login')); $this->ss->assign('per_page', $zendesk_helper->getConfigValue('per_page', '6')); $this->ss->assign('sort', $zendesk_helper->getConfigValue('sort', '1')); $this->ss->assign('order_by', $zendesk_helper->getConfigValue('order_by', 'priority')); $this->ss->assign('status_filter', $zendesk_helper->getConfigValue('status_filter', 'lsolved')); $this->ss->assign('priority_filter', $zendesk_helper->getConfigValue('priority_filter', 'any')); $this->ss->assign('type_filter', $zendesk_helper->getConfigValue('type_filter', 'any')); $this->ss->assign('statusoptions', $zendesk_helper->getStatusFilterOptions()); $this->ss->assign('priorityoptions', $zendesk_helper->getPriorityFilterOptions()); $this->ss->assign('typeoptions', $zendesk_helper->getTypeFilterOptions()); $this->ss->assign('columns', $zendesk_helper->getColumnOptions()); $this->ss->display('modules/zd_Tickets/tpls/personalconfig.tpl'); } }
function ViewMacro() { parent::SugarView(); $this->connection = getZendeskConnection(); $this->bean = new zd_Tickets(); $this->bean->load_from_db($_REQUEST['record']); }
function zd_Tickets() { $this->users = array(); parent::zd_Tickets_sugar(); try { $this->connection = getZendeskConnection(); } catch (Exception $e) { $this->error_message = $e->getMessage(); } $this->can_update = true; $this->can_edit_tags = true; $this->can_comment = true; $this->can_public_comment = true; }
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(); } }