-2

I have create a new module and then I did not have in there a directory "view", so I copied that directory from another module and pasted that in my module but then I have a problem with "Edit.php".

Then my page is completely white, it doesn't load but when I change the name of edit.php it then works.

Can anyone explain to me what do I need to do to modify my module or to do something with my problem.

Edit file:

Class Products_Edit_View extends Vtiger_Edit_View {

    public function process(Vtiger_Request $request) {
        $moduleName = $request->getModule();
        $recordId = $request->get('record');
        $recordModel = $this->record;
        if(!$recordModel){
            if (!empty($recordId)) {
                $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
            } else {
                $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
            }
        }

        $baseCurrenctDetails = $recordModel->getBaseCurrencyDetails();

        $viewer = $this->getViewer($request);
        $viewer->assign('BASE_CURRENCY_NAME', 'curname' . $baseCurrenctDetails['currencyid']);
        $viewer->assign('BASE_CURRENCY_ID', $baseCurrenctDetails['currencyid']);
        $viewer->assign('BASE_CURRENCY_SYMBOL', $baseCurrenctDetails['symbol']);
        $viewer->assign('TAXCLASS_DETAILS', $recordModel->getTaxClassDetails());
        $viewer->assign('IMAGE_DETAILS', $recordModel->getImageDetails());

        parent::process($request);
    }

    /**
     * Function to get the list of Script models to be included
     * @param Vtiger_Request $request
     * @return <Array> - List of Vtiger_JsScript_Model instances
     */
    function getHeaderScripts(Vtiger_Request $request) {
        $headerScriptInstances = parent::getHeaderScripts($request);

        $jsFileNames = array(
            'libraries.jquery.multiplefileupload.jquery_MultiFile'
        );

        $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
        $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
        return $headerScriptInstances;
    }

}
NSNoob
  • 5,548
  • 6
  • 41
  • 54
internacional
  • 47
  • 1
  • 7

1 Answers1

1

When you copy a foder from another module you have to change at least the class name. Please try to replace all Products occurrencies with YourModuleName For example at the first line

Class YourModuleName_Edit_View extends Vtiger_Edit_View {