eltrino / diamantedesk-application

DiamanteDesk
http://diamantedesk.com/
Other
118 stars 42 forks source link

Front End and Back End Page Return Blank Page #80

Open Jeeva-Rathinam opened 5 years ago

Jeeva-Rathinam commented 5 years ago

My Magento ver 1.9.2.3 after installed both frontend and backend DiamanteDesk page return a blank page. How can i solve the issue?

Log Error :

2018-11-27T08:03:04+00:00 ERR (3): exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Eltrino_Diamantedesk_Block_Adminhtml_Sales_Order_Edit_Tab_Tickets' in /home/abc/public_html/app/Mage.php:595

My Block : Diamantedesk_Block_Adminhtml_Sales_Order_Edit_Tab_Tickets :

<?php
/**
 * Copyright (c) 2014 Eltrino LLC (http://eltrino.com)
 *
 * Licensed under the Open Software License (OSL 3.0).
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://opensource.org/licenses/osl-3.0.php
 *
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@eltrino.com so we can send you a copy immediately.
 */

class Eltrino_DiamanteDesk_Block_Adminhtml_Sales_Order_Edit_Tab_Tickets
    extends Eltrino_DiamanteDesk_Block_Adminhtml_Tickets_Grid
    implements Mage_Adminhtml_Block_Widget_Tab_Interface
{

    protected $_columnsToRemove = array('email');

    protected $_reporter;

    public function __construct()
    {
        parent::__construct();
        $this->setId('order_edit_tab_tickets');
        $this->setUseAjax(true);
    }

    public function getTabLabel()
    {
        return $this->__('Tickets');
    }

    public function getTabTitle()
    {
        return $this->__('Tickets');
    }

    public function canShowTab()
    {
        return true;
    }

    public function isHidden()
    {
        return false;
    }

    public function getGridUrl($params = array())
    {
        return $this->getUrl('*/diamantedesk/orderTicketsGrid', array('_current' => true));
    }

    protected function _prepareCollection()
    {
        /** @var Eltrino_DiamanteDesk_Model_Resource_Ticket_Collection $collection */
        $collection = Mage::getModel('eltrino_diamantedesk/ticket')->getCollection();

        $id = $this->getRequest()->getParam('order_id');
        $order = Mage::getModel('sales/order')->load($id);

        $collection->addFieldToFilter(
            'reporter',
            array(
                'eq' => $this->getReporter($order->getCustomerId())
            )
        );

        $collection->setLimitedByOrderRelation($order->getIncrementId());

        $this->setCollection($collection);

        return parent::_prepareCollection();
    }

    protected function _prepareColumns()
    {
        $result = parent::_prepareColumns();

        foreach ($this->_columns as $key => $value) {
            if (in_array($key, $this->_columnsToRemove)) {
                unset($this->_columns[$key]);
            }
        }
        return $result;
    }

    /**
     * @param $customerId
     * @return string
     */
    private function getReporter($customerId)
    {
        $model = Mage::getModel('eltrino_diamantedesk/customerRelation')->load($customerId, 'customer_id');
        if ($model->getId()) {
            return Eltrino_DiamanteDesk_Model_Api::TYPE_DIAMANTE_USER . $model->getUserId();
        }

        return '';
    }
}
northdakota commented 5 years ago

Hi @Jeeva-Rathinam ! Could you also provide please your xml config for rewrite?

Jeeva-Rathinam commented 5 years ago

@northdakota My : app\etc\modules\Eltrino_DiamanteDesk.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Eltrino_DiamanteDesk>
            <active>true</active>
            <codePool>community</codePool>
        </Eltrino_DiamanteDesk>
    </modules>
</config>

How can i solve the issue?

northdakota commented 5 years ago

As i understand you have created a new block file Eltrino/Diamantedesk/Block/Adminhtml/Sales/Order/Edit/Tab/Tickets.php for make it works you also should add your rewrite configuration to file app/code/community/Eltrino/DiamanteDesk/etc/config.xml where should describe your rewrite configuration. For example:

<blocks>
    <catalog><!-- alias of the block group you are rewriting -->
        <rewrite><!-- reserved tag: specify that you are rewriting something -->
             <class_name_here>YourNamespace_YourModule_Block_Your_New_Class_Here</class_name_here> <!-- tag: the rest of the alias of the class you are rewriting. value: the name of your class that rewrites the core class -->
        </rewrite>
    </catalog>
</blocks>

So i need make sure that this part of your code is correct.

Jeeva-Rathinam commented 5 years ago

Yes, app/code/community/Eltrino/DiamanteDesk/etc/config.xml (By Default) Here what i need to change...

<?xml version="1.0"?>
<config>
    <modules>
        <Eltrino_DiamanteDesk>
            <version>1.0.2</version>
        </Eltrino_DiamanteDesk>
    </modules>
    <global>
        <models>
            <eltrino_diamantedesk>
                <class>Eltrino_DiamanteDesk_Model</class>
                <resourceModel>eltrino_diamantedesk_resource</resourceModel>
            </eltrino_diamantedesk>
            <eltrino_diamantedesk_resource>
                <class>Eltrino_DiamanteDesk_Model_Resource</class>
                <entities>
                    <queue>
                        <table>diamantedesk_tickets_queue</table>
                    </queue>
                    <order_relation>
                        <table>diamantedesk_order_relation</table>
                    </order_relation>
                    <customer_relation>
                        <table>diamantedesk_customer_relation</table>
                    </customer_relation>
                </entities>
            </eltrino_diamantedesk_resource>
        </models>
        <resources>
            <eltrino_diamantedesk_setup>
                <setup>
                    <module>Eltrino_DiamanteDesk</module>
                </setup>
            </eltrino_diamantedesk_setup>
        </resources>
        <blocks>
            <eltrino_diamantedesk>
                <class>Eltrino_DiamanteDesk_Block</class>
            </eltrino_diamantedesk>
            <!--<adminhtml>-->
                <!--<rewrite>-->
                    <!--<sales_order_view_info>Eltrino_DiamanteDesk_Block_Adminhtml_Sales_Order_View_Info</sales_order_view_info>-->
                <!--</rewrite>-->
            <!--</adminhtml>-->
        </blocks>
        <helpers>
            <eltrino_diamantedesk>
                <class>Eltrino_DiamanteDesk_Helper</class>
            </eltrino_diamantedesk>
        </helpers>
    </global>
    <crontab>
        <jobs>
            <diamantedesk_export_tickets>
                <schedule>
                    <cron_expr>0/5 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>eltrino_diamantedesk/queue::processQueue</model>
                </run>
            </diamantedesk_export_tickets>
            <diamantedesk_check_queue>
                <schedule>
                    <cron_expr>0 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>eltrino_diamantedesk/observer::checkQueue</model>
                </run>
            </diamantedesk_check_queue>
        </jobs>
    </crontab>
    <frontend>
        <routers>
            <diamantedesk>
                <use>standard</use>
                <args>
                    <module>Eltrino_DiamanteDesk</module>
                    <frontName>diamantedesk</frontName>
                </args>
            </diamantedesk>
        </routers>
        <layout>
            <updates>
                <eltrino_diamantedesk>
                    <file>eltrino/diamantedesk.xml</file>
                </eltrino_diamantedesk>
            </updates>
        </layout>
    </frontend>
    <adminhtml>
        <layout>
            <updates>
                <eltrino_diamantedesk>
                    <file>eltrino/diamantedesk.xml</file>
                </eltrino_diamantedesk>
            </updates>
        </layout>
    </adminhtml>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Eltrino_DiamanteDesk before="Mage_Adminhtml">Eltrino_DiamanteDesk_Adminhtml</Eltrino_DiamanteDesk>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>