YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Groups/views/Edit.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
/* +***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 * Contributor(s): YetiForce S.A.
 * *********************************************************************************** */

class Settings_Groups_Edit_View extends Settings_Vtiger_Index_View
{
    /**
     * Process.
     *
     * @param \App\Request $request
     */
    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
        $record = $request->isEmpty('record') ? false : $request->getInteger('record');
        if ($record) {
            $recordModel = Settings_Groups_Record_Model::getInstance($record);
        } else {
            $recordModel = Settings_Groups_Record_Model::getCleanInstance();
        }
        $viewer->assign('STRUCTURE', $recordModel->getModule()->getEditViewStructure($recordModel));
        $viewer->assign('MEMBER_GROUPS', Settings_Groups_Member_Model::getAll(true));
        $viewer->assign('RECORD_MODEL', $recordModel);
        $viewer->assign('RECORD_ID', $record);
        $viewer->assign('MODULE', $moduleName);
        $viewer->view('Edit.tpl', $qualifiedModuleName);
    }

    /** {@inheritdoc} */
    public function getFooterScripts(App\Request $request)
    {
        return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
            "modules.Settings.{$request->getModule()}.resources.Edit",
        ]));
    }
}