<%-- #RevizeProperties USE REVIZE MENU (DOCUMENT PROPERTIES) TO EDIT DATA BELOW: status=edit options= server=localhost:8080 projectName=demositeIII label= location=calendar_app/calendar_view_common/calendar_events-editform.jsp version= docType=editpage subType=form moduleName=calendar_events fieldName= channels=revize|Production| description=New event creation --%><%-- #BeginRZ-PageHeader --%><%@ page language="java" %><% String rzmodule = "calendar_events"; %><%@ include file="/util/setup_editform_header.jsp" %><%-- #EndRZ-PageHeader --%> Event Form <%-- _____________________________________________________________________________________ See RZloadResources() for details on how page deviates from standard Revize edit page _____________________________________________________________________________________ --%><% %><%-- below include ONLY on calendar editform pages --%><%@ include file="/util/setup_editform_javascript.jsp" %><% %><%-- Below include on all calendar templates and edit pages --%> <%@ include file="/plugins/calendar/calendar3.head_version_include.jsp" %> <%-- //---------------------------------------------------------------------------------\\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DW use only (below tags NOT published); required files loaded during page setup * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --%><% if (false) { %> <% } %><%-- \\---------------------------------------------------------------------------------// --%><% /**********************************/ /*BOOKMARK Page specific JSP Code*/ /********************************/ String groupid = StringUtils.getParameter(request,"groupid"); String calendarid = StringUtils.getParameter(request,"calendarid"); String eventid = StringUtils.getParameter(request,"recordid"); String viewdate = StringUtils.getParameter(request,"viewdate"); String repeatId = StringUtils.getParameter(request,"repeatid"); String repeatDate = StringUtils.getParameter(request,"repeatdate"); String calid = rz.fetch("calendar_events","calendarid"); if (calendarid.length()> 0) calid = calendarid; // fix to stop non selected items rolling up to master on selective rollup if( calid.equals("0") && !repeatId.equals("") ) calid = rz.fetch("calendar_events","calendarid","recordid="+repeatId); String rollup_calendar_list = rz.fetch("calendar_names","rollup_calendar_list","","_recordid=" + calid); /* _______________________________________________________________________ | | | DCO 09-02-2014: support for repeat single date content override below | | | | NOTE: very little new code is used unless xml verion is 09-02-2014 | |_______________________________________________________________________| */ boolean DEBUG = true; String message = ""; String repeatWhere = ""; //used to fetch primary record field values boolean repeatEdits = false; Map repeatEditsMap = new HashMap(); Map repeatRecordsMap = new HashMap(); StringBuffer repeatFieldvalues = new StringBuffer("RZ.nothing=\"\";"); String xmlDataVersionStr = StringUtils.getParameter(request,"xmlDataVersion"); if (isRepeatContentOverride && xmlDataVersionStr.length() > 0) { try { xmlDataVersionStr = xmlDataVersionStr.replaceAll("/","-"); java.util.Date xmlDataVersion = StringUtils.parseDate(xmlDataVersionStr, "MM-dd-yyyy"); java.util.Date repeatVersion = StringUtils.parseDate("09-02-2014", "MM-dd-yyyy"); isRepeatContentOverride = repeatVersion.getTime() >= xmlDataVersion.getTime(); } catch (Exception e) {} } while (isRepeatContentOverride) { String filter = ""; String format = "format=MM-dd-yyyy"; RegEx.Results results = null; /****************************************************************/ /*BOOKMARK -----repeat single occurance properties found on url*/ /**************************************************************/ if (repeatId.length() > 0) { //----- If existing repeat single occurance record if (!eventid.equals("new")) { rz.fetch("calendar_events","date_time_stamp"); if (!rz.content.equals("")) message = "Displaying Content Saved on " + rz.content; else eventid = "new"; } //----- If new repeat single occurance record, set to primary event content if (eventid.equals("new")) { message = "Primary Event Content Displayed -- Updates will ONLY Apply to this Date"; repeatWhere = "recordid=" + repeatId; // Create javascript to set RZ.fieldvalues[...] to use primary event content before // snippet_helper_editform.js::RZeditformsetup() initializes non-text form fields. for (int i=0; i 9) { repeatId = rz.content.substring(9); repeatDate = rz.fetch("calendar_events","begin_date","format=MM-dd-yyyy"); break; } /*****************************************************************/ /*BOOKMARK -----repeat primary properties found in summary field*/ /***************************************************************/ String summary = rz.fetch("calendar_events","summary"); // backward compatibility for code before 09-02-2014 // convert ,; to ; at end of DATES: and ;- to ; at end of field summary = summary.replaceFirst(",;",";").replaceFirst(";-",";"); results = RegEx.match(summary, "EDITS:(.*)(?=;)"); if (results.isFound) { repeatEdits = true; //content override records created // backward compatibility for code before 09-02-2014 results.group[1] = results.group[1].replaceAll("-(,|$)","$1"); //----- build list of ACTIVE repeat single occurance event records // EDITS: items (mm-dd-yyyy=recordid) separated by commas String edits[] = StringUtils.split(results.group[1],","); StringUtils.console("------------------------"); StringUtils.console("edits: " + results.group[1]); /*DCO 04-07-2017: no value unless REPEATID:... for (int i=0;i 0) { filter = ",recordid="+recordid; rz.fetch("calendar_events","begin_date", format+filter); if (!date.equals(rz.content)) recordid = ""; else // add recordid if valid repeatRecordsMap.put(date,recordid); } repeatEditsMap.put(date,recordid); // always add EDITS date } } */ } /*****************************************************************************/ /*BOOKMARK -----build list of INACTIVE repeat single occurance event records*/ /***************************************************************************/ // This used to pass recordid to editform when called to edit // content override record. // //TODO: Very expensive operation -- move into RZTagSupport ?? // Then this only needs to run here when EDITS: item is missing the recordid //----- If repeat event content override have ever been selected fot this event if (summary.indexOf("EDITS:") != -1) { filter = "summary=REPEATID:" + rz.editrecordid; rz.listsetup("calendar_events", "noscript,noemptylistmessage", filter, ""); StringUtils.console("rzlist: filter=" + filter + " records=" + rz.listlength); repeatRecordsMap = new HashMap(); repeatEditsMap = new HashMap(); while (rz.listnext()) { if (rz.listindex < 0) continue; if (!rz.fetch("calendar_events","summary").equals(filter)) continue; //history records not filtered rz.fetch("calendar_events","begin_date",format); StringUtils.console("begin_date["+rz.recordid+"]: " + rz.content); // add to repeatRecordsMap if not already added if (repeatRecordsMap.get(rz.content) == null) repeatRecordsMap.put(rz.content,rz.recordid); // update repeatEditsMap if recordid missing // if (repeatEditsMap.get(rz.content) != null // && (repeatEditsMap.get(rz.content)+"").length() == 0) repeatEditsMap.put(rz.content,rz.recordid); } rz.listcomplete(); StringUtils.console(" "); } break; } %><%! /** * return json representation of java Map containing Strings */ String json(Map mapObj) { String json = ""; Iterator itr = mapObj.keySet().iterator(); while (itr.hasNext()) { String key = itr.next() + ""; String value = "'" + mapObj.get(key) + "'"; String keyValue = "'" + key + "':" + value; StringUtils.console(" json " + keyValue); if (key.length() > 0) json += "," + keyValue; } return "{" + StringUtils.sub(json,1) + "}"; } /* _______________________________________________________________________ | | | DCO 09-02-2014: support for repeat single date content override above | |_______________________________________________________________________| */ /************************************/ /*BOOKMARK Page specific JavaScript*/ /**********************************/ %> <%-- /*************************************************/ /* RZhidden class hides elements in browser but */ /* DW shows them as greyed out in design view */ /* Below css not published or rendered on jsp */ /*********************************************/ --%> <% if (false){ %> <% } %> <%-- /***********************************/ /* Following css used by browsers */ /*********************************/ --%> <%-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DELETE standard javascript include file after the body tag (if shown above) It is included in the head section for edit pages and not used on templates * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --%><%if (false){%>
NOTE: blocks with class="RZhidden" display with this background in DW only; they are hidden when page displays in browser until changed by javascript or other CSS.
<% } %>

Calendar Name:
<% if (rz.editaction.equals("create")) {%> New <% }else{ %> Update <% } %> Event Form (* Indicates Required Field)

Displaying Default Content for Repeating Event
Updating Content for <%= repeatDate %>


<%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditFormSaveImage --%> <%-- Option:imageSrcURL=../images/buttons/save.gif --%> <%-- #EndRZ-ActionImage --%>      
     <%=HELP_BUTTON%>
Initializing

All Event Dates
Check Dates Skipped

e.g.
03-01-2012 Mon
<%if(rz.isvalidfield("calendar_events","location")){%> <%} if(rz.isvalidfield("calendar_events","image")){%> <%}%>
* Event Name: "> ">
Event Category:
Does Event Rollup to
Master Calendar?
Yes No
* Event Begin Date: "> begin_date_dayName begin_date_note Event has Expired
Start Time: Hour: <%-- #BeginRZ-TextEditChoice --%> <%-- Option:type=editchoice --%> <%-- Option:moduleName=calendar_events --%> <%-- Option:fieldName=start_time_hours --%> <%-- Option:script= --%> <%-- Option:help=Replace Select options with your choices --%> <%rz.content=rz.fetch("calendar_events","start_time_hours",repeatWhere);%> <%-- #EndRZ-TextEditChoice --%> Minutes: <%-- #BeginRZ-TextEditChoice --%> <%-- Option:type=editchoice --%> <%-- Option:moduleName=calendar_events --%> <%-- Option:fieldName=start_time_minutes --%> <%-- Option:script= --%> <%-- Option:help=Replace Select options with your choices --%> <%rz.content=rz.fetch("calendar_events","start_time_minutes",repeatWhere);%> <%-- #EndRZ-TextEditChoice --%> start_time_note
Duration of Event: ">
    Minutes     Hours     Days duration_note
 @@@  Recurring Event:
None   Weekly  Every Weeks    Monthly  Every Months  
Same Day of Week Same Date of Month
repeat_note
Event Ending Date: Event repeats  times    Show Dates
end_date_note
(debug) date/count used to determine dates

Select Other Calendars that 
ALSO display event:

:

Show in All Other Calendars">
"> Hold Ctrl key to select or un-select
single selection

Detailed Information 
About this Event:
" output="none">
This Information is Shown on Detailed Information Page
Location: ">
Image:
<% String img_src ="/revize/plugins/_editforms_/images/placeholder.png"; if(rz.src.indexOf("noimage.gif") == -1) { img_src = rz.src.replaceFirst("\\../",""); } %>
Change Image
Is this a Notable Event? Yes No
Event Contact Information 
Name: ">
Email: "> (e.g admin@revize.com)
Phone: "> 10 or More Digits Plus: - ( ) or spaces
Signup Form: Yes No
  Same as Event Contact Information Above
Requires Supervisor Approval
* Event Coordinator Name: "/>
* Event Coordinator Email: "/>
e.g. admin@revize.com
Submitted Sign-up Form will be sent to this email address.
Event Coordinator Phone: " />10 or More Digits Plus: - ( ) or spaces
<%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditFormSaveImage --%> <%-- Option:imageSrcURL=../images/buttons/save.gif --%> <%-- #EndRZ-ActionImage --%>       <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditFormCancelImage --%> <%-- Option:imageSrcURL=../images/buttons/cancel.gif --%> <%-- #EndRZ-ActionImage --%>