77 lines
2.8 KiB
PHP
Executable File
77 lines
2.8 KiB
PHP
Executable File
<?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.
|
|
* *********************************************************************************** */
|
|
/**s
|
|
* INCLUDE Autoload
|
|
*/
|
|
global $root_directory;
|
|
require_once($root_directory."/modules/Workflow2/autoload_wf.php");
|
|
|
|
class Settings_Workflow2_WorkflowGenerator_View extends Settings_Workflow2_Default_View {
|
|
|
|
function checkPermission(Vtiger_Request $request) {
|
|
return true;
|
|
}
|
|
|
|
public function process(Vtiger_Request $request) {
|
|
$viewer = $this->getViewer($request);
|
|
$qualifiedModuleName = $request->getModule(false);
|
|
|
|
$modules = VtUtils::getEntityModules(true);
|
|
$viewer->assign('modules', $modules);
|
|
|
|
$manager = new \Workflow\AssistentManager();
|
|
$assistents = $manager->getAvailableAssistents();
|
|
|
|
$viewer->assign('Assistents', $assistents);
|
|
$viewer->view('VT7/WorkflowGenerator.tpl',$qualifiedModuleName);
|
|
}
|
|
|
|
|
|
/**
|
|
* 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);
|
|
$moduleName = $request->getModule();
|
|
|
|
$jsFileNames = array(
|
|
"modules.Settings.$moduleName.views.resources.Workflow2",
|
|
);
|
|
|
|
$jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);
|
|
$headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances);
|
|
|
|
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
|
|
foreach($headerScriptInstances as $obj) {
|
|
$src = $obj->get('src');
|
|
if(!empty($src) && strpos($src, $moduleName) !== false) {
|
|
$obj->set('src', $src.'?v='.$moduleModel->version);
|
|
}
|
|
}
|
|
|
|
return $headerScriptInstances;
|
|
}
|
|
function getHeaderCss(Vtiger_Request $request) {
|
|
$headerScriptInstances = parent::getHeaderCss($request);
|
|
$moduleName = $request->getModule();
|
|
|
|
$cssFileNames = array(
|
|
"~layouts/".Vtiger_Viewer::getLayoutName()."/modules/Settings/$moduleName/resources/Workflow2.css",
|
|
);
|
|
|
|
$cssScriptInstances = $this->checkAndConvertCssStyles($cssFileNames);
|
|
$headerStyleInstances = array_merge($headerScriptInstances, $cssScriptInstances);
|
|
|
|
return $headerStyleInstances;
|
|
}
|
|
} |