Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
- <link rel="stylesheet" type="text/css" href="../../../distLibs/css/DataTables/datatables.css">
- <link rel="stylesheet" type="text/css" href="../../../distLibs/css/jQuery/jquery.timepicker.css" />
- <link rel="stylesheet" type="text/css" href="../../../distLibs/css/jQuery/jquery.modal.min.css">
- <link rel="stylesheet" type="text/css" href="../../../distLibs/css/jQuery/jquery-ui.css">
- <link rel="stylesheet" type="text/css" href="./pikaday.css">
- <link rel="stylesheet" type="text/css" href="./jquery.recurrenceinput.css">
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.min.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.timepicker.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.modal.min.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.browser.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.tools.min.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery.tmpl.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery-ui.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/underscore.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/stringifyObject.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/jQuery/jquery-migrate-3.0.0.min.js"></script>
- <script type="text/javascript" language="javascript" src='../../../distLibs/libs/Moment/moment-with-locales.min.js'></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/CKEditor/ckeditor.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/CKEditor/adapters/jquery.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/Misc/uuid.js"></script>
- <script type="text/javascript" language="javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBmE8jumNnyJ6JOpWsw_ZxmjcmrL7DGOHY&libraries=places"></script>
- <!-- script type="text/javascript" language="javascript" src="./OTCalEdit_config.js"></!--script -->
- <script type="text/javascript" language="javascript" src="./locationpicker.jquery.js"></script>
- <script type="text/javascript" language="javascript" src="./jquery.recurrenceinput.js"></script>
- <script type="text/javascript" language="javascript" src="./pikaday.js"></script>
- <script type="text/javascript" language="javascript" src="./pikaday.jquery.js"></script>
- <!------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
- <!-- includes all the plugins I need (DataTables 1.10.13, AutoFill 2.1.3, Buttons 1.2.4, Print view 1.2.4, Editor 1.6.1, Responsive 2.1.0, Scroller 1.4.2, Select 1.2.0) -->
- <!------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/DataTables/datatables.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/DataTables/editor.ckeditor.js"></script>
- <!-- script type="text/javascript" language="javascript" src="../../../distLibs/libs/Rrule/rrule.js"></script>
- <script type="text/javascript" language="javascript" src="../../../distLibs/libs/Rrule/nlp.js"></script -->
- <script type="text/javascript" language="javascript" src="../../../OTSearcher/OTSearcher/jquery.OTSearcher.js"></script>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- This style override expands and positions the Editor bubble and other popups -->
- <!------------------------------------------------------------------------------------------------------------------->
- <style>
- div.DTED_Lightbox_Wrapper {
- left: 1em;
- right: 1em;
- margin-left: 0;
- width: auto;
- height: auto;
- }
- div.DTED_Lightbox_Container {
- left: 1em;
- right: 1em;
- margin-left: 0;
- width: auto;
- height: auto;
- }
- div.editor-datetime {
- position: absolute;
- background-color: white;
- z-index: 2050;
- border: 7px solid #555;
- box-shadow: 2px 2px 10px #555;
- border-radius: 10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .otbuttons {
- width: 100px;
- position: center;
- text-align: center;
- display:inline-block;
- margin-top: 0;
- padding: 5px 15px;
- cursor: pointer;
- margin-left: 0.75em;
- font-size: 14px;
- text-shadow: 0 1px 0 white;
- border: 1px solid #999;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- -ms-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: 1px 1px 3px #ccc;
- -moz-box-shadow: 1px 1px 3px #ccc;
- box-shadow: 1px 1px 3px #ccc;
- background-color: #f9f9f9 100%;
- /* Fallback */
- background-image: -webkit-linear-gradient(top, #ffffff 0%, #eee 65%, #f9f9f9 100%);
- /* Chrome 10+, Saf5.1+, iOS 5+ */
- background-image: -moz-linear-gradient(top, #ffffff 0%, #eee 65%, #f9f9f9 100%);
- /* FF3.6 */
- background-image: -ms-linear-gradient(top, #ffffff 0%, #eee 65%, #f9f9f9 100%);
- /* IE10 */
- background-image: -o-linear-gradient(top, #ffffff 0%, #eee 65%, #f9f9f9 100%);
- /* Opera 11.10+ */
- background-image: linear-gradient(to bottom, #ffffff 0%, #eee 65%, #f9f9f9 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#ffffff', EndColorStr='#f9f9f9');
- }
- div.DTE_Field {
- padding-left: 2% !important;
- width: 95% !important;
- }
- div.DTE_Field > label {
- float: left;
- width: 10% !important;
- padding-top: 6px;
- }
- div.DTE_Field > div.DTE_Field_Input {
- float: right;
- width: 90% !important;
- }
- #DTE_Field_whenHolder {
- height: 55px !important;
- }
- #DTE_Field_locHolder {
- height: 55px !important;
- }
- #DTE_Field_description {
- height: 210px !important;
- }
- /* Remove the editor delete "X" */
- div.DTED_Lightbox_Close {
- display: none;
- }
- /* Center the buttons at the bottom of the editor window */
- div.DTE_Form_Buttons {
- width: 300px ; /* arbitrary for now until I know the sixe of the buttons */
- margin-left: auto ;
- margin-right: auto ;
- display: inline-block;
- text-align: center;
- }
- div.DTE_Form_Buttons button {
- text-align: center;
- width: 100px !important;
- float: none !important;
- }
- /*----------------------------------------------------------------------------------------------*/
- /* For jQuery.modal so modal appears over Editor */
- /*----------------------------------------------------------------------------------------------*/
- .blocker {
- z-index: 16 !important;
- background-color: rgb(0,0,0) !important;
- background-color: rgba(0,0,0,0.25) !important;
- }
- .modal {
- z-index: 17 !important;
- max-width: 1400px !important;
- background-color: white !important;
- border: 7px solid #555;
- box-shadow: 2px 2px 10px #555;
- border-radius: 10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- /*----------------------------------------------------------------------------------------------*/
- /* For jQuery.recurrenceinput so modal apears over Editor and is same appearance os other popups*/
- /*----------------------------------------------------------------------------------------------*/
- div.riform {
- box-shadow: none !important;
- }
- /*-------------------------------------------------------------------------*/
- /* jQuery.recurrenceinput <input tag modification */
- /*-------------------------------------------------------------------------*/
- /* daily interval */
- #ridailyinterval input[name="ridailyinterval"] {
- width: 50px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- }
- /* weekly interval */
- #riweeklyinterval input[name="riweeklyinterval"] {
- width: 50px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- }
- /* monthly interval */
- #rimonthlyinterval input[name="rimonthlyinterval"] {
- width: 50px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- }
- /* yearly interval */
- #riyearlyinterval input[name="riyearlyinterval"] {
- width: 50px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- }
- /* occurence value */
- #rirangeoptions input[name="rirangebyoccurrencesvalue"] {
- width: 50px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- margin-bottom: 6px !important;
- }
- /* occurrence calendar */
- #rirangeoptions input[name="rirangebyenddatecalendar"] {
- width: 200px !important;
- padding-top: 2px !important;
- padding-right: 4px !important;
- padding-bottom: 2px !important;
- padding-left: 4px !important;
- }
- /*-------------------------------------------------------------------------*/
- /* jQuery.recurrenceinput <select tag so they appear like <input tags */
- /*-------------------------------------------------------------------------*/
- /* template selection */
- #rirtemplate select[name="rirtemplate"] {
- box-sizing: border-box !important;
- background-color: white !important;
- }
- /* monthly template options selection */
- #rimonthlyoptions select[name="rimonthlydayofmonthday"] {
- box-sizing: border-box !important;
- background-color: white !important;
- }
- #rimonthlyoptions select[name="rimonthlyweekdayofmonthindex"] {
- box-sizing: border-box !important;
- background-color: white !important;
- }
- #rimonthlyoptions select[name="rimonthlyweekdayofmonth"] {
- box-sizing: border-box !important;
- background-color: white !important;
- }
- /* yearly template selection options */
- #riyearlyoptions select[name="riyearlydayofmonthmonth"] {
- background-color: white !important;
- }
- #riyearlyoptions select[name="riyearlydayofmonthday"] {
- background-color: white !important;
- }
- #riyearlyoptions select[name="riyearlyweekdayofmonthindex"] {
- background-color: white !important;
- }
- #riyearlyoptions select[name="riyearlyweekdayofmonthday"] {
- background-color: white !important;
- }
- #riyearlyoptions select[name="riyearlyweekdayofmonthmonth"] {
- background-color: white !important;
- }
- .label {
- width: 100px !important;
- }
- /*----------------------------------------------------------------------------------------------*/
- /* For jquery.datepicker and jquery.timepicker so the popup has appearance is consistant with other popups */
- /*----------------------------------------------------------------------------------------------*/
- .ui-datepicker {
- background-color: white !important;
- border: 7px solid #555 !important;
- box-shadow: 2px 2px 10px #555 !important;
- border-radius: 10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- .ui-timepicker-wrapper {
- background-color: white !important;
- border: 7px solid #555 !important;
- box-shadow: 2px 2px 10px #555 !important;
- border-radius: 10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- /*----------------------------------------------------------------------------------------------*/
- /* For modals */
- /*----------------------------------------------------------------------------------------------*/
- .us3-label {
- display: inline-block;
- width: 120px;
- text-align: right;
- }
- #descEditor {
- box-sizing: border-box !important;
- background-color: white !important;
- }
- #sdate, #edate {
- box-sizing: border-box;
- background-color: white;
- padding-bottom: 6px;
- padding-left: 4px;
- padding-right: 4px;
- padding-top: 6px;
- width: 200px;
- }
- #stime, #etime {
- box-sizing: border-box;
- background-color: white;
- padding-bottom: 6px;
- padding-left: 4px;
- padding-right: 4px;
- padding-top: 6px;
- width: 75px;
- }
- /*-----------------------------------------------------------------*/
- /* styles for flex box in dtrmodal */
- /**/
- .flex-container {
- display: flex;
- width: 100%;
- height:330px;
- background-color: white;
- }
- .section-top, .panel-bottom {
- flex-shrink: 0;
- }
- .flex-item {
- background-color: white;
- margin: 1px;
- }
- .item1 {
- -webkit-flex: 46%;
- -ms-flex: 46%;
- flex: 46%;
- }
- .item2 {
- -webkit-flex: 27%;
- -ms-flex: 27%;
- flex: 27%;
- }
- .item3 {
- -webkit-flex: 27%;
- -ms-flex: 27%;
- flex: 27%;
- }
- </style>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Main javascript for the OTCalMaint page -->
- <!------------------------------------------------------------------------------------------------------------------->
- <script type="text/javascript" language="javascript" class="init">
- //----------------------------------------------------------------------------------------------------------------
- // Global variables
- //----------------------------------------------------------------------------------------------------------------
- var editor;
- var table;
- var dbData;
- var searcher;
- var cnAllDay = "for the rest of the day";
- var cnTo = "<b>to</b>";
- var action;
- const ACTION_NONE = "0";
- const ACTION_ADD = "1";
- const ACTION_DELETE = "10";
- const ACTION_DELETE_ALL = "11";
- const ACTION_DELETE_ONLY = "12";
- const ACTION_DELETE_FORWARD = "13";
- const ACTION_DELETE_IGNORE = "14";
- const ACTION_EDIT = "20";
- const ACTION_EDIT_ALL = "21";
- const ACTION_EDIT_ONLY = "22";
- const ACTION_EDIT_FORWARD = "23";
- const ACTION_EDIT_IGNORE = "24";
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // DATATABLE EDITOR DEFINITIONS
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- $(document).ready(function () {
- editor = new $.fn.dataTable.Editor({
- ajax: "OTCalMaint.php",
- table: "#cc-list",
- idSrc: "RID",
- template: '#OTCalMaintEdit',
- fields: [
- {
- label: "ID:",
- name: "id",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Category:",
- name: "category",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Title:",
- name: "title",
- attr: {
- tabindex: 2
- }
- },
- {
- label: "When:",
- type: "textarea",
- name: "whenHolder",
- attr: {
- tabindex: 3
- },
- },
- {
- label: "Location:",
- type: "textarea",
- name: "locHolder",
- attr: {
- tabindex: 4
- },
- },
- {
- label: "Description:",
- name: "description",
- type: "textarea",
- attr: {
- tabindex: 5
- },
- },
- {
- label: "Start:",
- name: "start",
- type: "datetime",
- attr: {
- tabindex: -1
- },
- format: 'dddd, MMMM D, YYYY h:mm A'
- },
- {
- label: "End:",
- name: "end",
- type: "datetime",
- attr: {
- tabindex: -1
- },
- format: 'dddd, MMMM D, YYYY h:mm A'
- },
- {
- label: "All Day:",
- name: "allDay",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Action:",
- name: "action",
- attr: {
- tabindex: -1
- },
- },
- {
- label: 'Repeats:',
- name: 'rfc5545',
- attr: {
- tabindex: -1
- },
- },
- {
- label: 'Repeat Text:',
- name: 'rfcText',
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Recurring Event Id:",
- name: "rfcid",
- attr: {
- tabindex: -1
- },
- },
- {
- id: "location",
- label: "Location:",
- name: "location",
- attr: {
- tabindex: -1
- },
- },
- {
- id: "place",
- label: "Place:",
- name: "placeID",
- attr: {
- tabindex: -1
- },
- },
- {
- id: "institution",
- label: "Institution:",
- name: "institution",
- attr: {
- tabindex: -1
- },
- },
- {
- id: "address",
- label: "Address",
- name: "address",
- attr: {
- tabindex: -1
- },
- },
- {
- id: "city",
- label: "City",
- name: "city",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "State",
- name: "state",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Country",
- name: "country",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Zipcode",
- name: "zipcode",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Neighborhood",
- name: "neighborhood",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Phone",
- name: "phone",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Map",
- name: "mapURL",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Website",
- name: "webURL",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Picture",
- name: "locPicURL",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Latitude:",
- name: "latitude",
- attr: {
- tabindex: -1
- },
- },
- {
- label: "Longitude:",
- name: "longitude",
- attr: {
- tabindex: -1
- },
- }
- ]
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE DATATABLES EDITOR "OPEN", "CLOSE", AND MISCELLANOUS EVENT HANDLERS
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- var openVals;
- //-----------------------------------------------------------------------------------
- // Routine to handle Datatables Editor plugin open
- //-----------------------------------------------------------------------------------
- editor.on('open', function (e, type) {
- // reset item action
- action = ACTION_NONE;
- // make sure several fields that are 'click' targets are readonly
- $('#DTE_Field_whenHolder').attr("readonly", true);
- $('#DTE_Field_locHolder').attr("readonly", true);
- $('#DTE_Field_description').attr("readonly", true);
- // assign a UUID to the event if one not present
- if (editor.field('id').input().val()) {
- ;
- } else {
- editor.field('id').input().val(UUID.generate()).change();
- }
- // set messages
- editor.field('whenHolder').fieldInfo("Click here to set or modify the date, time, or repetitions");
- editor.field('locHolder').fieldInfo("Click here to set or modify the location");
- editor.field('description').fieldInfo("Click here to set or modify the description");
- // Load rfc5545 into dtrModal
- if (editor.field('rfc5545').input().val()) {
- var rfc5545 = editor.field('rfc5545').input().val().replace("RDATE:", "\nRDATE:").replace("EXDATE:", "\nEXDATE:");
- $('#recurrenceinput1').recurrenceinput().loadData(rfc5545);
- // and get the description
- var rptdata = $('#recurrenceinput1').recurrenceinput().update();
- editor.field('rfcText').input().val(rptdata.description);
- $('#repeattext').text("Repeating " + editor.field('rfcText').input().val());
- } else {
- $('#recurrenceinput1').val("");
- $('#repeattext').text("Does not repeat ");
- $('#recurrenceinput1').recurrenceinput().loadData("RRULE:FREQ=NEVER;");
- }
- // build the 'When' pseudo field
- editor.field('whenHolder').input().val(buildWhen());
- // build the 'Location' pseudo field
- editor.field('locHolder').input().val(buildLoc());
- simple_repeats();
- // Store the values of the fields on open
- openVals = JSON.stringify(editor.get());
- editor.field('title').input().focus();
- });
- editor.on('preBlur', function (e) {
- /* do this is a check on changes is wanted, but the default is no to allow click outside editor
- // On close, check if the values have changed and ask for closing confirmation if they have
- if ( openVals !== JSON.stringify( editor.get() ) ) {
- return confirm( 'You have unsaved changes. Are you sure you want to exit?' );
- }
- */
- return (false);
- });
- //-----------------------------------------------------------------------------------
- // Routine to handle Datatables Editor plugin openclose
- //-----------------------------------------------------------------------------------
- editor.on('close', function (e, type) {
- });
- //-----------------------------------------------------------
- // make sure 'title' always has a value
- //-----------------------------------------------------------
- editor.field('title').input().on('input', function () {
- if (editor.field('title').input().val()) {
- editor.field('title').error('');
- } else {
- editor.field('title').error('A title is required for this event');
- editor.field('title').focus();
- }
- });
- //----------------------------------------------------------------------------------------
- // make sure "tabbing" to an empty editor field casues the appropriate modal to appear
- //----------------------------------------------------------------------------------------
- editor.field('whenHolder').input().on('focus', function () {
- if (editor.field('whenHolder').input().val()) {
- ;
- } else {
- editor.field('whenHolder').input().trigger('click');
- }
- });
- editor.field('locHolder').input().on('focus', function () {
- if (editor.field('locHolder').input().val()) {
- ;
- } else {
- editor.field('locHolder').input().trigger('click');
- }
- });
- editor.field('description').input().on('focus', function () {
- if (editor.field('description').input().val()) {
- ;
- } else {
- editor.field('description').input().trigger('click');
- }
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE "NEW EVENT" AND INLINE "EDIT" AND "DELETE" BUTTONS
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- //----------------------------------------------------------------------------------------
- // Create event
- //----------------------------------------------------------------------------------------
- $('#newevent').on('click', function (e) {
- e.preventDefault();
- editor
- .create({
- title: 'Create new event',
- buttons: [
- 'Add',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- })
- .set({
- title: '',
- allDay: '0',
- action: '0',
- webURL: '',
- description: '',
- placeID: '',
- location: '',
- institution: '',
- address: '',
- city: '',
- state: '',
- country: '',
- zipcode: '',
- neighborhood: '',
- phone: '',
- locPicURL: '',
- mapURL: '',
- latitude: 0.0,
- longitude: 0.0
- })
- });
- //----------------------------------------------------------------------------------------
- // Edit event
- //----------------------------------------------------------------------------------------
- $('#cc-list').on('click', 'a.editor_edit', function (e) {
- e.preventDefault();
- editor
- .edit({
- title: 'Edit event',
- buttons: [
- 'Update',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- })
- });
- //----------------------------------------------------------------------------------------
- // Copy event
- //----------------------------------------------------------------------------------------
- $('#cc-list').on('click', 'a.editor_copy', function (e) {
- e.preventDefault();
- // get the current row
- copyrow = $(this).closest('tr');
- // in case all row data not loaded, get index of selected row
- var ix = copyrow["0"]._DT_RowIndex;
- // get all the data for the selected row
- rowdata = table.row(ix).data();
- // copy actually does a 'create' but with fields populated from the current (copied) row
- editor
- .create({
- title: 'Create event',
- buttons: [
- 'Add',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- })
- .set({
- title: rowdata['title'],
- allDay: '0',
- action: '0',
- webURL: rowdata['webURL'],
- description: rowdata['description'],
- placeID: rowdata['placeID'],
- location: rowdata['location'],
- institution: rowdata['institution'],
- address: rowdata['address'],
- city: rowdata['city'],
- state: rowdata['state'],
- country: rowdata['country'],
- zipcode: rowdata['zipcode'],
- neighborhood: rowdata['neighborhood'],
- phone: rowdata['phone'],
- locPicURL: rowdata['locPicURL'],
- mapURL: rowdata['mapURL'],
- latitude: rowdata['latitude'],
- longitude: rowdata['longitude']
- })
- });
- //-------------------------------------------------------------------------------------
- // Delete an event
- //-------------------------------------------------------------------------------------
- var delrow;
- var rowdata;
- $('#cc-list').on('click', 'a.editor_remove', function (e) {
- e.preventDefault();
- // save info on row to be deleted
- delrow = $(this).closest('tr');
- // in case all row data not loaded, get index of selected row
- var ix = delrow["0"]._DT_RowIndex;
- // get all the data for the selected row
- rowdata = table.row(ix).data();
- // determne popup based on existance of repeat string or empty
- if (rowdata['rfc5545']) {
- // open the recurring event delete modal
- $("#delrptone").prop("checked", false);
- $("#delrpttoend").prop("checked", false);
- $("#delrptall").prop("checked", false);
- $("#delrptModal").modal({showClose: false, escapeClose: false, clickClose: false });
- } else {
- // open the single event delete modal
- $("#delsglModal").modal({ showClose: false, escapeClose: false, clickClose: false });
- }
- });
- //-----------------------------------------------------------------------
- // Routine to handle recurring event delete modal "cancel"
- //-----------------------------------------------------------------------
- $('#delrptCancel').on('click', function () {
- // close the delete modal
- $.modal.close();
- });
- //-----------------------------------------------------------------------
- // Routine to handle single event delete modal "cancel"
- //-----------------------------------------------------------------------
- $('#delsglCancel').on('click', function () {
- // close the delete modal
- $.modal.close();
- });
- //------------------------------------------------------------------------------------
- // Routine to handle recurring event delete modal "OK" and update editor action field
- //-----------------------------------------------------------------------
- $('#delrptOK').on('click', function () {
- // decode delete modal radio buttons
- if ($("#delrptone").prop('checked')) {
- rowdata['action'] = ACTION_DELETE_ONLY;
- } else if ($("#delrpttoend").prop('checked')) {
- rowdata['action'] = ACTION_DELETE_FORWARD;
- } else if ($("#delrptall").prop('checked')) {
- rowdata['action'] = ACTION_DELETE_ALL;
- } else {
- alert("Select an option and press ok or press cancel")
- return;
- }
- // close the delete modal
- $.modal.close();
- // tell the editor server code to do the requested delete
- editor
- .remove(delrow, false, {})
- .submit();
- });
- //-----------------------------------------------------------------------------------
- // Routine to handle recurring event delete modal "OK" and update editor action field
- //-----------------------------------------------------------------------
- $('#delsglOK').on('click', function () {
- // set the action
- rowdata['action'] = ACTION_DELETE_ONLY;
- // close the delete modal
- $.modal.close();
- // tell the editor server code to do the requested delete
- editor
- .remove(delrow, false, {})
- .submit();
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE Editor processing events
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- var editskiprefresh = false;
- var editrptaction;
- editor
- //-----------------------------------------------------------------------
- // On editor page open
- //-----------------------------------------------------------------------
- //.on('open', function (e, mode, action) {
- //})
- //------------------------------------------------------------------------
- // Before data goes to server
- //------------------------------------------------------------------------
- .on('preSubmit', function (e, d, a) {
- var currField;
- // if not a "delete" (remove), validate all required fields
- if (a != "remove" && editskiprefresh == false) {
- // get the new/edited record id
- editrecid = Object.keys(d['data']);
- // title must be present
- if (!d.data[editrecid].title) {
- currField = this.field('title');
- currField.focus();
- currField.error('A title for this event are required.');
- return (false);
- }
- // a start and end time must be present (set the error on 'whenHolder'
- // is start and end time given
- if (!d.data[editrecid].start || !d.data[editrecid].end) {
- currField = this.field('whenHolder');
- currField.focus();
- currField.error('A start and end date and time for this event are required.');
- return (false);
- }
- // a location must be present
- if (!d.data[editrecid].location) {
- currField = this.field('locHolder');
- currField.focus();
- currField.error('A location for this event are required.');
- return (false);
- }
- // a description must be present
- if (!d.data[editrecid].description) {
- currField = this.field('description');
- currField.focus();
- currField.error('A description for this event are required.');
- return (false);
- }
- }
- //----------------------------------------------------------------------
- // Process record add
- //----------------------------------------------------------------------
- if (a == "create") {
- // tell the server it's an 'add'
- d.data['0'].action = ACTION_ADD;
- //----------------------------------------------------------------------
- // Process record edit
- //----------------------------------------------------------------------
- } else if (a == "edit") {
- // if have we already been through preSubmit, submit the edit now
- if (editskiprefresh == true) {
- // get the edited record id
- editrecid = Object.keys(d['data']);
- // tell the server what kind of 'update'
- d.data[editrecid].action = editrptaction;
- // and besure to refresh the list after the update
- editskiprefresh = false
- // now do the update
- return (true);
- // otherwise do the edit span pop-up
- } else {
- // get the edited record id
- editrecid = Object.keys(d['data']);
- // is this a single record, no repeats
- if (!d.data[editrecid].rfc5545) {
- editskiprefresh = false;
- d.data[editrecid].action = ACTION_EDIT_ONLY;
- return (true);
- }
- // after the update type selection, come back here bu don't refreesh the list
- editskiprefresh = true;
- d.data[editrecid].action = ACTION_NONE;
- // reset the options and open the recurring event modal
- $("#editrptone").prop("checked", false);
- $("#editrpttoend").prop("checked", false);
- $("#editrptall").prop("checked", false);
- // open the edit span selection modal;
- $("#editrptModal").modal({ showClose: false, escapeClose: false, clickClose: false });
- // do no processing on the server for now
- return (false);
- }
- //----------------------------------------------------------------------
- // Process record deletion
- //----------------------------------------------------------------------
- } else if (a == "remove") {
- //----------------------------------------------------------------------
- // The proverbial "should never get here"
- //----------------------------------------------------------------------
- } else {
- ;
- }
- })
- //----------------------------------------------------------------------
- // Post-erver processing
- //----------------------------------------------------------------------
- .on('postSubmit', function (e, json, data, action) {
- // for the edit span selection modal, the first time thru do no refresh
- if (editskiprefresh) {
- ;
- // otherwise reload the table with new data
- } else {
- table.ajax.reload(null, true); // try false to hold position
- }
- });
- //------------------------------------------------------------------------
- // routine to implement circular tabbing
- //------------------------------------------------------------------------
- editor.field('description').input().on('focusout', function () {
- editor.field('title').input().focus();
- });
- //-------------------------------------------------------------------------
- // Routine to handle recurring event edit modal "cancel"
- //-------------------------------------------------------------------------
- $('#editrptCancel').on('click', function () {
- // close the edit modal
- editrptaction = ACTION_EDIT_IGNORE;
- $.modal.close();
- });
- //-----------------------------------------------------------------------------------
- // Routine to handle recurring event edit modal "OK" and update editor action field
- //-----------------------------------------------------------------------------------
- $('#editrptOK').on('click', function () {
- // decode edit modal radio buttons
- if ($("#editrptone").prop('checked')) {
- editrptaction = ACTION_EDIT_ONLY;
- } else if ($("#editrpttoend").prop('checked')) {
- editrptaction = ACTION_EDIT_FORWARD;
- } else if ($("#editrptall").prop('checked')) {
- editrptaction = ACTION_EDIT_ALL;
- } else {
- alert("Select an option and press ok or press cancel")
- return;
- }
- // close the edit modal
- $.modal.close();
- editor
- .submit();
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE "LOCATION" FIELD PROCESSING
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- //---------------------------------------------------------------------------------------------------------------
- // Routine to handle click on location input field and open "locationpicker" modal
- //---------------------------------------------------------------------------------------------------------------
- editor.field('locHolder').input().on('click', function () {
- // copy input field to modal address field
- var pid = editor.field('placeID').input().val();
- var addr = editor.field('location').input().val();
- var inst = editor.field('institution').input().val();
- var neigh = editor.field('neighborhood').input().val();
- var phone = editor.field('phone').input().val();
- var lat = editor.field('latitude').input().val();
- var lon = editor.field('longitude').input().val();
- // store values into the location modal fields
- $('#us3-address').val(addr);
- $('#us3-institution').val(inst);
- $('#us3-neighborhood').val(neigh);
- $('#us3-phone').val(phone);
- $('#us3-lat').val(lat);
- $('#us3-lon').val(lon);
- // initialize the location picker
- $('#us3').locationpicker({
- location: {
- latitude: lat,
- longitude: lon
- },
- locationName: addr,
- placeId: pid,
- radius: 300,
- inputBinding: {
- //latitudeInput: $('#us3-lat'),
- //longitudeInput: $('#us3-lon'),
- //radiusInput: $('#us3-radius'),
- locationNameInput: $('#us3-address')
- },
- enableAutocomplete: true,
- enableAutocompleteBlur: false,
- enableReverseGeocode: true,
- autocompleteOptions: {
- componentRestrictions: { country: 'us' }
- },
- addressFormat: 'address',
- markerInCenter: true,
- // update location modal when a new location is found
- onchanged: function (currentLocation, radius, isMarkerDropped) {
- var addressComponents = $(this).locationpicker('map').location.addressComponents;
- $('#us3-institution').val(addressComponents.institution).change();
- $('#us3-neighborhood').val(addressComponents.neighborhood).change();
- $('#us3-phone').val(addressComponents.phone).change();
- }
- });
- // open the location modal
- $("#locModal").modal({ showClose: false, escapeClose: false, clickClose: false });
- // if the address field in the modal is empty, give it focus
- if ($('#us3-address').val()) {
- ;
- } else {
- $('#us3-address').focus();
- }
- $('#locModal').on($.modal.OPEN, function (event, modal) {
- $('#us3').locationpicker('autosize');
- });
- });
- //------------------------------------------------------------------------------------
- // Routine to handle location modal "cancel"
- //------------------------------------------------------------------------------------
- $('#locCancel').on('click', function (e) {
- $.modal.close();
- });
- //------------------------------------------------------------------------------------
- // Routine to handle location modal "save" and update editor location fields
- //------------------------------------------------------------------------------------
- $('#locSave').on('click', function () {
- var work = JSON.parse($('#us3').locationpicker('save'));
- editor.field('location').input().val(work.full_location).change();
- // make sure we keep local changes in the modal
- editor.field('institution').input().val($('#us3-institution').val()).change();
- editor.field("neighborhood").input().val($('#us3-neighborhood').val()).change();
- editor.field("phone").input().val($('#us3-phone').val()).change();
- editor.field('placeID').input().val(work.full_placeid).change();
- editor.field("address").input().val(work.addressLine1).change();
- editor.field("city").input().val(work.city).change();
- editor.field("state").input().val(work.stateOrProvince).change();
- editor.field("country").input().val(work.country).change();
- editor.field("zipcode").input().val(work.postalCode).change();
- editor.field("webURL").input().val(work.weburl).change();
- editor.field("mapURL").input().val(work.mapurl).change();
- editor.field("locPicURL").input().val(work.picurl).change();
- editor.field("latitude").input().val(work.lat).change();
- editor.field("longitude").input().val(work.lon).change();
- editor.field('locHolder').error("");
- $.modal.close();
- // build the 'Location' pseudo field
- editor.field('locHolder').input().val(buildLoc()).change();
- editor.field('locHolder').error("");
- editor.field('locHolder').input().focus();
- });
- //------------------------------------------------------------------------------------------
- // Build the Location pseudo field "locHolder"
- //------------------------------------------------------------------------------------------
- function buildLoc() {
- var retstr = "";
- if (editor.field('location').input().val()) {
- retstr = editor.field('location').input().val();
- if (editor.field('neighborhood').input().val()) {
- retstr = retstr + "\n" + "in the '" + editor.field('neighborhood').input().val() + "' neighborhood";
- } else {
- ;
- }
- if (editor.field('institution').input().val()) {
- //if ( ! editor.field('location').input().val().includes(editor.field('institution').input().val())) {
- retstr = retstr + "\n" + "at '" + editor.field('institution').input().val() + "'";
- //} else {
- // retstr = retstr + "\n";
- //}
- } else {
- retstr = retstr + "\n";
- }
- }
- return (retstr);
- }
- /* save for future use
- var destroyCrappyPlugin = function ($elem, eventNamespace) {
- var isInstantiated = !!$.data($elem.get(0));
- if (isInstantiated) {
- $.removeData($elem.get(0));
- $elem.off(eventNamespace);
- $elem.unbind('.' + eventNamespace);
- }
- };
- */
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE "DESCRIPTION" EDITOR
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- var postFocus = "";
- //---------------------------------------------------------------------------------------------------------------
- // Routines to handle click on description input field and oopen CKEditor
- //---------------------------------------------------------------------------------------------------------------
- // open the description editor modal and open CKEditor
- editor.field('description').input().on('click', function () {
- // copy description to modal description editor field
- $('#descEditor').val(editor.field('description').input().val());
- // create an instance of CKEditor
- $('#descEditor').ckeditor({
- customConfig: '../../../OTCalMaint/OTCalMaint/OTCalEdit_config.js',
- extraAllowedContent: 'div',
- height: 300
- });
- // Handle the editor coming ready
- CKEDITOR.instances.descEditor.on("instanceReady", function (event) {
- console.log("Editor instance ready");
- // Output self-closing tags the HTML4 way, like <br>.
- //this.dataProcessor.writer.selfClosingEnd = '>';
- // Use line breaks for block elements, tables, and lists.
- var dtd = CKEDITOR.dtd;
- for (var e in CKEDITOR.tools.extend({}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent)) {
- this.dataProcessor.writer.setRules(e, {
- indent: false,
- breakBeforeOpen: false,
- breakAfterOpen: false,
- breakBeforeClose: false,
- breakAfterClose: false
- });
- }
- // Start in source mode.
- this.setMode('source');
- // open the description editor modal
- $("#descModal").modal({ showClose: false, escapeClose: false, clickClose: false });
- //$('#descEditor').focus();
- });
- // Handle the editor being destroyed
- CKEDITOR.instances.descEditor.on("destroy", function (event) {
- console.log("Editor destroy entered");
- // close the editor modal
- $.modal.close();
- console.log("Focus goes to '" + postFocus + "'");
- if (postFocus != "") {
- editor.field(postFocus).input().focus();
- postFocus = "";
- }
- });
- });
- // Routine to handle description editor modal "cancel" button
- $('#descCancel').on('click', function () {
- postFocus = "description";
- // get rid of CKEditor
- if (CKEDITOR.instances.descEditor) {
- CKEDITOR.instances.descEditor.destroy();
- }
- });
- // Routine to handle description editor modal "save" button and update description field
- $('#descSave').on('click', function () {
- // set the data from the description editor
- editor.field('description').input().val($('#descEditor').val());
- if (editor.field('description').input().val()) {
- editor.field('description').error('');
- } else {
- editor.field('description').error('A description is required for this event');
- editor.field('description').focus();
- }
- postFocus = 'title';
- // get rid of CKEditor
- if (CKEDITOR.instances.descEditor) {
- CKEDITOR.instances.descEditor.destroy();
- }
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // ROUTINES FOR THE 'WHEN", "REPEATS" FIELDS AND DTR MODAL EVENTS
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- //---------------------------------------------------------------------------------------------------------------
- // Routine to handle click on "when' input field and open date-time-repeat modal
- //---------------------------------------------------------------------------------------------------------------
- // open the date-time-repeat modal modal
- editor.field('whenHolder').input().on('click', function () {
- // set values in the modal
- if (!setDTRModal()) {
- return (false);
- }
- window.addEventListener('resize', winResize);
- window.addEventListener('scroll', winScroll);
- // open the date-time-repeats modal
- $("#dtrModal").modal({ showClose: false, escapeClose: false, clickClose: false });
- });
- function winScroll() {
- $('#sdate').blur();
- $('#edate').blur();
- //$('#rangedatepicker').blur();
- }
- function winResize() {
- $('#sdate').datepicker('hide');
- $('#edate').datepicker('hide');
- //$('#rangedatepicker').datepicker('hide');
- winScroll();
- }
- //------------------------------------------------------------------------------------------
- // process 'cbAllDay' state change
- //------------------------------------------------------------------------------------------
- $('#cbAllDay').on('click', function () {
- if ($('#cbAllDay').prop("checked")) {
- $('#edate').hide();
- $('#etime').hide();
- $('#timeDesc').html(cnAllDay);
- } else {
- if (!setEnd()) {
- return;
- }
- $('#edate').show();
- $('#etime').show();
- $('#etime').focus();
- $('#timeDesc').html(cnTo);
- }
- });
- //------------------------------------------------------------------------------------------
- // Routine to handle date-time-repeat modal "cancel" button
- //------------------------------------------------------------------------------------------
- $('#dtrCancel').on('click', function () {
- // make the cursor stay in this field
- //editor.field('whenHolder').input().focus();
- // close the date-time-repeat editor modal
- $.modal.close();
- });
- //---------------------------------------------------------------------------------------------
- // Routine to handle date-time-repeat modal "save" button and update dates, times, and repeats
- //----------------------------------------------------------------------------------------------
- $('#dtrSave').on('click', function () {
- // update repeat
- var rptdata = $('#recurrenceinput1').recurrenceinput().update();
- $('#recurrenceinput1').val(rptdata.result);
- editor.field('rfc5545').input().val(rptdata.result);
- editor.field('rfcText').input().val(rptdata.description);
- // get the data from the date-time-repeat modal and update db fields
- var wrks = $('#sdate').val() + ' ' + $('#stime').val();
- editor.field('start').input().val(wrks);
- // see if it's an all day event
- if (editor.field('allDay').input().val() == '1') {
- editor.field('end').input().val(null);
- } else {
- var wrke = $('#edate').val() + ' ' + $('#etime').val();
- editor.field('end').input().val(wrke);
- }
- // store repeat field
- editor.field('rfc5545').input().val($('#recurrenceinput1').val());
- // close the editor modal
- $.modal.close();
- // rebuild the 'When' pseudo field
- editor.field('whenHolder').input().val(buildWhen());
- editor.field('whenHolder').error("");
- // keep cursoe in this field
- editor.field('whenHolder').input().focus();
- });
- //---------------------------------------------------------------------------------------------------------------
- // Routine to initialize the repeating date plugin
- //---------------------------------------------------------------------------------------------------------------
- function simple_repeats(e) {
- $('#recurrenceinput1').recurrenceinput({ startField: "connected_start" });
- $("#sdate").datepicker({
- dateFormat: 'DD, MM d, yy'
- });
- $("#edate").datepicker({
- dateFormat: 'DD, MM d, yy'
- });
- $('#stime').timepicker({
- 'showDuration': true,
- 'timeFormat': 'g:i A'
- });
- $('#etime').timepicker({
- 'showDuration': true,
- 'timeFormat': 'g:i A'
- });
- $('#rangedatepicker').datepicker({
- dateFormat: 'DD, MM d, yy'
- });
- $('#specdatespicker').datepicker({
- dateFormat: 'DD, MM d, yy'
- });
- }
- //----------------------------------------------------------------------------------
- // Build the "when' field contents
- //----------------------------------------------------------------------------------
- function buildWhen() {
- var retstr;
- var rpts = "";
- // if there is a start date, use it
- if (editor.field('start').input().val()) {
- // if there is a repeat string, use it
- if (editor.field('rfc5545').input().val()) {
- rpts = "\n" + "and repeats " + editor.field('rfcText').input().val();
- // otherwise, the when field needs to be clicked to open the date-time-repeats modal
- } else {
- rpts = "\n";
- }
- var sdate = editor.field('start').input().val();
- if (editor.field('allDay').input().val() == '1') {
- retstr = sdate + " for the rest of the day" + " " + rpts;
- } else {
- var edate = editor.field('end').input().val();
- retstr = sdate + " to " + edate + " " + rpts;
- }
- // otherwise, the when field needs to be clicked to open the date-time-repeats modal
- } else {
- retstr = "";
- }
- return (retstr);
- }
- //----------------------------------------------------------------------------------
- // Set the values in the dtrModal for dates, times, and repetitions
- //----------------------------------------------------------------------------------
- function setDTRModal() {
- // setup for 'allDay'
- if (editor.field('allDay').input().val() == '1') {
- $('#cbAllDay').prop("checked", true);
- $('#edate').hide();
- $('#etime').hide();
- $('#timeDesc').html(cnAllDay);
- setStart();
- } else {
- $('cbAllDay').prop("checked", false);
- $('#edate').show();
- $('#time').show();
- $('#timeDesc').html(cnTo);
- setStart();
- if (!setEnd()) {
- return (false);
- }
- //return (true);
- }
- return (true);
- }
- //----------------------------------------------------------------------------------
- // Setup the start date and time in the dtrModal
- //----------------------------------------------------------------------------------
- function setStart() {
- if (editor.field('start').input().val()) {
- var wrks = moment(editor.field('start').input().val(), 'dddd, MMMM D, YYYY h:mm A');
- $('#sdate').val(moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#sdate').datepicker('setDate', moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#stime').val(moment(wrks).format('h:mm A'));
- } else {
- var wrks = moment();
- wrks = roundTime(wrks, moment.duration(30, "minutes"), "ceil");
- $('#sdate').val(moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#sdate').datepicker('setDate', moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#stime').val(moment(wrks).format('h:mm A'));
- }
- }
- //----------------------------------------------------------------------------------
- // general time rounding function (up use "ceil", down use "floor")
- //----------------------------------------------------------------------------------
- function roundTime(date, duration, method) {
- return moment(Math[method]((+date) / (+duration)) * (+duration));
- }
- //-------------------------------------------------------------------------------------------------------------
- // Setup end date and time
- //-------------------------------------------------------------------------------------------------------------
- function setEnd() {
- if (editor.field('end').input().val()) {
- if (editor.field('allDay').input().val() == "1") {
- editor.field('end').input().val(null);
- $('#edate').hide();
- $('#etime').hide();
- $('#timeDesc').html(cnAllDay);
- return (true);
- } else {
- var wrks = moment(editor.field('start').input().val(), 'dddd, MMMM D, YYYY h:mm A');
- var wrke = moment(editor.field('end').input().val(), 'dddd, MMMM D, YYYY h:mm A');
- if (moment(wrke).isSameOrAfter(wrks, ' minute')) {
- $('#edate').val(moment(wrke).format('dddd, MMMM D, YYYY'));
- $('#edate').datepicker('setDate', moment(wrke).format('dddd, MMMM D, YYYY'));
- $('#etime').val(moment(wrke).format('h:mm A'));
- return (true);
- } else {
- alert("End date and time must occur after starting date and time.")
- return (false);
- }
- $('#edate').show();
- $('#time').show();
- $('#timeDesc').html(cnTo);
- return (true);
- }
- } else {
- var wrks = moment($('#sdate').val() + ' ' + $('#stime').val(), 'dddd, MMMM D, YYYY h:mm A');
- $('#edate').val(moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#edate').datepicker('setDate', moment(wrks).format('dddd, MMMM D, YYYY'));
- $('#etime').val(moment(wrks).add(1, 'hours').format('h:mm A'));
- return (true);
- }
- }
- //*************************************************************************************************************
- //**************************************************************************************************************
- //
- // ROUTINES FOR THE 'SEARCH" and "RESET" BUTTONS
- //
- //*************************************************************************************************************
- //*************************************************************************************************************
- //---------------------------------------------------------------------------------------------------------------
- // Routine to handle click on "Search' button
- //---------------------------------------------------------------------------------------------------------------
- $('#btnSearch').on('click', function () {
- // clear the search parameters
- $('input.column_filter').val('');
- $('input.global_filter').val('');
- // now the table search parameters
- table.search('').columns().search('').draw();
- // start search modal plugin
- searcher.openSearch();
- });
- //---------------------------------------------------------------------------------------
- // reset the list to unfiltered state
- //---------------------------------------------------------------------------------------
- $('#btnReset').on('click', function () {
- // clear the search parameters
- $('input.column_filter').val('');
- $('input.global_filter').val('');
- // now the table search parameters
- table.search('').columns().search('').draw();
- // finally, reload the table
- table.ajax.reload(null, true); // try false to hold position
- });
- //*************************************************************************************************************
- //*************************************************************************************************************
- //
- // DATATABLES DEFINITIONS
- //
- //*************************************************************************************************************
- table = $('#cc-list').DataTable({
- processing: true,
- serverSide: true,
- paging: true,
- searching: true,
- select: true,
- responsive: true,
- ordering: true,
- orderFixed: [0, 'asc'],
- dom: 'lrtip',
- ajax: {
- url: "OTCalMaint.php",
- type: "POST"
- },
- columns: [
- {
- "name": "start",
- "data": "start",
- "searchable": true
- },
- {
- "name": "end",
- "data": "end",
- "searchable": true
- },
- {
- "name": "title",
- "data": "title",
- "searchable": true
- },
- {
- "name": "description",
- "data": "description",
- "searchable": true,
- "visible": false
- },
- {
- "name": "location",
- "data": "location",
- "searchable": true,
- "visible": false
- },
- {
- "name": "institution",
- "data": "institution",
- "searchable": true,
- "visible": false
- },
- {
- "name": "address",
- "data": "address",
- "searchable": true,
- "visible": false
- },
- {
- "name": "city",
- "data": "city",
- "searchable": true,
- "visible": false
- },
- {
- "name": "state",
- "data": "state",
- "searchable": true,
- "visible": false
- },
- {
- "name": "country",
- "data": "country",
- "searchable": true,
- "visible": false
- },
- {
- "name": "zipcode",
- "data": "zipcode",
- "searchable": true,
- "visible": false
- },
- {
- "name": "neighborhood",
- "data": "neighborhood",
- "searchable": true,
- "visible": false
- },
- {
- "name": "phone",
- "data": "phone",
- "searchable": true,
- "visible": false
- },
- {
- "name": "latitude",
- "data": "latitude",
- "searchable": true,
- "visible": false
- },
- {
- "name": "longitude",
- "data": "longitude",
- "searchable": true,
- "visible": false
- },
- {
- "name": "category",
- "data": "category",
- "searchable": true,
- "visible": false
- },
- {
- "name": "allday",
- "data": "allDay",
- "searchable": true,
- "visible": false
- },
- {
- "name": "whenHold",
- "data": "whenHold",
- "searchable": true,
- "visible": false
- },
- {
- data: null,
- searchable: false,
- className: "center",
- defaultContent: '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_copy">Copy</a> / <a href="" class="editor_remove">Delete</a>'
- }
- ],
- columnDefs: [
- {
- "targets": 0,
- "searchable": false,
- "data": null,
- "title": "Date",
- "width": "10%",
- "render": function (data, type, row, meta) {
- var wrks = moment(row.start, 'dddd, MMMM D, YYYY h:mm A');
- var wrke = moment(row.end, 'dddd, MMMM D, YYYY h:mm A');
- var wrkd = moment(wrks).format('ddd, MMM D');
- return "" + wrkd;
- }
- },
- {
- "targets": 1,
- "searchable": false,
- "data": null,
- "title": "Time",
- "width": "14%",
- "render": function (data, type, row, meta) {
- var wrks = moment(row.start, 'dddd, MMMM D, YYYY h:mm A');
- var wrke = moment(row.end, 'dddd, MMMM D, YYYY h:mm A');
- if (row.allDay == '1') {
- var wrkd = moment(wrks).format('h:mm A') + " - All Day";
- } else {
- var wrkd = moment(wrks).format('h:mm A') + " - " + moment(wrke).format('h:mm A');
- }
- return "" + wrkd;
- }
- },
- {
- "targets": 2,
- "searchable": false,
- "data": null,
- "title": "Event and Location",
- "width": "60%",
- "render": function (data, type, row, meta) {
- var wloc = "";
- var wrkt = "";
- wrkt = row.title + " - " + row.institution;
- return wrkt;
- //return "" + wrkt.trim();
- }
- }
- ],
- buttons: [
- {
- extend: "create",
- editor: editor,
- formButtons: [
- 'Create',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- },
- {
- extend: "edit",
- editor: editor,
- formButtons: [
- 'Edit',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- },
- {
- extend: "remove",
- editor: editor,
- formButtons: [
- 'Delete',
- { label: 'Cancel', fn: function () { this.close(); } }
- ]
- }
- ]
- });
- //-----------------------------------------------------------------------------------------------
- // Instantiate the Searcher - NOTE: must be done after Datatable is defined
- //-----------------------------------------------------------------------------------------------
- searcher = new $.OTSearcher($('body'),
- {
- searchTarget: { name: "Datatables", table: table },
- searchType: "static",
- searchColumns: [
- { name: "Start", column: "whenHold" },
- { name: "Title", column: "title" },
- { name: "Description", column: "description" },
- { name: "Location", column: "location" },
- { name: "Institution", column: "institution" },
- { name: "Address", column: "address" },
- { name: "City", column: "city" },
- { name: "State", column: "state" },
- { name: "Country", column: "country" },
- { name: "Zipcode", column: "zipcode" },
- { name: "Neighborhood", column: "neighborhood" },
- { name: "Telephone", column: "phone" }
- ],
- global: true,
- position: "right",
- escapeClose: false,
- clickClose: false,
- showClose: false,
- width: '500px',
- height: '600px',
- debug: false
- });
- });
- </script>
- </head>
- <!-- ************************************************************************************************************ -->
- <!-- ************************************************************************************************************ -->
- <!-- Main datatable and supporting modals HTML defintion -->
- <!-- ************************************************************************************************************ -->
- <!-- ************************************************************************************************************ -->
- <body class="dt-example">
- <div id="OTCalMaintEdit">
- <editor-field name="title"></editor-field>
- <editor-field name="whenHolder"></editor-field>
- <editor-field name="locHolder"></editor-field>
- <editor-field name="description"></editor-field>
- <fieldset class="hiddendata" style="display: block;">
- <editor-field name="id"></editor-field>
- <editor-field name="category"></editor-field>
- <editor-field name="start"></editor-field>
- <editor-field name="end"></editor-field>
- <editor-field name="allDay"></editor-field>
- <editor-field name="action"></editor-field>
- <editor-field name="rfc5545"></editor-field>
- <editor-field name="rfcText"></editor-field>
- <editor-field name="rfcid"></editor-field>
- <editor-field name="location"></editor-field>
- <editor-field name="placeID"></editor-field>
- <editor-field name="institution"></editor-field>
- <editor-field name="address"></editor-field>
- <editor-field name="city"></editor-field>
- <editor-field name="state"></editor-field>
- <editor-field name="country"></editor-field>
- <editor-field name="zipcode"></editor-field>
- <editor-field name="neighborhood"></editor-field>
- <editor-field name="phone"></editor-field>
- <editor-field name="webURL"></editor-field>
- <editor-field name="mapURL"></editor-field>
- <editor-field name="locPicURL"></editor-field>
- <editor-field name="latitude"></editor-field>
- <editor-field name="longitude"></editor-field>
- </fieldset>
- </div>
- <center><h1>Celtic Computing Calendar Event Maintenance</h1></center>
- <br />
- <div>
- <button style="float:left;" id="newevent" class="otbuttons" tabindex="0">New Event</button>
- <button style="float:right;" id="btnReset" class="otbuttons" tabindex="0">Reset</button>
- <button style="float:right;" id="btnSearch" class="otbuttons" tabindex="0">Search</button>
- </div>
- <br />
- <br />
- <table id="cc-list" class="display" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th style="text-align: left;">Date</th>
- <th style="text-align: left;">Time</th>
- <th style="text-align: left;">Event and Location</th>
- <th style="text-align: left; visibility: hidden;">Description</th>
- <th style="text-align: left; visibility: hidden;">Location</th>
- <th style="text-align: left; visibility: hidden;">Institution</th>
- <th style="text-align: left; visibility: hidden;">Address</th>
- <th style="text-align: left; visibility: hidden;">City</th>
- <th style="text-align: left; visibility: hidden;">State</th>
- <th style="text-align: left; visibility: hidden;">Country</th>
- <th style="text-align: left; visibility: hidden;">Zipcode"
- <th style="text-align: left; visibility: hidden;">Neighborhood</th>
- <th style="text-align: left; visibility: hidden;">Phone</th>
- <th style="text-align: left; visibility: hidden;">Latitude</th>
- <th style="text-align: left; visibility: hidden;">Longitude</th>
- <th style="text-align: left; visibility: hidden;">Category</th>
- <th style="text-align: left; visibility: hidden;">Allday</th>
- <th style="text-align: left; visibility: hidden;">Whenhold</th>
- <th style="text-align: left;">Edit / Copy / Delete</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td style="text-align: left;"></td>
- <td style="text-align: left;"></td>
- </tr>
- </tbody>
- </table>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for Google based location selection -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="locModal" tabindex="-1" style="display:none; width: 660px">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <center><h4 class="modal-title">Event Location</h4></center>
- </div>
- <div class="modal-body">
- <div class="form-horizontal" style="width: 550px">
- <div class="form-group">
- <label class="us3-label col-sm-2 control-label">Address: </label>
- <input type="text" class="form-control" id="us3-address" style="width: 400px" />
- </div>
- <p></p>
- <div class="form-group">
- <input type="text" class="form-control" style="display:none; width: 400px" id="us3-lat"/>
- <input type="text" class="form-control" style="display:none; width: 400px" id="us3-lon" />
- <label class="us3-label p-r-small col-sm-2 control-label">Neighborhood: </label>
- <input type="text" class="form-control" style="width: 400px" id="us3-neighborhood" />
- <p></p>
- <label class="us3-label p-r-small col-sm-2 control-label">Institution: </label>
- <input type="text" class="form-control" style="width: 400px" id="us3-institution" />
- <p></p>
- <label class="us3-label col-sm-2 control-label">Phone: </label>
- <input type="text" class="form-control" id="us3-phone" style="width: 400px" />
- </div>
- <p></p>
- <center><div id="us3" style="width: 520px; height: 250px;"></div></center>
- </div>
- </div>
- <div class="modal-footer">
- <p></p>
- <center>
- <button type="button" class="otbuttons" id="locSave">Save</button>
- <button type="button" class="otbuttons" id="locCancel">Cancel</button>
- </center>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for CKEditor event description editing -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="descModal" tabindex="-1" style="display:none; width: 1000px; height: 625px">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <center><h4 class="modal-title">Event Description Editing</h4></center>
- </div>
- <div class="modal-body">
- <div class="form-horizontal">
- <textarea id="descEditor" name="descEditor"></textarea>
- </div>
- </div>
- <div class="modal-footer">
- <p></p>
- <center>
- <button type="button" class="otbuttons" id="descSave">Save</button>
- <button type="button" class="otbuttons" id="descCancel">Cancel</button>
- </center>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for date-time-repeat editing -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="dtrModal" tabindex="-1" style="display: none; width: 1225px; height: 590px;">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header" style="height: 150px;">
- <center><h4 class="modal-title">Event Date and Time Editing</h4></center>
- <p id="basicExample" style="text-align:center">
- <span id="timeHdr"><b>From</b></span>  
- <input id="sdate" type="text" class="date start" />  
- <input id="stime" type="text" class="time start" />   
- <span id="timeDesc"><b>to</b></span>  
- <input id="etime" type="text" class="time end" />  
- <input id="edate" type="text" class="date end" />   
- <span id="timeDesc"><b>OR</b></span>  
- <b><label>All Day</label></b>
- <input type="checkbox" id="cbAllDay">
- <br />
- <br />
- <textarea class="ridisplay" id="repeattext" rows="2" style="width:100%; background-color: white; text-align: center; border: none; resize: none;"></textarea>
- </p>
- <script>
- //---------------------------------------------------------------------------------
- // Routine to handle date time changes to insure start preceeds the end
- //---------------------------------------------------------------------------------
- $("#sdate, #stime, #edate, #etime").on('change', function (e) {
- // e.preventDefault();
- var minutes;
- var wdate;
- if (this.id == "sdate") {
- wdate = moment($('#sdate').val(), 'dddd, MMMM D, YYYY');
- $('#edate').val(moment(wdate).format('dddd, MMMM D, YYYY'));
- $('#edate').datepicker('setDate', moment(wdate).format('dddd, MMMM D, YYYY'));
- }
- if (editor.field('allDay').input().val() != "1") {
- // get the current start and end time from the record
- if (editor.field('start').input().val() && editor.field('end').input().val()) {
- var rsdt = moment(editor.field('start').input().val(), 'dddd, MMMM D, YYYY h:mm A');
- var redt = moment(editor.field('end').input().val(), 'dddd, MMMM D, YYYY h:mm A');
- minutes = redt.diff(rsdt, 'minutes');
- } else {
- minutes = 60;
- }
- var sdt = moment($('#sdate').val() + ' ' + $('#stime').val(), 'dddd, MMMM D, YYYY h:mm A');
- var edt = moment($('#edate').val() + ' ' + $('#etime').val(), 'dddd, MMMM D, YYYY h:mm A');
- if (sdt > edt) {
- if (this.id == "edate" || this.id == "etime") {
- sdt = moment(edt).subtract(minutes, "minutes");
- } else {
- edt = moment(sdt).add(minutes, "minutes");
- }
- } else if (sdt < edt) {
- ;
- } else {
- edt = moment(sdt).add(minutes, "minutes");
- }
- $('#sdate').val(moment(sdt).format('dddd, MMMM D, YYYY'));
- $('#sdate').datepicker('setDate', moment(sdt).format('dddd, MMMM D, YYYY'));
- $('#stime').val(moment(sdt).format('h:mm A'));
- $('#edate').val(moment(edt).format('dddd, MMMM D, YYYY'));
- $('#edate').datepicker('setDate', moment(edt).format('dddd, MMMM D, YYYY'));
- $('#etime').val(moment(edt).format('h:mm A'));
- }
- });
- </script>
- </div>
- <div class="modal-body" style="display: inline;">
- <div class="flex-container">
- <div class="flex-item item1">
- <textarea id='recurrenceinput1' name='repeat' style="display:none; width:100%;"></textarea>
- <div id="recurrarea">
- <div class="riform" id="rishow">
- <form id="biform">
- <div id="messagearea" style="display: none;"> </div>
- <div id="rirtemplate">
- <label for="repeatrtemplate" class="label"> Repeats: </label>
- <select id="rirtemplate" name="rirtemplate" class="field">
- <option value="never">Never </option>
- <option value="daily">Daily </option>
- <option value="weekdays">Weekday </option>
- <option value="weekly">Weekly </option>
- <option value="monthly">Monthly </option>
- <option value="yearly">Yearly </option>
- </select>
- <div>
- <div id="riformfields">
- <div id="ridailyinterval" class="rifield" style="">
- <label for="repeatdailyinterval" class="label"> Repeat every: </label>
- <div class="field"> <input size="2" value="1" name="ridailyinterval" id="repeatdailyinterval" type="text"> days </div>
- </div>
- <div id="riweeklyinterval" class="rifield" style="display: none;">
- <label for="repeatweeklyinterval" class="label"> Repeat every: </label>
- <div class="field"> <input size="2" value="1" name="riweeklyinterval" id="repeatweeklyinterval" type="text"> week(s) </div>
- </div>
- <div id="riweeklyweekdays" class="rifield" style="display: none;">
- <label for="repeatweeklyinterval" class="label">Repeat on:</label>
- <div class="field">
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysSU" id="repeatweeklyWeekdaysSU" value="SU" type="checkbox"> <label for="repeatweeklyWeekdaysSU">Sun</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysMO" id="repeatweeklyWeekdaysMO" value="MO" type="checkbox"> <label for="repeatweeklyWeekdaysMO">Mon</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysTU" id="repeatweeklyWeekdaysTU" value="TU" type="checkbox"> <label for="repeatweeklyWeekdaysTU">Tue</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysWE" id="repeatweeklyWeekdaysWE" value="WE" type="checkbox"> <label for="repeatweeklyWeekdaysWE">Wed</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysTH" id="repeatweeklyWeekdaysTH" value="TH" type="checkbox"> <label for="repeatweeklyWeekdaysTH">Thu</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysFR" id="repeatweeklyWeekdaysFR" value="FR" type="checkbox"> <label for="repeatweeklyWeekdaysFR">Fri</label> </div>
- <div class="riweeklyweekday"> <input name="riweeklyweekdaysSA" id="repeatweeklyWeekdaysSA" value="SA" type="checkbox"> <label for="repeatweeklyWeekdaysSA">Sat</label> </div>
- </div>
- </div>
- <div id="rimonthlyinterval" class="rifield" style="display: none;">
- <label for="rimonthlyinterval" class="label">Repeat every:</label>
- <div class="field"> <input size="2" value="1" name="rimonthlyinterval" type="text"> month(s) </div>
- </div>
- <div id="rimonthlyoptions" class="rifield" style="display: none;">
- <label for="rimonthlytype" class="label">Repeat on:</label>
- <div class="field">
- <div>
- <input value="DAYOFMONTH" name="rimonthlytype" id="repeatmonthlytype:DAYOFMONTH" type="radio"> <label for="repeatmonthlytype:DAYOFMONTH"> Day </label>
- <select name="rimonthlydayofmonthday" id="repeatmonthlydayofmonthday">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- <option value="11">11</option>
- <option value="12">12</option>
- <option value="13">13</option>
- <option value="14">14</option>
- <option value="15">15</option>
- <option value="16">16</option>
- <option value="17">17</option>
- <option value="18">18</option>
- <option value="19">19</option>
- <option value="20">20</option>
- <option value="21">21</option>
- <option value="22">22</option>
- <option value="23">23</option>
- <option value="24">24</option>
- <option value="25">25</option>
- <option value="26">26</option>
- <option value="27">27</option>
- <option value="28">28</option>
- <option value="29">29</option>
- <option value="30">30</option>
- <option value="31">31</option>
- </select>
- of the month
- </div>
- <div>
- <input value="WEEKDAYOFMONTH" name="rimonthlytype" id="repeatmonthlytype:WEEKDAYOFMONTH" type="radio"> <label for="repeatmonthlytype:WEEKDAYOFMONTH"> The </label>
- <select name="rimonthlyweekdayofmonthindex">
- <option value="+1">first</option>
- <option value="+2">second</option>
- <option value="+3">third</option>
- <option value="+4">fourth</option>
- <option value="-1">last</option>
- </select>
- <select name="rimonthlyweekdayofmonth">
- <option value="SU">Sunday</option>
- <option value="MO">Monday</option>
- <option value="TU">Tuesday</option>
- <option value="WE">Wednesday</option>
- <option value="TH">Thursday</option>
- <option value="FR">Friday</option>
- <option value="SA">Saturday</option>
- </select>
- of the month
- </div>
- </div>
- </div>
- <div id="riyearlyinterval" class="rifield" style="display: none;">
- <label for="riyearlyinterval" class="label">Repeat every:</label>
- <div class="field"> <input size="2" value="1" name="riyearlyinterval" type="text"> year(s) </div>
- </div>
- <div id="riyearlyoptions" class="rifield" style="display: none;">
- <label for="riyearlyType" class="label">Repeat on:</label>
- <div class="field">
- <div>
- <input value="DAYOFMONTH" name="riyearlyType" id="repeatyearlytype:DAYOFMONTH" type="radio"> <label for="repeatyearlytype:DAYOFMONTH"> Every </label>
- <select name="riyearlydayofmonthmonth">
- <option value="1">January</option>
- <option value="2">February</option>
- <option value="3">March</option>
- <option value="4">April</option>
- <option value="5">May</option>
- <option value="6">June</option>
- <option value="7">July</option>
- <option value="8">August</option>
- <option value="9">September</option>
- <option value="10">October</option>
- <option value="11">November</option>
- <option value="12">December</option>
- </select>
- <select name="riyearlydayofmonthday">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- <option value="8">8</option>
- <option value="9">9</option>
- <option value="10">10</option>
- <option value="11">11</option>
- <option value="12">12</option>
- <option value="13">13</option>
- <option value="14">14</option>
- <option value="15">15</option>
- <option value="16">16</option>
- <option value="17">17</option>
- <option value="18">18</option>
- <option value="19">19</option>
- <option value="20">20</option>
- <option value="21">21</option>
- <option value="22">22</option>
- <option value="23">23</option>
- <option value="24">24</option>
- <option value="25">25</option>
- <option value="26">26</option>
- <option value="27">27</option>
- <option value="28">28</option>
- <option value="29">29</option>
- <option value="30">30</option>
- <option value="31">31</option>
- </select>
- </div>
- <div>
- <input value="WEEKDAYOFMONTH" name="riyearlyType" id="repeatyearlytype:WEEKDAYOFMONTH" type="radio"> <label for="repeatyearlytype:WEEKDAYOFMONTH"> The </label>
- <select name="riyearlyweekdayofmonthindex">
- <option value="+1">first</option>
- <option value="+2">second</option>
- <option value="+3">third</option>
- <option value="+4">fourth</option>
- <option value="-1">last</option>
- </select>
- <label for="repeatyearlytype:WEEKDAYOFMONTH"> </label>
- <select name="riyearlyweekdayofmonthday">
- <option value="SU">Sunday</option>
- <option value="MO">Monday</option>
- <option value="TU">Tuesday</option>
- <option value="WE">Wednesday</option>
- <option value="TH">Thursday</option>
- <option value="FR">Friday</option>
- <option value="SA">Saturday</option>
- </select>
- of
- <select name="riyearlyweekdayofmonthmonth">
- <option value="1">January</option>
- <option value="2">February</option>
- <option value="3">March</option>
- <option value="4">April</option>
- <option value="5">May</option>
- <option value="6">June</option>
- <option value="7">July</option>
- <option value="8">August</option>
- <option value="9">September</option>
- <option value="10">October</option>
- <option value="11">November</option>
- <option value="12">December</option>
- </select>
- </div>
- </div>
- </div>
- <div id="rirangeoptions" class="rifield" style="">
- <label class="label">Ends:</label>
- <div class="field">
- <div> <input value="NOENDDATE" name="rirangetype" id="repeatrangetype:NOENDDATE" type="radio"> <label for="repeatrangetype:NOENDDATE"> Never </label> </div>
- <div> <input value="BYOCCURRENCES" name="rirangetype" id="repeatrangetype:BYOCCURRENCES" type="radio"> <label for="repeatrangetype:BYOCCURRENCES"> After </label> <input size="3" name="rirangebyoccurrencesvalue" type="text"> occurrence(s) </div>
- <div>
- <input value="BYENDDATE" name="rirangetype" id="repeatrangetype:BYENDDATE" type="radio"> <label for="repeatrangetype:BYENDDATE"> On </label> <input id="rangedatepicker" name="rirangebyenddatecalendar" type="text" readonly>
- </div>
- </div>
- </div>
- </div>
- <!-- insert rioccurances stuff here-->
- </div>
- </div>
- </form>
- <div id="specdates" class="rifield">
- <label class="label">Select date: </label><input id="specdatespicker" style="width: 200px;" type="text" readonly/> <button id="addAdditional" style="width: 75px">Additional</button> <button id="addExclude" style="width: 75px">Excluded</button>
- </div>
- </div>
- </div>
- </div>
- <div class="flex-item item2">
- <H3 style="text-align: center;">Additional Dates</H3>
- <div id="addSpec" style="overflow:scroll;height:80%;width:98%;overflow:auto">
- <center><table id="addDates" style="border: 1px solid black;"></table></center>
- </div>
- </div>
- <div class="flex-item item3">
- <H3 style="text-align: center;">Excluded Dates</H3>
- <div id="exclSpec" style="overflow:scroll;height:80%;width:98%;overflow:auto">
- <table id="exclDates" style="border: 1px solid black;"></table>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer" style="height: 55px; text-align: center; background-color:white;">
- <br />
- <button type="button" class="otbuttons" id="dtrSave">Save</button>
- <button type="button" class="otbuttons" id="dtrCancel">Cancel</button>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for Delete range selection on recurring events -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="delrptModal" tabindex="-1" style="display:none; width: 500px; height: 250px">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <center><h4 class="modal-title">Select what to delete</h4></center>
- </div>
- <div class="modal-body">
- <p>
- <input type="radio" id="delrptone" name="delAnswer" />
- <label>Delete only this event</label>
- </p>
- <p>
- <input type="radio" id="delrpttoend" name="delAnswer" />
- <label>Delete events from this one to the last in this repeating set</label>
- </p>
- <p>
- <input type="radio" id="delrptall" name="delAnswer" />
- <label>Delete all events in this repeating set</label>
- </p>
- </div>
- <div class="modal-footer">
- <p></p>
- <center>
- <button type="button" class="otbuttons" id="delrptOK">OK</button>
- <button type="button" class="otbuttons" id="delrptCancel">Cancel</button>
- </center>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for Delete conformation on single events -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="delsglModal" tabindex="-1" style="display:none; width: 300px; height: 200px">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <center><h4 class="modal-title">Confirm deletion</h4></center>
- </div>
- <div class="modal-body">
- <p>Do you wish to delete this event?</p>
- </div>
- <div class="modal-footer">
- <p></p>
- <center>
- <button type="button" class="otbuttons" id="delsglOK">Yes</button>
- <button type="button" class="otbuttons" id="delsglCancel">No</button>
- </center>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <!------------------------------------------------------------------------------------------------------------------->
- <!-- Modal for Edit range selection on recurring events -->
- <!------------------------------------------------------------------------------------------------------------------->
- <div class="modal" id="editrptModal" tabindex="-1" style="display:none; width: 500px; height: 250px">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <center><h4 class="modal-title">Select what to update</h4></center>
- </div>
- <div class="modal-body">
- <p>
- <input type="radio" id="editrptone" name="editAnswer" />
- <label>Edit only this event</label>
- </p>
- <p>
- <input type="radio" id="editrpttoend" name="editAnswer" />
- <label>Edit events from this one to the last in this repeating set</label>
- </p>
- <p>
- <input type="radio" id="editrptall" name="editAnswer" />
- <label>Edit all events in this repeating set</label>
- </p>
- </div>
- <div class="modal-footer">
- <center>
- <button type="button" class="otbuttons" id="editrptOK">OK</button>
- <button type="button" class="otbuttons" id="editrptCancel">Cancel</button>
- </center>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement