diff options
Diffstat (limited to 'radicale_infcloud/web')
-rw-r--r-- | radicale_infcloud/web/data_process.js | 785 | ||||
-rw-r--r-- | radicale_infcloud/web/interface.js | 4 |
2 files changed, 1 insertions, 788 deletions
diff --git a/radicale_infcloud/web/data_process.js b/radicale_infcloud/web/data_process.js index 7f866ed..69f81d4 100644 --- a/radicale_infcloud/web/data_process.js +++ b/radicale_infcloud/web/data_process.js @@ -7787,788 +7787,3 @@ function normalizeVcard(vcardString) return vcard_out_grouped.join(''); } - -/* START stackrpms functions 2022-08-10 - * duplicated and modified from function vcalendarToData() on line 3443 - */ -function stringToVevent(inputCollection, vstring, uid, etag, isNew) -{ - var vcalendarOrig=vstring; - var eventArray=new Array(); - - //CHECK CALSCALE - var elem=vcalendarOrig.match(vCalendar.pre['contentline_CALSCALE']); - if(elem!=null) - { - calscale=elem[0].match(vCalendar.pre['contentline_parse'])[4]; - if(calscale!='GREGORIAN') - { - console.log("Error:'"+uid+"': Unsupported calscale in:"+vcalendarOrig); - return false; - } - } - //CHECK VERSION - var elemV=vcalendarOrig.match(vCalendar.pre['contentline_VERSION']); - if(elemV!=null) - { - var ver=elemV[0].match(vCalendar.pre['contentline_parse'])[4]; - if(ver!='2.0') - { - console.log("Error:'"+uid+"': Unsupported version ("+ver+") in:"+vcalendarOrig); - return false; - } - } - - //FIX TIMEZONE - var beginTimeZone=vcalendarOrig.indexOf('BEGIN:VTIMEZONE'); - var startEndTimeZone=vcalendarOrig.lastIndexOf('END:VTIMEZONE'); - var endTimeZone=0; - - var rid=uid.substring(0, uid.lastIndexOf('/')+1); - var evid=uid.substring(uid.lastIndexOf('/')+1, uid.length); - - var isChange=false, - needReload=false; - - if(!isNew) - { - var events=findEventInArray(uid, true); - if(events!='') - { - if(events.etag!=etag) - { - for(var i=0; i<events.alertTimeOut.length; i++) - clearTimeout(events.alertTimeOut[i]); - deleteEventFromArray(uid); - - if($('#show').val()!='') - { - if($('#show').val()==uid) - { - if($('#repeatEvent').val()=="true" || $('#recurrenceID').val()!='') - { - var name=globalCalEvent.title; - showEventForm(null, null, {title: name, id:uid}, globalJsEvent, 'show','', true); - $('#editAll').css('visibility','hidden'); - $('#editFuture').css('visibility','hidden'); - $('#editOnlyOne').css('visibility','hidden'); - $('#repeatConfirmBoxContent').html('<b>'+name+"</b> "+localization[globalInterfaceLanguage].repeatChangeTxt); - $('#repeatConfirmBoxQuestion').html(localization[globalInterfaceLanguage].repeatChangeTxtClose); - } - else - needReload=true; - } - } - isChange=true; - } - } - } - - if((beginTimeZone!=-1) && (startEndTimeZone!=-1)) - { - for(i=(startEndTimeZone+2);i<vcalendarOrig.length;i++) - { - if(vcalendarOrig.charAt(i)=='\n') - { - endTimeZone=i+1; - break; - } - } - vTimeZone=vcalendarOrig.substring(beginTimeZone, endTimeZone); - vcalendar=vcalendarOrig.substring(0, beginTimeZone)+vcalendarOrig.substring(endTimeZone, vcalendarOrig.length); - } - - var recurrence_id_array=new Array(); - /* matching for BEGIN:VEVENT */ - while(vcalendarOrig.match(vCalendar.pre['vevent'])!=null) - { - if(vcalendarOrig.substring(vcalendarOrig.indexOf('BEGIN:VEVENT')-2, vcalendarOrig.indexOf('BEGIN:VEVENT'))=='\r\n') - { - var partEvent=vcalendarOrig.substring(vcalendarOrig.indexOf('BEGIN:VEVENT')-2,vcalendarOrig.indexOf('END:VEVENT')+'END:VEVENT'.length); - vcalendarOrig=vcalendarOrig.replace(partEvent, ''); - } - else - { - var partEvent=vcalendarOrig.substring(vcalendarOrig.indexOf('BEGIN:VEVENT'),vcalendarOrig.indexOf('END:VEVENT')+'END:VEVENT'.length); - vcalendarOrig=vcalendarOrig.replace(partEvent, ''); - partEvent+='\r\n'; - } - var rec_array=partEvent.match(vCalendar.pre['contentline_RECURRENCE_ID']); - var uidString=partEvent.match(vCalendar.pre['contentline_UID']); - - if(uidString!=null && rec_array!=null) - { - recurrence_id_array[recurrence_id_array.length]=rec_array[0].match(vCalendar.pre['contentline_parse'])[4]+';'+uidString[0].match(vCalendar.pre['contentline_parse'])[4]; - } - eventArray[eventArray.length]=partEvent; - } - if(eventArray.length==0) - console.log("Error: '"+uid+"': unable to parse vEvent"); - - for(var evIt=0; evIt<eventArray.length; evIt++) - { - var oo='', - note='', - start='', - end='', - title='', - location='', - all=false, - frequency='', - interval='', - byMonthDay='', - byDay='', - until='', - isUntilDate=false, - isRepeat=false, - alertTime=new Array(), - alertNote=new Array(), - alertTimeOut=new Array(), - valOffsetFrom='', - valOffsetTo='', - intOffset=0, - tzName='local', - realStart='', - realEnd='', - rec_id='', - wkst='', - classType='', - avail='', - hrefUrl='', - returnForValue = true, - stringUID='', - priority="0", - status='', - pars=new Array(); - var dtStartTimezone=''; - var dates = new Array(); - var vcalendar=eventArray[evIt]; - var stringUID=vcalendar.match(vCalendar.pre['contentline_UID']); - if(stringUID!=null) - stringUID=stringUID[0].match(vCalendar.pre['contentline_parse'])[4]; - - var exDates=new Array(); - var exDate=null; - var exDate_array=new Array(); - var vcalendar2=vcalendar+''; - - while(vcalendar2.match(vCalendar.pre['contentline_EXDATE'])!= null) - { - exDate=vcalendar2.match(vCalendar.pre['contentline_EXDATE']); - exDate_array[exDate_array.length]=exDate[0]; - vcalendar2=vcalendar2.replace(exDate,'\r\n'); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_RRULE2']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - pars=parsed[4].split(';'); - var parString=''; - - if(pars.length>0) - isRepeat=true; - for(var i=0;i<pars.length;i++) - { - if(pars[i].indexOf('FREQ=')!=-1) - frequency=pars[i].split('=')[1]; - else if(pars[i].indexOf('INTERVAL=')!=-1) - interval=pars[i].split('=')[1]; - else if(pars[i].indexOf('COUNT=')!=-1) - { - until=pars[i].split('=')[1]; - if(until==0) - { - returnForValue = false; - break - } - else if(isNaN(until)) - { - returnForValue = false; - break - } - } - else if(pars[i].indexOf('UNTIL=')!=-1) - { - isUntilDate=true; - until=pars[i].split('=')[1]; - //if(until.indexOf('T')==-1) -// until+='T000000Z'; - - } - else if(pars[i].indexOf('WKST=')!=-1) - { - wkst=pars[i].split('=')[1].replace(/\d*MO/,1).replace(/\d*TU/,2).replace(/\d*WE/,3).replace(/\d*TH/,4).replace(/\d*FR/,5).replace(/\d*SA/,6).replace(/\d*SU/,0); - if(globalSettings.mozillasupport.value!=null && globalSettings.mozillasupport.value) - wkst=''; - } - else if(pars[i].indexOf('BYMONTHDAY=')!=-1) - byMonthDay=pars[i].split('=')[1]; - else if(pars[i].indexOf('BYDAY=')!=-1) - { - byDay=pars[i].split('=')[1]; - byDay=byDay.replace(/\d*MO/,1).replace(/\d*TU/,2).replace(/\d*WE/,3).replace(/\d*TH/,4).replace(/\d*FR/,5).replace(/\d*SA/,6).replace(/\d*SU/,0).split(','); - } - } - if(!returnForValue) - { - - continue; - } - if(!interval) - interval=1; - } - - var dayLightStartDate, dayLightEndDate, tzObject; - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_DTSTART']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - - start=parsed[4]; - var help1=start; - - if(help1.indexOf("T")==-1) - { - help1=help1.substring(0, 4)+'-'+help1.substring(4, 6)+'-'+help1.substring(6, 8); - all=true; - } - else - { - help1=help1.substring(0, 4)+'-'+help1.substring(4, 6)+'-'+help1.substring(6, 8)+'T'+help1.substring(9, 11)+':'+help1.substring(11, 13)+':'+help1.substring(13, 15); - all=false; - } - - var t=$.fullCalendar.parseDate(help1); - if(t==null) - return false; - if(t.toString()=='Invalid Date') - return false; - - if(!all) - { - parsed_value=vcalendarSplitParam(parsed[3]); - for(h=1;h<parsed_value.length;h++) - if(parsed_value[h]!='') - dtStartTimezone=parsed_value[h]; - dtStartTimezone=dtStartTimezone.split('=') - - if(start.charAt(start.length-1)=='Z') - tzName='UTC'; - if(dtStartTimezone.length>1 || tzName=='UTC') - { - if(tzName!='UTC') - tzName=$.trim(dtStartTimezone[1]); - var finTZ = checkTimezone(tzName); - if(finTZ!=null) - tzName = finTZ; - if(globalSettings.timezonesupport.value && tzName in timezones) - { - valOffsetFrom=getOffsetByTZ(tzName, t); - intOffset=(getLocalOffset(t)*-1*1000)-valOffsetFrom.getSecondsFromOffset()*1000; - } - } - else if(processedTimezones.indexOf(tzName)==-1) - { - if(timeZonesEnabled.indexOf(tzName)==-1) - timeZonesEnabled.push('local'); - processedTimezones.push('local'); - } - if(tzName!='' && tzName != 'local') - if(processedTimezones.indexOf(tzName)==-1) - { - if(timeZonesEnabled.indexOf(tzName)==-1) - timeZonesEnabled.push(tzName); - processedTimezones.push(tzName); - } - } - else - tzName = globalSessionTimeZone; - realStart=$.fullCalendar.parseDate(help1); - //inputEvent.start=$.fullCalendar.parseDate(help1); - start=$.fullCalendar.parseDate(help1); - if(intOffset) - { - //inputEvent.start.setTime(inputEvent.start.getTime()+intOffset); - start.setTime(start.getTime()+intOffset); - } - if(exDate_array!=null) - for(var j=0;j<exDate_array.length;j++) - { - var exString=(exDate_array[j]+'\r\n').match(vCalendar.pre['contentline_parse'])[4]; - if(exString.indexOf('T')!=-1 && exString.indexOf('Z')!=-1) - var utcTime=exString.parseComnpactISO8601().setSeconds(getLocalOffset(exString.parseComnpactISO8601())*-1); - else if(exString.indexOf('T')!=-1 && exString.indexOf('Z')==-1) - var utcTime=exString.parseComnpactISO8601(); - else - { - if(help1.indexOf('T')!=-1) - exString += 'T' + $.fullCalendar.formatDate(start,'HHmmss'); - - var utcTime=exString.parseComnpactISO8601(); - } - exDates[exDates.length]=new Date(utcTime).toString(); - } - var valarm=vcalendar.match(vCalendar.pre['valarm']); - if(valarm!=null) - { - vcalendar=vcalendar.replace(valarm[0], ''); - var alarmString=''; - var alarmArray=new Array(); - for(var i=0;i<valarm[0].length;i++) - { - if(valarm[0].substring(i-'END:VALARM'.length, i)=='END:VALARM') - { - alarmArray[alarmArray.length]=alarmString+'\r\n'; - alarmString=''; - } - alarmString+=valarm[0][i]; - } - - for(var j=0;j<alarmArray.length;j++) - { - checkA=alarmArray[j].match(vCalendar.re['valarm']); - if(checkA!=null) - { - action=(alarmArray[j]).match(vCalendar.pre['contentline_ACTION']); - if(action!=null) - parsed=action[0].match(vCalendar.pre['contentline_parse']); - else - break; - - trigger=alarmArray[j].match(vCalendar.pre['contentline_TRIGGER']); - if(trigger!=null) - { - parsed=(trigger[0]+'\r\n').match(vCalendar.pre['contentline_parse']); - if(parsed!=null) - { - value=parsed[4]; - var checkD=value.match(vCalendar.pre['date-time-value']); - var intOffsetA=''; - var tzNameA=''; - if(checkD!=null) - { - if(parsed[3]) - var dtStartTimezoneA=parsed[3].split('='); - var alarmTimeA=$.fullCalendar.parseDate(value.substring(0, 4)+'-'+value.substring(4, 6)+'-'+value.substring(6, 8)+'T'+value.substring(9, 11)+':'+value.substring(11, 13)+':'+value.substring(13, 15)); - if(value.charAt(value.length-1)=='Z') - tzNameA='UTC'; - if(dtStartTimezoneA.length>1 || tzNameA=='UTC') - { - if(tzNameA!='UTC' && dtStartTimezoneA[0]==';TZID') - tzNameA=$.trim(dtStartTimezoneA[1]); - var finTZ = checkTimezone(tzNameA); - if(finTZ!=null) - tzNameA = finTZ; - if(globalSettings.timezonesupport.value && tzNameA in timezones) - { - var valOffsetFromA=getOffsetByTZ(tzNameA, alarmTimeA); - intOffsetA=getOffsetByTZ(tzName, alarmTimeA).getSecondsFromOffset()*1000-valOffsetFromA.getSecondsFromOffset()*1000; - } - } - else if(processedTimezones.indexOf(tzName)==-1) - { - if(timeZonesEnabled.indexOf(tzName)==-1) - timeZonesEnabled.push('local'); - processedTimezones.push('local'); - } - if(tzNameA!='' && tzNameA != 'local') - if(processedTimezones.indexOf(tzNameA)==-1) - { - if(timeZonesEnabled.indexOf(tzNameA)==-1) - timeZonesEnabled.push(tzNameA); - processedTimezones.push(tzNameA); - } - if(intOffsetA!='') - alarmTimeA.setTime(alarmTimeA.getTime()+intOffsetA); - alertTime[j]=$.fullCalendar.formatDate(alarmTimeA,"yyyy-MM-dd'T'HH:mm:ss"); - } - else - { - alertTime[j]=0; - if(value.indexOf('W')!=-1) - alertTime[j]=parseAlarmWeek(value); - else if(value.indexOf('D')!=-1) - alertTime[j]=parseAlarmDay(value); - else if(value.indexOf('T')!=-1) - alertTime[j]=parseAlarmTime(value); - if(parsed[4].charAt(0)=="-") - alertTime[j]="-"+alertTime[j]; - else - alertTime[j]="+"+alertTime[j]; - } - } - } - else - break; - - noteA=alarmArray[j].match(vCalendar.pre['contentline_NOTE']); - if(noteA!=null) - { - parsed=noteA[0].match(vCalendar.pre['contentline_parse']); - alertNote[j]=parsed[4]; - } - else - alertNote[j]='Default note'; - } - } - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_LOCATION']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - location=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_NOTE']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - note=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_SUMMARY']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - title=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_PRIORITY']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - priority=vcalendarUnescapeValue(parsed[4]); - } - - var index=0; - for(var p=0;p<globalResourceCalDAVList.collections.length;p++) - if(typeof globalResourceCalDAVList.collections[p].uid !='undefined' && globalResourceCalDAVList.collections[p].uid==uid) - { - index=p; - break; - } - var firstPart=index.pad(String(globalResourceCalDAVList.collections.length).length); - - var compareString=(firstPart + title).toLowerCase(); - - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_CLASS']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - classType=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_STATUS']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - status=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_TRANSP']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - avail=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_URL']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - hrefUrl=vcalendarUnescapeValue(parsed[4]); - } - - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_RECURRENCE_ID']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - var rec=parsed[4]; - /*if(rec.indexOf("T")==-1) - { - rec=rec.substring(0, 4)+'/'+rec.substring(4, 6)+'/'+rec.substring(6, 8); - var d=$.fullCalendar.parseDate(rec); - var da=new Date(d.getTime()-1*24*60*60*1000); - var day=da.getDate(); - - if(day<10) - day='0'+day; - - var month=da.getMonth(); - month++; - if(month<10) - month='0'+month; - - rec=da.getFullYear()+'-'+month+'-'+day; - } - else - rec=rec.substring(0, 4)+'-'+rec.substring(4, 6)+'-'+rec.substring(6, 8)+'T'+rec.substring(9, 11)+':'+rec.substring(11, 13)+':'+rec.substring(13, 15); - rec_id=$.fullCalendar.parseDate(rec);*/ - //if(!rec_id || rec_id=='Invalid Date') - // rec_id=''; - rec_id=rec; - } - - var isDuration = false; - var dur = 0; - vcalendar_element=vcalendar.match(vCalendar.pre['contentline_DTEND']); - if(vcalendar_element!=null) - { - parsed=vcalendar_element[0].match(vCalendar.pre['contentline_parse']); - end=parsed[4]; - var help=end; - if(help.indexOf("T")==-1) - { - help=help.substring(0, 4)+'-'+help.substring(4, 6)+'-'+help.substring(6, 8); - var d=$.fullCalendar.parseDate(help); - var da=new Date(d.getTime()); - if(help1.indexOf("T")==-1) - da.setDate(da.getDate()-1); - help=$.fullCalendar.formatDate(da, "yyyy-MM-dd"); - all=true; - if(help1.indexOf("T")!=-1) - { - all=false; - help+='T00:00:00'; - if(tzName == 'UTC') - help+='Z'; - } - } - else - { - help=help.substring(0, 4)+'-'+help.substring(4, 6)+'-'+help.substring(6, 8)+'T'+help.substring(9, 11)+':'+help.substring(11, 13)+':'+help.substring(13, 15); - all=false; - } - } - else - { - var checkDur=vcalendar.match(vCalendar.pre['dur-value']); - if(checkDur!=null) - { - var checkP = (checkDur[0]+'\r\n').match(vCalendar.pre['contentline_parse']); - if(checkP != null) - { - var value=checkP[4]; - - var number = 0; - if(value.indexOf('W')!=-1) - number=parseAlarmWeek(value); - else if(value.indexOf('D')!=-1) - number=parseAlarmDay(value); - else if(value.indexOf('T')!=-1) - number=parseAlarmTime(value); - if(parsed[4].charAt(0)=="-") - number="-"+number; - else - number="+"+number; - dur=parseInt(number.substring(1, number.length-1),10); - isDuration = true; - } - } - } - if(isDuration) - { - var st=''; - if(!all) - st = $.fullCalendar.parseDate(help1); - else - { - st = $.fullCalendar.parseDate(help1+'T00:00:00'); - //date object mindfuck problem - st.setMilliseconds(-1); - } - var durDate = new Date(st.getTime() + dur); - help = $.fullCalendar.formatDate(durDate,"yyyy-MM-dd'T'HH:mm:ss"); - } - - if(typeof help=='undefined' || help=='' || help==null) - help=help1; - var t1=$.fullCalendar.parseDate(help); - if(t1==null) - return false; - else if(t1.toString()=='Invalid Date') - return false; - - if(!all) - { - if(end.charAt(end.length-1)=='Z') - tzName='UTC'; - if(dtStartTimezone.length>1 || tzName=='UTC') - { - if(tzName!='UTC') - tzName=$.trim(dtStartTimezone[1]); - var finTZ = checkTimezone(tzName); - if(finTZ!=null) - tzName = finTZ; - if(globalSettings.timezonesupport.value && tzName in timezones) - { - valOffsetFrom=getOffsetByTZ(tzName, t1); - intOffset=(getLocalOffset(t1)*-1*1000)-valOffsetFrom.getSecondsFromOffset()*1000; - } - } - else if(processedTimezones.indexOf(tzName)==-1) - { - if(timeZonesEnabled.indexOf(tzName)==-1) - timeZonesEnabled.push('local'); - processedTimezones.push('local'); - } - //realEnd=$.fullCalendar.parseDate(help); - //help1+=valOffsetFrom; - - if(tzName!='' && tzName != 'local') - if(processedTimezones.indexOf(tzName)==-1) - { - if(timeZonesEnabled.indexOf(tzName)==-1) - timeZonesEnabled.push(tzName); - processedTimezones.push(tzName); - } - } - else - tzName = globalSessionTimeZone; - - realEnd=$.fullCalendar.parseDate(help); - //inputEvent.end=$.fullCalendar.parseDate(help); - end=$.fullCalendar.parseDate(help); - if(intOffset) - { - //inputEvent.end.setTime(inputEvent.end.getTime()+intOffset); - end.setTime(end.getTime()+intOffset); - } - } - else - return false; - - if(globalVisibleCalDAVCollections.indexOf(rid)!=-1 || isChange || isNew) - { - if(isRepeat) - { - var futureRLimit = new Date(globalToLoadedLimit.getTime()) - futureRLimit.setDate(futureRLimit.getDate()+14); - var ruleString=vcalendar.match(vCalendar.pre['contentline_RRULE2'])[0].match(vCalendar.pre['contentline_parse'])[4]; - //inputEvent.isRepeat=true; - if(realStart) - var varDate=new Date(realStart.getTime()); - else - var varDate=new Date(start.getTime()); - - if(realEnd) - var varEndDate=new Date(realEnd.getTime()); - else - var varEndDate=new Date(end.getTime()); - - var lastGenDate=''; - var repeatStart=new Date(varDate.getTime()); - var repeatEnd=new Date(varEndDate.getTime()); - var untilDate='',realUntilDate='',realUntil=''; - - if(until!=='') - { - if(isUntilDate) - { - if(until.indexOf('T')!=-1) - { - var uString = until.substring(0, 4)+'-'+until.substring(4, 6)+'-'+until.substring(6, 8)+'T'+until.substring(9, 11)+':'+until.substring(11, 13)+':'+until.substring(13, 15); - var ut=$.fullCalendar.parseDate(uString); - if(ut==null) - return false; - if(ut.toString()=='Invalid Date') - return false; - if(!all) - { - if(globalSettings.timezonesupport.value && tzName in timezones) - valOffsetFrom=getOffsetByTZ(tzName, ut); - if(valOffsetFrom) - { - var intOffset=valOffsetFrom.getSecondsFromOffset()*1000; - ut.setTime(ut.getTime()+intOffset); - } - } - untilDate = new Date(ut.getTime()); - } - else - { - untilDate=$.fullCalendar.parseDate(until.substring(0, 4)+'-'+until.substring(4, 6)+'-'+until.substring(6, 8)); - untilDate.setHours(realStart.getHours()); - untilDate.setMinutes(realStart.getMinutes()); - untilDate.setSeconds(realStart.getSeconds()); - } - - realUntil=''; - } - else - { - untilDate=''; - realUntil=until; - - } - realUntilDate=untilDate; - //inputEvent.untilDate=untilDate; - } - else - { - untilDate=new Date(futureRLimit.getTime()); - realUntilDate=''; - //inputEvent.untilDate='never'; - } - var repeatCount=0, realRepeatCount=0; - - //if(!inputEvent.isDrawn) - if(true) - { - if(alertTime.length>0) - { - var aTime=''; - var now=new Date(); - if(!inputCollection.ignoreAlarms) - alertTimeOut=setAlertTimeouts(false,alertTime, start, end, {allDay:all, title:title}, true, uid); - } - realRepeatCount++; - var checkRec=isInRecurrenceArray(varDate,stringUID,recurrence_id_array, tzName); - - if(exDates.length>0) - if(exDates.indexOf(varDate.toString())!=-1) - checkRec=true; - if(!checkRec) - { - repeatCount++; - var tmpObj=new items(etag, start, end, title, all, uid, rid, evid, note, inputCollection.displayValue, alertTime, alertNote, realUntilDate, frequency, interval, realUntil, repeatStart, repeatEnd, byMonthDay,repeatCount, realRepeatCount, vcalendar, location, alertTimeOut,tzName, realStart, realEnd, byDay, rec_id,wkst,classType, avail,hrefUrl, compareString,priority,status,ruleString); - // stackrpms,2 Disable this next line because it makes an uneditable, duplicate visible entry on the current calendar. - //globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj); - } - } - - var lastGenDate=generateRepeatInstances({ - untilDate:realUntilDate, - repeatStart:varDate, - futureRLimit:futureRLimit, - stringUID:stringUID, - recurrence_id_array:recurrence_id_array, - exDates:exDates, - alertTime:alertTime, - ignoreAlarms:inputCollection.ignoreAlarms, - items:new items(etag, varDate, varEndDate, title, all, uid, rid, evid, note, inputCollection.displayValue, alertTime, alertNote, realUntilDate, frequency, interval, realUntil, repeatStart, repeatEnd, byMonthDay, repeatCount, realRepeatCount, vcalendar, location, alertTimeOut, tzName, realStart, realEnd, byDay, rec_id,wkst,classType, avail,hrefUrl,compareString,priority,status,ruleString) - }); - } - else - { - if(!inputCollection.ignoreAlarms) - alertTimeOut=setAlertTimeouts(false,alertTime, start, end, {allDay:all, title:title},true,uid); - - var tmpObj=new items(etag, start, end, title, all, uid, rid, evid, note, inputCollection.displayValue, alertTime, alertNote, '', '', '', '', '', '', '', '', '', vcalendar, location, alertTimeOut, tzName, realStart, realEnd, byDay, rec_id,wkst,classType, avail,hrefUrl,compareString,priority,status,ruleString); - if(isChange) - { - if(needReload) - showEventForm(null, null, tmpObj, globalJsEvent, 'show', ''); - } - // stackrpms,2 Disable this next line because it makes an uneditable, duplicate visible entry on the current calendar. - //globalEventList.displayEventsArray[rid].splice(globalEventList.displayEventsArray[rid].length, 0, tmpObj); - } - } - } - //inputEvent.isDrawn=true; - return tmpObj; -} -/* END stackrpms functions */ diff --git a/radicale_infcloud/web/interface.js b/radicale_infcloud/web/interface.js index ce00437..7f7304b 100644 --- a/radicale_infcloud/web/interface.js +++ b/radicale_infcloud/web/interface.js @@ -1308,11 +1308,9 @@ function uploadFile(fileContents) inputUID = $('#event_calendar').val()+''; else return false; - // ripped from data_process.js:1474 + // Always generate new UID for imported event var newUID=globalEventList.getNewUID(); fileContents = fileContents.replace(/^UID:.*$/gm,String("UID:"+newUID)); - newEvent = stringToVevent(coll, fileContents, inputUID, $('#etag').val(), true); - //console.log(newEvent); putVcalendarToCollection(coll.accountUID, inputUID, "", fileContents, "", 'vevent', false, false, ""); return true; } |