scheduler_add.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="java.util.*,
  3.  java.text.*,
  4.  cn.js.fan.util.*,
  5.  com.redmoon.oa.flow.*,
  6.  cn.js.fan.cache.jcs.*,
  7.  cn.js.fan.web.*,
  8.  com.redmoon.oa.pvg.*,
  9.  com.redmoon.oa.kernel.*,
  10.  com.redmoon.oa.job.*,
  11.  com.cloudwebsoft.framework.base.*"
  12. %>
  13. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <link href="default.css" rel="stylesheet" type="text/css">
  16. <script src="../inc/common.js"></script>
  17. <script>
  18. function findObj(theObj, theDoc)
  19. {
  20.   var p, i, foundObj;
  21.   
  22.   if(!theDoc) theDoc = document;
  23.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  24.   {
  25.     theDoc = parent.frames[theObj.substring(p+1)].document;
  26.     theObj = theObj.substring(0,p);
  27.   }
  28.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  29.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  30.     foundObj = theDoc.forms[i][theObj];
  31.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  32.     foundObj = findObj(theObj,theDoc.layers[i].document);
  33.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  34.   
  35.   return foundObj;
  36. }
  37. function SelectDateTime(objName) {
  38. var dt = showModalDialog("../util/calendar/time.htm", "" ,"dialogWidth:266px;dialogHeight:125px;status:no;help:no;");
  39. if (dt!=null)
  40. findObj(objName).value = dt;
  41. }
  42. function form1_onsubmit() {
  43. var t = form1.time.value;
  44. var ary = t.split(":");
  45. var weekDay = getCheckboxValue("weekDay");
  46. var dayOfMonth = form1.month_day.value;
  47. if (weekDay=="" && dayOfMonth=="") {
  48. alert("请填写每月几号或者星期几!");
  49. return false;
  50. }
  51. if (weekDay=="")
  52. weekDay = "?";
  53. if (ary[2].indexOf("0")==0 && ary[2].length>1)
  54. ary[2] = ary[2].substring(1, ary[2].length);
  55. if (ary[1].indexOf("0")==0 && ary[1].length>1)
  56. ary[1] = ary[1].substring(1, ary[1].length);
  57. if (ary[0].indexOf("0")==0 && ary[0].length>1)
  58. ary[0] = ary[0].substring(1, ary[0].length);
  59. if (dayOfMonth=="")
  60. dayOfMonth = "?";
  61. var cron = ary[2] + " " + ary[1] + " " + ary[0] + " " + dayOfMonth + " * " + weekDay;
  62. form1.cron.value = cron;
  63. if (form1.flowCode.value=="not") {
  64. alert("请选择流程!");
  65. return false;
  66. }
  67. form1.data_map.value = form1.flowCode.value;
  68. }
  69. function trimOptionText(strValue) 
  70. {
  71. // 注意option中有全角的空格,所以不直接用trim
  72. var r = strValue.replace(/^ *|s*|s*$/g,"");
  73. return r;
  74. }
  75. </script>
  76. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  77. <%
  78. String priv="admin";
  79. if (!privilege.isUserPrivValid(request,priv)) {
  80.     out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  81. return;
  82. }
  83. String op = ParamUtil.get(request, "op");
  84. if (op.equals("add")) {
  85. QObjectMgr qom = new QObjectMgr();
  86. JobUnitDb ju = new JobUnitDb();
  87. try {
  88. if (qom.create(request, ju, "scheduler_add"))
  89. out.print(StrUtil.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "scheduler_list.jsp"));
  90. else
  91. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
  92. }
  93. catch (ErrMsgException e) {
  94. out.print(StrUtil.Alert_Back(e.getMessage()));
  95. }
  96. }
  97. %>
  98. <table cellSpacing="0" cellPadding="0" width="100%">
  99.   <tbody>
  100.     <tr>
  101.       <td class="head">添加调度&nbsp;&nbsp;<span style="PADDING-LEFT: 10px"><a href="scheduler_list.jsp">调度中心</a></span></td>
  102.     </tr>
  103.   </tbody>
  104. </table>
  105. <br>
  106. <TABLE 
  107. style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" 
  108. cellSpacing=0 cellPadding=3 width="95%" align=center>
  109.   <!-- Table Head Start-->
  110.   <TBODY>
  111.     <TR>
  112.       <TD class=thead style="PADDING-LEFT: 10px" noWrap width="70%">&nbsp;</TD>
  113.     </TR>
  114.     <TR class=row style="BACKGROUND-COLOR: #fafafa">
  115.       <TD height="175" align="center" style="PADDING-LEFT: 10px">
  116.     <p>&nbsp;        </p>
  117.         <table width="94%" border="0">
  118. <form name="form1" action="?op=add" method="post" onsubmit="return form1_onsubmit()">
  119.           <tr>
  120.             <td align="left"><strong>调度流程</strong></td>
  121.           </tr>
  122.           <tr>
  123.             <td align="left">选择流程:
  124.               <select name="flowCode" onchange="if(this.options[this.selectedIndex].value=='not'){alert(this.options[this.selectedIndex].text+' 不能被选择!'); return false;} form1.job_name.value=trimOptionText(this.options[this.selectedIndex].text) ">
  125.               <%
  126. Leaf lf = new Leaf();
  127. lf = lf.getLeaf("root");
  128. DirectoryView dv = new DirectoryView(lf);
  129. dv.ShowDirectoryAsOptions(request, out, lf, 1);
  130.   %>
  131.             </select>
  132. <input name="job_class" type="hidden" value="com.redmoon.oa.job.WorkflowJob">
  133. 名称:
  134. <input name="job_name">
  135. &nbsp;每月:<input name="month_day" size="2">
  136. 号<input name="user_name" value="<%=privilege.getUser(request)%>" type="hidden"></td>
  137.           </tr>
  138.           <tr>
  139.             <td align="left">
  140. 开始时间
  141. <input style="WIDTH: 50px" value="12:00:00" name="time" size="20">
  142. &nbsp;<img style="CURSOR: hand" onclick="SelectDateTime('time')" src="../images/form/clock.gif" align="absMiddle" width="18" height="18"> 
  143. <input name="weekDay" type="checkbox" value="1">
  144. 星期日
  145. <input name="weekDay" type="checkbox" value="2">
  146. 星期一
  147. <input name="weekDay" type="checkbox" value="3">
  148. 星期二
  149. <input name="weekDay" type="checkbox" value="4">
  150. 星期三
  151. <input name="weekDay" type="checkbox" value="5">
  152. 星期四
  153. <input name="weekDay" type="checkbox" value="6">
  154. 星期五
  155. <input name="weekDay" type="checkbox" value="7">
  156. 星期六 
  157. <input type="submit" value="确定"><input name="cron" type="hidden">
  158. <span class="p14">
  159. <input name="data_map" type="hidden">
  160. </span></td>
  161.           </tr></form>
  162.         </table>
  163.         <br>
  164.       <br></TD>
  165.     </TR>
  166.     <TR>
  167.       <TD class=tfoot align=right>&nbsp;</TD>
  168.     </TR>
  169.   </TBODY>
  170. </TABLE>