From 6d85b80f2dc578ee01f86145c7a93bcd40a1e526 Mon Sep 17 00:00:00 2001 From: Gabriel Monnerat <gabriel@tiolive.com> Date: Mon, 31 Jan 2011 17:40:44 +0000 Subject: [PATCH] refactor to load and edit the text_content of event git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42841 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../Base_updateCalendarEventList.xml | 5 ++++- .../erp5_web_ung_theme/EventModule_createNewEvent.xml | 2 ++ .../erp5_web_ung_theme/WebSection_newEvent.xml | 11 +++++++---- .../erp5_web_ung_theme/ung_js/ung_calendar.js.xml | 3 ++- bt5/erp5_web_ung_theme/bt/revision | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) 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 6dd63069e1..2b9dbbbc8a 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,10 @@ if request_type == "list":\n start,\n end,\n 0, display_minimized, 0,\n - random.randrange(-1,13), 1, event.getId(), event.getPortalType()])\n + random.randrange(-1,13), 1,\n + event.getId(),\n + event.getPortalType(),\n + event.getTextContent()])\n return dumps(event_dict)\n \n elif request_type == "remove":\n diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/EventModule_createNewEvent.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/EventModule_createNewEvent.xml index eeafa03ada..fe982a7cd2 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/EventModule_createNewEvent.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/EventModule_createNewEvent.xml @@ -55,12 +55,14 @@ form = context.REQUEST.form\n portal_type = form.get("portal_type")\n event_title = form.get("title")\n +text_content = form.get("event_text_content")\n start_date = DateTime("%(start_date_year)s/%(start_date_month)s/%(start_date_day)s %(start_date_hour)s:%(start_date_minute)s" % form)\n stop_date = DateTime("%(stop_date_year)s/%(stop_date_month)s/%(stop_date_day)s %(stop_date_hour)s:%(stop_date_minute)s" % form)\n portal = context.getPortalObject()\n event = portal.event_module.newContent(portal_type=portal_type, title=event_title)\n event.setStartDate(start_date)\n event.setStopDate(stop_date)\n +event.setTextContent(text_content)\n </string> </value> </item> <item> diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_newEvent.xml b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_newEvent.xml index ee2c9bd9c7..109bb3e15a 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_newEvent.xml +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_newEvent.xml @@ -55,20 +55,23 @@ <input name="title" value="" type="text" size="30">\n <p>\n <label>Start Date: </label>\n - <input class="start_date_field" name="start_date_year" value="2011" maxlength="4" type="text" size="4">/\n <input class="start_date_field" name="start_date_month" value="" maxlength="2" type="text" size="2">/\n - <input class="start_date_field" name="start_date_day" value="" maxlength="2" type="text" size="2">\n + <input class="start_date_field" name="start_date_day" value="" maxlength="2" type="text" size="2">/\n + <input class="start_date_field" name="start_date_year" value="2011" maxlength="4" type="text" size="4">\n \n <input class="start_date_field" name="start_date_hour" value="" maxlength="2" type="text" size="2">:\n <input class="start_date_field" name="start_date_minute" value="" maxlength="2" type="text" size="2">\n <p>\n <label>Stop Date: </label>\n - <input class="stop_date_field" name="stop_date_year" value="2011" maxlength="4" type="text" size="4">/\n <input class="stop_date_field" name="stop_date_month" value="" maxlength="2" type="text" size="2">/\n - <input class="stop_date_field" name="stop_date_day" value="" maxlength="2" type="text" size="2">\n + <input class="stop_date_field" name="stop_date_day" value="" maxlength="2" type="text" size="2">/\n + <input class="stop_date_field" name="stop_date_year" value="2011" maxlength="4" type="text" size="4">\n \n <input class="stop_date_field" name="stop_date_hour" value="" maxlength="2" type="text" size="2">:\n <input class="stop_date_field" name="stop_date_minute" value="" maxlength="2" type="text" size="2">\n + <p>\n + <label>Text: </label>\n + <textarea name="event_text_content" rows="2" cols="30"></textarea>\n </form> ]]></unicode> </value> 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 19dca3c277..afaca7f36f 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 @@ -100,6 +100,7 @@ function Edit(data){\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 + $("textarea[name=\'event_text_content\']").val(data[11]);\n $("input[name=\'title\']").attr("value", data[1]);\n $("input.start_date_field[name=\'start_date_year\']").attr("value", data[2].getFullYear());\n $("input.start_date_field[name=\'start_date_month\']").attr("value", (parseInt(data[2].getMonth()) + 1));\n @@ -259,7 +260,7 @@ $(document).ready(function() { \n });\n $("div#new_event_dialog").dialog({\n autoOpen: false,\n - height: 192,\n + height: 255,\n width: 410,\n modal: true,\n });\n diff --git a/bt5/erp5_web_ung_theme/bt/revision b/bt5/erp5_web_ung_theme/bt/revision index 4c009fb2fb..bea0d09c49 100644 --- a/bt5/erp5_web_ung_theme/bt/revision +++ b/bt5/erp5_web_ung_theme/bt/revision @@ -1 +1 @@ -206 \ No newline at end of file +207 \ No newline at end of file -- 2.30.9