diff options
Diffstat (limited to 'radicale_infcloud/web/interface.js')
-rw-r--r-- | radicale_infcloud/web/interface.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/radicale_infcloud/web/interface.js b/radicale_infcloud/web/interface.js index e5afb8d..7f7304b 100644 --- a/radicale_infcloud/web/interface.js +++ b/radicale_infcloud/web/interface.js @@ -1289,6 +1289,33 @@ function addAndEdit(isFormHidden, deleteMode) dataToVcalendar('EDIT',origUID, inputUID, $('#etag').val(), '', isFormHidden, deleteMode); } +/* START stackrpms 2022-08-10 + * uploadFile is a clone of addAndEdit + */ +function uploadFile(fileContents) +{ + var inputUID=''; + if($('#uid').val()!='') + var coll = globalResourceCalDAVList.getEventCollectionByUID($('#uid').val().substring(0, $('#uid').val().lastIndexOf('/')+1)); + else + var coll = globalResourceCalDAVList.getEventCollectionByUID($('#event_calendar').val()); + var res = getAccount(coll.accountUID); + var tmp=res.href.match(vCalendar.pre['hrefRex']); + var origUID=tmp[1]+res.userAuth.userName+'@'+tmp[2]; + if($('#etag').val()!='') + inputUID=$('#uid').val(); + else if($('#event_calendar').val()!='choose') + inputUID = $('#event_calendar').val()+''; + else + return false; + // Always generate new UID for imported event + var newUID=globalEventList.getNewUID(); + fileContents = fileContents.replace(/^UID:.*$/gm,String("UID:"+newUID)); + putVcalendarToCollection(coll.accountUID, inputUID, "", fileContents, "", 'vevent', false, false, ""); + return true; +} +/* STOP stackrpms */ + function interResourceEdit(op, delUID,isFormHidden) { var inputUID=''; |