/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: ......
 * Generated at: 2020-07-15 09:51:56 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import jun.db.core.*;
import java.net.*;
import java.io.*;
import wiseoa.util.*;
import wiseoa.flow.appletrpc.*;
import java.util.*;
import java.net.*;
import wiseoa.*;
import wiseoa.util.*;
import wiseoa.RBAC.*;
import wiseoa.mail.jstl.*;

public final class script_005fedit_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  static {
    _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(1);
    _jspx_dependants.put("/rightverify.jsp", Long.valueOf(1476341677059L));
  }

  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody;

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.release();
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write(" \n");
      out.write(" \n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("\r\n");
  
	
	//éå¸¸æ¯å¯¹äºé£æ­¤éè¦æç®¡çåæéçé¡µé¢ç¨åå«æ¬é¡µé¢çæ¹å¼æ¥è¿è¡æéæ§å¶
	// å¦æå½åç¨æ·æç®¡çåæéï¼é£ä¹ç´æ¥è¿å
	// å¦æå½åé¡µé¢æ²¡æå å¥å°å·¥ä½å°ä¸­ï¼è¡¨ç¤ºæ²¡æè¿è¡é¢å¤ææï¼é£ä¹æç¤ºæ æé
	//å¦æå å¥å°äºå·¥ä½å°ï¼å¹¶ä¸åéå½åç¨æ·æ¥ææéï¼é£ä¹ok 
	User user=User.getUserFromRequest( request);
	 
	 if ( user.getRole()!=1) //å¦æä¸æ¯ç³»ç»ç®¡çæéçäººï¼
	 {
		 	String url =WiseFilter.getShortURL( request); 
			int unit = user.getUnit();
		 
			RBAC_cache cache = RBAC_cache.getInstance(null, unit);
 			if (!cache.needVerify(url)) 
 			{
 				String s= User.TIP_NORIGHT;
	 			response.sendRedirect( "SystemTip.jsp?info="+  URLEncoder.encode(s,"UTF-8") );
	 			return;
			} 

            //å¦æä¹æ²¡æè¿è¡å·¥ä½å°ææ
  	 		if ( ! WiseFilter.urlOnCommision( user, url ,0) ) 
			{ 
 	    		String s= User.TIP_NORIGHT;
	 			response.sendRedirect( "SystemTip.jsp?info="+  URLEncoder.encode(s,"UTF-8") );
	 			return;
			}
	 
	 }


      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write(" \n");
      out.write(" ");

 
	String file=FF.GetStringFromRequest(request,"filename","");
    
	String fullfile=LoadFlowFormConfig.getFlowFormRoot()+ File.separator+file;
	 
	String script= FF.ReadFile( fullfile);
	
	String mode=file.substring( file.lastIndexOf("." )+1 );
	if( mode.equals("js") ) FF.pageContextSetAttribute(pageContext,"mode", "javascript" );
	if( mode.equals("xml") ) FF.pageContextSetAttribute(pageContext,"mode", "xml" );
	
 
 
 
      out.write("\n");
      out.write(" \n");
      out.write("<!doctype html>\n");
      out.write("<HTML>\n");
      out.write("<head>\n");
      out.write(" \n");
      out.write("<link rel=\"stylesheet\" href=\"codemirror/codemirror.css\" />\n");
      out.write("<script src=\"codemirror/codemirror.js\"></script>\n");
      out.write("<script src=\"codemirror/");
      if (_jspx_meth_c_005fout_005f0(_jspx_page_context))
        return;
      out.write(".js\"></script>\n");
      out.write("\n");
      out.write("<SCRIPT type=\"text/javascript\" src=\"js/jsrsClient_rev.js\"></SCRIPT>\t \n");
      out.write(" <script type=\"text/javascript\" src=\"js/domutil.js\"></script>\n");
      out.write("\n");
      out.write("<style>\n");
      out.write(".CodeMirror {\n");
      out.write("    border-top: 1px solid lightgray;\n");
      out.write("    border-bottom: 1px solid lightgray;\n");
      out.write("\tfont-family:Courier New;\n");
      out.write("\tfont-size:12px;\n");
      out.write("\tline-height:19px;\n");
      out.write("\t \n");
      out.write("\tposition:absolute;\n");
      out.write("\t \n");
      out.write("\n");
      out.write("\twidth:100%;\n");
      out.write("\theight:93%;\n");
      out.write("\tleft:0;\n");
      out.write(" \n");
      out.write("\ttop:30px;\n");
      out.write("\t\n");
      out.write("}\n");
      out.write("        </style>\n");
      out.write(" \n");
      out.write(" <link href=\"menu3/css/shou.css\" rel=\"stylesheet\" type=\"text/css\" />\n");
      out.write("<script type=\"text/javascript\" src=\"menu3/js/ddlevelsmenu.js\"></script>\n");
      out.write("<script type=\"text/javascript\">\n");
      out.write("//顶部菜单栏示例\n");
      out.write("ddlevelsmenu.setup(\"ddtopmenubar\", \"topbar\")\n");
      out.write("</script>\n");
      out.write(" </head>\n");
      out.write(" \n");
      out.write(" <body style=\"overflow:hidden;  background-color:#efefef;margin:0; \" scroll=\"no\">\n");
      out.write(" \n");
      out.write(" <div id=\"ddtopmenubar\" class=\"mattblackmenu\" style=\"positon:absolute; left:0;top:0;width:100%; height:30px; z-index:9999;\">\n");
      out.write("\t<ul>\n");
      out.write("\t   <!--  <li><a title=\"\"  href=\"javascript:web/\" rel=\"\">&nbsp;</a></li>\n");
      out.write("\t\t<li><a title=\"\"  href=\"javascript:web/\" rel=\"ddsubmenu1\">表单相关事件</a></li>\n");
      out.write("\t\t<li><a title=\"\"  href=\"javascript:js/\" rel=\"ddsubmenu2\">工作流相关事件</a></li>\n");
      out.write("\t  -->\n");
      out.write("\t\t<li><a   href=\"javascript:save();\"  style=\"background-color:#329b00\">&nbsp;&nbsp;&nbsp;&nbsp;保&nbsp;&nbsp;存&nbsp;&nbsp;&nbsp;&nbsp;</a></li>\n");
      out.write("\t\t\n");
      out.write(" \n");
      out.write("\t</ul>\n");
      out.write("</div><!--mattblackmenu end-->\n");
      out.write("\n");
      out.write("<ul id=\"ddsubmenu1\" class=\"ddsubmenustyle\">\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('flowOpen');\">表单打开事件(单据/流程/报表/对话框都有效)</a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('newOpen')\">新增单据或流程时表单打开事件 </a></li>\n");
      out.write("\t <li><a title=\"\"  href=\"javascript:scriptlet('editOpen')\">编辑单据或流程时表单打开事件</a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('viewOpen')\">查看单据或流程时表单打开事件 </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('flowClose')\">表单关闭事件(不一定能执行) </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('saveOnClick')\">点击保存按钮或flow.save()被调用时执行 </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('saveIsNeeded')\">是否有额外的数据需要保存</a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('beforeSave')\">保存前的准备</a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('afterSaveSuccessful')\">保存成功后事件 </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('newOpen')\">新增单据或流程时表单打开事件 </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('newOpen')\">新增单据或流程时表单打开事件 </a></li>\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:scriptlet('newOpen')\">新增单据或流程时表单打开事件 </a></li>\n");
      out.write("\t\n");
      out.write("\t\n");
      out.write("</ul>\n");
      out.write("<!--ddsubmenustyle end-->\n");
      out.write("\n");
      out.write("<ul id=\"ddsubmenu2\" class=\"ddsubmenustyle\">\n");
      out.write("\t<li><a title=\"\"  href=\"javascript:\">确认提交且尚未提交前的事件</a></li>\n");
      out.write("</ul>\n");
      out.write("<!--ddsubmenustyle end-->\n");
      out.write(" \n");
      out.write(" \n");
      out.write(" \n");
      out.write("<textarea id=\"code\" name=\"code\"  >");
      out.print(script);
      out.write("</textarea> \n");
      out.write(" \n");
      out.write("        \n");
      out.write("<script>\n");
      out.write("window.onload = function() {\n");
      out.write("  var mime = 'text/");
      if (_jspx_meth_c_005fout_005f1(_jspx_page_context))
        return;
      out.write("';\n");
      out.write(" \n");
      out.write("  window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {\n");
      out.write("    mode: mime,\n");
      out.write("\n");
      out.write("    indentWithTabs: true,\n");
      out.write("    smartIndent: true,\n");
      out.write("    lineNumbers: true,\n");
      out.write("    matchBrackets : true,\n");
      out.write("    autofocus: true\n");
      out.write("  });\n");
      out.write("};\n");
      out.write("\n");
      out.write("window.onresize=function()\n");
      out.write("{\n");
      out.write("\tvar size=getWindowSize();\n");
      out.write("\t\n");
      out.write("\tvar h=size.height;\n");
      out.write("\t//无效\n");
      out.write("\t//$E('code').style.height= (h-40)+\"px\";\n");
      out.write("\t\n");
      out.write("\t \n");
      out.write("}\n");
      out.write("\n");
      out.write("function save()\n");
      out.write("{\n");
      out.write("\tvar s= editor.getValue()  ;\n");
      out.write("\tvar f=\"");
      if (_jspx_meth_c_005fout_005f2(_jspx_page_context))
        return;
      out.write("\";\n");
      out.write("\tjsrsExecute(\"servlet/wiseoa.flow.jsprpc.FlowManage\", callback, \"scriptEditSave\", [f,s],false);\n");
      out.write("}\n");
      out.write("\n");
      out.write(" function  callback (msg)\n");
      out.write(" {\n");
      out.write("\t\tif (extractValue(msg ,\"ok\")==\"true\") \n");
      out.write("\t\t{\n");
      out.write("\t\t\talert(\"保存成功。\");\n");
      out.write("\t\t}else\n");
      out.write("\t\t{\n");
      out.write("\t\t  alert ( extractValue(msg, \"error\"));\n");
      out.write("\t\t}\n");
      out.write(" }\n");
      out.write("\t\n");
      out.write(" \n");
      out.write(" function   scriptlet( evt)\n");
      out.write(" {\n");
      out.write("\t var func=  eval(\"script_\"+evt);\n");
      out.write(" \n");
      out.write("\t var str=func();\n");
      out.write("\t editor.replaceSelection(str); \n");
      out.write("\t \n");
      out.write("\n");
      out.write(" }\n");
      out.write(" \n");
      out.write(" function script_flowOpen ( )\n");
      out.write(" {\n");
      out.write("\t return \"function flowOpen()\\n\"+\n");
      out.write("\t \t\"{\\n\"+\n");
      out.write("\t\t \"}\\n\" ;\n");
      out.write("\t \n");
      out.write("\t \n");
      out.write(" }\n");
      out.write(" \n");
      out.write("\n");
      out.write("\t\t \n");
      out.write(" \n");
      out.write("</script>\n");
      out.write(" \n");
      out.write(" </body>\n");
      out.write(" ");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_c_005fout_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:out
    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
    _jspx_th_c_005fout_005f0.setPageContext(_jspx_page_context);
    _jspx_th_c_005fout_005f0.setParent(null);
    // /script_edit.jsp(39,24) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fout_005f0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${mode}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
    int _jspx_eval_c_005fout_005f0 = _jspx_th_c_005fout_005f0.doStartTag();
    if (_jspx_th_c_005fout_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f0);
    return false;
  }

  private boolean _jspx_meth_c_005fout_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:out
    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
    _jspx_th_c_005fout_005f1.setPageContext(_jspx_page_context);
    _jspx_th_c_005fout_005f1.setParent(null);
    // /script_edit.jsp(116,19) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fout_005f1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${mode}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
    int _jspx_eval_c_005fout_005f1 = _jspx_th_c_005fout_005f1.doStartTag();
    if (_jspx_th_c_005fout_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f1);
    return false;
  }

  private boolean _jspx_meth_c_005fout_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:out
    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_005fout_005f2 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
    _jspx_th_c_005fout_005f2.setPageContext(_jspx_page_context);
    _jspx_th_c_005fout_005f2.setParent(null);
    // /script_edit.jsp(143,8) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fout_005f2.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${param.filename}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
    int _jspx_eval_c_005fout_005f2 = _jspx_th_c_005fout_005f2.doStartTag();
    if (_jspx_th_c_005fout_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fout_0026_005fvalue_005fnobody.reuse(_jspx_th_c_005fout_005f2);
    return false;
  }
}
