⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editcustomtimeperiod.jsp

📁 国外的一套开源CRM
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%--
 *  Copyright (c) 2002 The Open For Business Project - www.ofbiz.org
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a 
 *  copy of this software and associated documentation files (the "Software"), 
 *  to deal in the Software without restriction, including without limitation 
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
 *  and/or sell copies of the Software, and to permit persons to whom the 
 *  Software is furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included 
 *  in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
 *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
 *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
 *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 
 *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 *@author     David E. Jones
 *@created    December 12 2002
 *@version    1.0
--%> 

<%@ page import="java.util.*, java.net.*" %>
<%@ page import="org.ofbiz.security.*, org.ofbiz.entity.*, org.ofbiz.base.util.*, org.ofbiz.content.webapp.pseudotag.*" %>

<%@ taglib uri="ofbizTags" prefix="ofbiz" %>

<jsp:useBean id="security" type="org.ofbiz.security.Security" scope="request" />
<jsp:useBean id="delegator" type="org.ofbiz.entity.GenericDelegator" scope="request" />

<%
	String findOrganizationPartyId = request.getParameter("findOrganizationPartyId");
	if ("".equals(findOrganizationPartyId)) findOrganizationPartyId = null;
	String currentCustomTimePeriodId = request.getParameter("currentCustomTimePeriodId");
	if ("".equals(currentCustomTimePeriodId)) currentCustomTimePeriodId = null;

	GenericValue currentCustomTimePeriod = currentCustomTimePeriodId == null ? null : delegator.findByPrimaryKey("CustomTimePeriod", UtilMisc.toMap("customTimePeriodId", currentCustomTimePeriodId));
	if (currentCustomTimePeriod != null) pageContext.setAttribute("currentCustomTimePeriod", currentCustomTimePeriod);
    GenericValue currentPeriodType = currentCustomTimePeriod == null ? null : currentCustomTimePeriod.getRelatedOneCache("PeriodType");
	if (currentPeriodType != null) pageContext.setAttribute("currentPeriodType", currentPeriodType);

	List customTimePeriods = delegator.findByAnd("CustomTimePeriod", 
			UtilMisc.toMap("organizationPartyId", findOrganizationPartyId, "parentPeriodId", currentCustomTimePeriodId), 
			UtilMisc.toList("periodTypeId", "periodNum", "fromDate"));
	if (customTimePeriods != null) pageContext.setAttribute("customTimePeriods", customTimePeriods);

	List allCustomTimePeriods = delegator.findAll("CustomTimePeriod", UtilMisc.toList("organizationPartyId", "parentPeriodId", "periodTypeId", "periodNum", "fromDate"));
	if (allCustomTimePeriods != null) pageContext.setAttribute("allCustomTimePeriods", allCustomTimePeriods);
	
	List periodTypes = delegator.findAllCache("PeriodType", UtilMisc.toList("description"));
	if (periodTypes != null) pageContext.setAttribute("periodTypes", periodTypes);
	
	String newPeriodTypeId = "FISCAL_YEAR";
	if (currentCustomTimePeriod != null && "FISCAL_YEAR".equals(currentCustomTimePeriod.getString("periodTypeId"))) newPeriodTypeId = "FISCAL_QUARTER";
	if (currentCustomTimePeriod != null && "FISCAL_QUARTER".equals(currentCustomTimePeriod.getString("periodTypeId"))) newPeriodTypeId = "FISCAL_MONTH";
	if (currentCustomTimePeriod != null && "FISCAL_MONTH".equals(currentCustomTimePeriod.getString("periodTypeId"))) newPeriodTypeId = "FISCAL_WEEK";
	if (currentCustomTimePeriod != null && "FISCAL_BIWEEK".equals(currentCustomTimePeriod.getString("periodTypeId"))) newPeriodTypeId = "FISCAL_WEEK";
	if (currentCustomTimePeriod != null && "FISCAL_WEEK".equals(currentCustomTimePeriod.getString("periodTypeId"))) newPeriodTypeId = "";
%>

<h3 style='margin:0;'>Custom Time Period Maintenance Page</h3>

<%if(security.hasPermission("PERIOD_MAINT", session)){%>

<!--
        <attribute name="customTimePeriodId" type="String" mode="IN" optional="false"/>
        <attribute name="parentPeriodId" type="String" mode="IN" optional="true"/>
        <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/>
        <attribute name="periodTypeId" type="String" mode="IN" optional="false"/>
        <attribute name="periodNum" type="Long" mode="IN" optional="true"/>
        <attribute name="fromDate" type="Date" mode="IN" optional="true"/>
        <attribute name="thruDate" type="Date" mode="IN" optional="true"/>
-->
<br>
<FORM method=POST action='<ofbiz:url>/EditCustomTimePeriod</ofbiz:url>' name='setOrganizationPartyIdForm'>
    <input type="hidden" name="currentCustomTimePeriodId" value="<%=UtilFormatOut.checkNull(currentCustomTimePeriodId)%>">
	<div class='tabletext'>
		Show Only Periods with Organization Party ID:
		<input type="text" class='inputBox' size="20" name="findOrganizationPartyId" value="<%=UtilFormatOut.checkNull(findOrganizationPartyId)%>">
		<INPUT type=submit value='Update' style='font-size: x-small;'>
	</div>
</FORM>
<br>
<div class='tabletext'>Current Custom Time Period <ofbiz:if name="currentCustomTimePeriod"><a href='<ofbiz:url>/EditCustomTimePeriod<%=findOrganizationPartyId == null ? "" : "?findOrganizationPartyId=" + findOrganizationPartyId%></ofbiz:url>' class="buttontext">[Clear Current]</a></ofbiz:if></div>
<TABLE border='1' cellpadding='2' cellspacing='0'>
  <TR>
    <TD><div class='tabletext'>ID</div></TD>
    <TD><div class='tabletext'>Parent&nbsp;ID</div></TD>
    <TD><div class='tabletext'>Org&nbsp;Party&nbsp;ID</div></TD>
    <TD><div class='tabletext'>Period&nbsp;Type</div></TD>
    <TD><div class='tabletext'>#</div></TD>
    <TD><div class='tabletext'>Name</div></TD>
    <TD><div class='tabletext'>From&nbsp;Date</div></TD>
    <TD><div class='tabletext'>Thru&nbsp;Date</div></TD>
    <TD><div class='tabletext'>&nbsp;</div></TD>
    <TD><div class='tabletext'>&nbsp;</div></TD>
  </TR>
  <ofbiz:if name="currentCustomTimePeriod">
    <FORM method=POST action='<ofbiz:url>/updateCustomTimePeriod</ofbiz:url>' name='updateCustomTimePeriodForm'>
      <input type="hidden" name="findOrganizationPartyId" value="<%=UtilFormatOut.checkNull(findOrganizationPartyId)%>">
      <input type="hidden" name="currentCustomTimePeriodId" value="<%=UtilFormatOut.checkNull(currentCustomTimePeriodId)%>">
    <td><div class='tabletext'><ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="customTimePeriodId"/></div></td>
    <td>
        <select name="parentPeriodId" class='selectBox'>
            <option value=''>&nbsp;</option>
            <ofbiz:iterator name="allCustomTimePeriod" property="allCustomTimePeriods">
			    <%GenericValue allPeriodType = allCustomTimePeriod.getRelatedOneCache("PeriodType");%>
                <%boolean isDefault = currentCustomTimePeriod.getString("parentPeriodId") == null ? false : currentCustomTimePeriod.getString("parentPeriodId").equals(allCustomTimePeriod.getString("customTimePeriodId"));%>
                <option value='<ofbiz:entityfield attribute="allCustomTimePeriod" field="customTimePeriodId"/>' <%if (isDefault) {%>selected<%}%>>Pty:<ofbiz:entityfield attribute="allCustomTimePeriod" field="organizationPartyId"/> <%=allPeriodType == null ? "" : allPeriodType.getString("description") + ":"%> <ofbiz:inputvalue entityAttr="allCustomTimePeriod" field="periodNum"/> [<ofbiz:entityfield attribute="allCustomTimePeriod" field="customTimePeriodId"/>]</option>
            </ofbiz:iterator>
        </select>
        <%if (currentCustomTimePeriod.getString("parentPeriodId") != null) {%>
            <a href='<ofbiz:url>/EditCustomTimePeriod?currentCustomTimePeriodId=<ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="parentPeriodId"/><%=findOrganizationPartyId == null ? "" : "&findOrganizationPartyId=" + findOrganizationPartyId%></ofbiz:url>' class="buttontext">
	        [Set As Current]</a>
	    <%}%>
    </td>
    <td><input type=text size='12' <ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="organizationPartyId" fullattrs="true"/> class='inputBox'></td>
    <td>
        <select name="periodTypeId" class='selectBox'>
            <ofbiz:iterator name="periodType" property="periodTypes">
                <%boolean isDefault = currentCustomTimePeriod.getString("periodTypeId") == null ? false : currentCustomTimePeriod.getString("periodTypeId").equals(periodType.getString("periodTypeId"));%>
                <option value='<ofbiz:entityfield attribute="periodType" field="periodTypeId"/>' <%if (isDefault) {%>selected<%}%>><ofbiz:entityfield attribute="periodType" field="description"/><%-- [<ofbiz:entityfield attribute="periodType" field="periodTypeId"/>]--%></option>
            </ofbiz:iterator>
        </select>
    </td>
    <td><input type=text size='4' <ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="periodNum" fullattrs="true"/> class='inputBox' ></td>
    <td><input type=text size='10' <ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="periodName" fullattrs="true"/> class='inputBox' ></td>
    <td>
        <%boolean hasntStarted = false;%>
        <%if (currentCustomTimePeriod.getDate("fromDate") != null && UtilDateTime.nowDate().before(currentCustomTimePeriod.getDate("fromDate"))) { hasntStarted = true; }%>
        <input type=text size='13' <ofbiz:inputvalue entityAttr="currentCustomTimePeriod" field="fromDate" fullattrs="true"/> class='inputBox' style='<%if (hasntStarted) {%> color: red;<%}%>'>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -