diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Base_updateCalendarEventList.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Base_updateCalendarEventList.xml index 2125a750dfce331bd9083af88ef1393bed4487cf..920fac53b04b2aeb54dfd2d13e2b50ac9d4bc0f5 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Base_updateCalendarEventList.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/Base_updateCalendarEventList.xml @@ -97,7 +97,7 @@ if request_type == "list":\n start,\n end,\n 0, display_minimized, 0,\n - random.randrange(-1,13), 1, \'\', event.getPortalType()])\n + random.randrange(-1,13), 1, event.getId(), event.getPortalType()])\n return dumps(event_dict)\n \n elif request_type == "remove":\n @@ -108,13 +108,16 @@ elif request_type == "remove":\n return dumps({"IsSuccess": True})\n \n elif request_type == "update":\n + event_id = form.get("event_id")\n + if not event_id:\n + return dumps({"IsSuccess": False})\n title = form.get("title")\n - if not title:\n - return None\n end_date = convertToERP5DateTime(form.get("CalendarEndTime"))\n start_date = convertToERP5DateTime(form.get("CalendarStartTime"))\n - catalog_object = portal.portal_catalog.getResultValue(portal_type=portal_type_list, title=title)\n + catalog_object = portal.portal_catalog.getResultValue(portal_type=portal_type_list, id=event_id)\n event = context.restrictedTraverse(catalog_object.getPath())\n + if title and event.getTitle() != title:\n + event.setTitle(title)\n event.setStartDate(start_date)\n event.setStopDate(end_date)\n return dumps({"IsSuccess": True})\n diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung_calendar.js.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung_calendar.js.xml index 2815a44112028dd17b895adb17eb494ac280ae87..4ff308c87bc8bafcd83dad2eaa5d2a5b1b9c8a67 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung_calendar.js.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/ung_js/ung_calendar.js.xml @@ -65,9 +65,37 @@ function Edit(data){\n var url ="WebSection_newEvent";\n $("div#new_event_dialog").dialog({\n title: "Update Event",\n - buttons: {},\n + buttons: {\n + "Save": function(){\n + data = $("form#create_new_event").serializeArray();\n + var dataHash = {};\n + for (var i=0; i<data.length; i++)\n + dataHash[data[i].name] = data[i].value;\n + start_date = dataHash.start_date_day + "/" + \n + dataHash.start_date_month + "/" + \n + dataHash.start_date_year + " " + \n + dataHash.start_date_hour + ":" + \n + dataHash.start_date_minute;\n +\n + stop_date = dataHash.stop_date_day + "/" + \n + dataHash.stop_date_month + "/" + \n + dataHash.stop_date_year + " " + \n + dataHash.stop_date_hour + ":" + \n + dataHash.stop_date_minute;\n +\n + var paramList = [{name : \'CalendarEndTime\', \'value\': stop_date},\n + {name : \'CalendarStartTime\', \'value\': start_date},\n + {name : \'title\', \'value\': dataHash.title},\n + {name : \'request_type\', \'value\': \'update\'},\n + {name : \'event_id\', \'value\': $("input#event_id").attr("value")}]\n +\n + $.post("Base_updateCalendarEventList", paramList);\n + },\n + },\n });\n $("div#new_event_dialog").load(url, {}, function(){\n + $("form#create_new_event").append("<input type=\'hidden\' id=\'event_id\'/>");\n + $("input#event_id").attr("value", data[9]);\n $("form#create_new_event select").val(data[10]);\n $("input[name=\'title\']").attr("value", data[1]);\n $("input.start_date_field[name=\'start_date_year\']").attr("value", data[2].getFullYear());\n diff --git a/bt5/erp5_web_ung_theme/bt/revision b/bt5/erp5_web_ung_theme/bt/revision index ae4ee13c08e7628701b925b8962108bd7643bf6e..05cf25896dd490bcd4fab7bf941de67c6b30edee 100644 --- a/bt5/erp5_web_ung_theme/bt/revision +++ b/bt5/erp5_web_ung_theme/bt/revision @@ -1 +1 @@ -200 \ No newline at end of file +201 \ No newline at end of file