getUrl('*/*/createTicketPost', array('_secure' => Mage::app()->getStore(true)->isCurrentlySecure())); } /** * @return array */ public function getDepartmentOptionList() { return AW_Helpdesk3_Model_Source_Department::toOptionArrayForStoreId(); } /** * @return array */ public function getPriorityOptionList() { return AW_Helpdesk3_Model_Source_Ticket_Priority::toOptionArray(Mage::app()->getStore()->getId()); } /** * @return array */ public function getOrderOptionList() { if (null === $this->_cachedOrderOptionList) { $customerEmail = Mage::getSingleton('customer/session')->getCustomer()->getEmail(); $collection = Mage::getModel('sales/order')->getCollection(); $collection->addFieldToFilter('customer_email', $customerEmail); $this->_cachedOrderOptionList = array(); $this->_cachedOrderOptionList[] = array('value' => '', 'label' => $this->__('Unassigned')); foreach ($collection as $order) { /** @var Mage_Sales_Model_Order $order */ $this->_cachedOrderOptionList[] = array( 'value' => $order->getId(), 'label' => $order->getIncrementId() . ', ' . $this->formatDate($order->getCreatedAtStoreDate()) . ', ' . $order->formatPrice($order->getGrandTotal()) ); } } return $this->_cachedOrderOptionList; } /** * @param int|string $priorityId * * @return bool */ public function isPriorityDefault($priorityId) { return intval($priorityId) == AW_Helpdesk3_Model_Source_Ticket_Priority::TODO_VALUE; } /** * @param int|string $departmentId * * @return bool */ public function isDepartmentDefault($departmentId) { return intval($departmentId) == AW_Helpdesk3_Helper_Config::getDefaultDepartmentId(); } /** * @return bool */ public function isCanShowDepartment() { return AW_Helpdesk3_Helper_Config::isCanShowDepartmentSelectorOnTicketCreate(); } /** * @return bool */ public function isCanShowPriority() { return AW_Helpdesk3_Helper_Config::isCanShowPrioritySelectorOnTicketCreate(); } /** * @return bool */ public function isCanShowOrderAssign() { return AW_Helpdesk3_Helper_Config::isCanShowOrderSelectorOnTicketCreate() && count($this->getOrderOptionList()) > 0 ; } /** * @return bool */ public function isCanShowAttachment() { return AW_Helpdesk3_Helper_Config::isAllowCustomerToAttachFilesOnFrontend(); } /** * file size in Mb * * @return null|int */ public function getMaxAvailableFileSize() { $fileSizeInMb = AW_Helpdesk3_Helper_Config::getMaxUploadFileSizeOnFrontend(); if ($fileSizeInMb <= 0) { return null; } return $fileSizeInMb; } /** * @return array */ public function getAvailableFileExtensionList() { return explode(',', AW_Helpdesk3_Helper_Config::getAllowFileExtension()); } }