/
var
/
www
/
html
/
sugardemo
/
modules
/
WorkFlowActionShells
/
Upload File
HOME
<?php /* * Your installation or use of this SugarCRM file is subject to the applicable * terms available at * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/. * If you do not agree to all of the applicable terms or do not have the * authority to bind the entity as an authorized representative, then do not * install or use this SugarCRM file. * * Copyright (C) SugarCRM Inc. All rights reserved. */ /********************************************************************************* * Description: ********************************************************************************/ global $theme; global $app_strings; global $app_list_strings; global $mod_strings; global $urlPrefix; global $currentModule; $seed_object = BeanFactory::newBean('WorkFlow'); if (!empty($_REQUEST['workflow_id']) && $_REQUEST['workflow_id'] != '') { $seed_object->retrieve($_REQUEST['workflow_id']); } else { sugar_die("You shouldn't be here"); } //////////////////////////////////////////////////////// // Start the output //////////////////////////////////////////////////////// if (!isset($_REQUEST['html'])) { $form = new XTemplate('modules/WorkFlowActionShells/CreateStep1.html'); $GLOBALS['log']->debug('using file modules/WorkFlowActionShells/CreateStep1.html'); } else { $_REQUEST['html'] = preg_replace('/[^a-zA-Z0-9_]/', '', $_REQUEST['html']); $GLOBALS['log']->debug("_REQUEST['html'] is " . $_REQUEST['html']); $form = new XTemplate('modules/WorkFlowActionShells/' . $_REQUEST['html'] . '.html'); $GLOBALS['log']->debug('using file modules/WorkFlowActionShells/' . $_REQUEST['html'] . '.html'); } $form->assign('MOD', $mod_strings); $form->assign('APP', $app_strings); $focus = BeanFactory::newBean('WorkFlowActionShells'); //Add When Expressions Object is availabe //$exp_object = new Expressions(); if (isset($_REQUEST['record']) && isset($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } //Bug 12335: We need to include the javascript language file first. And also the language file in WorkFlow is needed. if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) { jsLanguage::createAppStringsCache($GLOBALS['current_language']); } $javascript_language_files = getVersionedScript("cache/jsLanguage/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']); if (!is_file(sugar_cached('jsLanguage/') . $this->module . '/' . $GLOBALS['current_language'] . '.js')) { jsLanguage::createModuleStringsCache($this->module, $GLOBALS['current_language']); } $javascript_language_files .= getVersionedScript("cache/jsLanguage/{$this->module}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']); if (!is_file(sugar_cached('jsLanguage/WorkFlow/') . $GLOBALS['current_language'] . '.js')) { jsLanguage::createModuleStringsCache('WorkFlow', $GLOBALS['current_language']); } $javascript_language_files .= getVersionedScript("cache/jsLanguage/WorkFlow/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']); $the_javascript = "<script type='text/javascript' language='JavaScript'>\n"; $the_javascript .= "function set_return() {\n"; $the_javascript .= ' window.opener.document.EditView.submit();'; $the_javascript .= "}\n"; $the_javascript .= "</script>\n"; $form->assign('ID', $focus->id); $form->assign('WORKFLOW_ID', $_REQUEST['workflow_id']); $form->assign('BASE_MODULE', $seed_object->base_module); //BEGIN - WFLOW PLUGINS INFORMATION////// global $process_dictionary; $plugin_array = get_plugin('workflow', 'action_createstep1', $focus); if (!empty($plugin_array)) { $form->assign('PLUGIN_JAVASCRIPT1', $plugin_array['jscript_part1']); $form->assign('PLUGIN_JAVASCRIPT2', $plugin_array['jscript_part2']); } //END - WFLOW PLUGINS INFORMATION////// $form->assign('JAVASCRIPT_LANGUAGE_FILES', $javascript_language_files); $form->assign('MODULE_NAME', $currentModule); //$form->assign("FORM", $_REQUEST['form']); $form->assign('GRIDLINE', $gridline); $form->assign('SET_RETURN_JS', $the_javascript); insert_popup_header($theme); $form->parse('embeded'); $form->out('embeded'); //////////New way of processing page $ProcessView = new ProcessView($seed_object, $focus); $ProcessView->no_count = true; $ProcessView->write('ActionsCreateStep1'); $form->assign('TOP_BLOCK', $ProcessView->top_block); $form->assign('BOTTOM_BLOCK', $ProcessView->bottom_block); //close window and refresh parent if needed if (!empty($_REQUEST['special_action']) && $_REQUEST['special_action'] == 'refresh') { $special_javascript = "window.opener.document.DetailView.action.value = 'DetailView'; \n"; $special_javascript .= "window.opener.document.DetailView.submit(); \n"; $special_javascript .= 'window.close();'; $form->assign('SPECIAL_JAVASCRIPT', $special_javascript); } $form->parse('main'); $form->out('main'); insert_popup_footer();