Commit 6d85b80f authored by Gabriel Monnerat's avatar Gabriel Monnerat

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
parent 9288f3b6
...@@ -97,7 +97,10 @@ if request_type == "list":\n ...@@ -97,7 +97,10 @@ if request_type == "list":\n
start,\n start,\n
end,\n end,\n
0, display_minimized, 0,\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 return dumps(event_dict)\n
\n \n
elif request_type == "remove":\n elif request_type == "remove":\n
......
...@@ -55,12 +55,14 @@ ...@@ -55,12 +55,14 @@
form = context.REQUEST.form\n form = context.REQUEST.form\n
portal_type = form.get("portal_type")\n portal_type = form.get("portal_type")\n
event_title = form.get("title")\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 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 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 portal = context.getPortalObject()\n
event = portal.event_module.newContent(portal_type=portal_type, title=event_title)\n event = portal.event_module.newContent(portal_type=portal_type, title=event_title)\n
event.setStartDate(start_date)\n event.setStartDate(start_date)\n
event.setStopDate(stop_date)\n event.setStopDate(stop_date)\n
event.setTextContent(text_content)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -55,20 +55,23 @@ ...@@ -55,20 +55,23 @@
<input name="title" value="" type="text" size="30">\n <input name="title" value="" type="text" size="30">\n
<p>\n <p>\n
<label>Start Date: </label>\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_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
&nbsp;&nbsp;&nbsp;\n &nbsp;&nbsp;&nbsp;\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_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 <input class="start_date_field" name="start_date_minute" value="" maxlength="2" type="text" size="2">\n
<p>\n <p>\n
<label>Stop Date: </label>\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_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
&nbsp;&nbsp;&nbsp;\n &nbsp;&nbsp;&nbsp;\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_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 <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> </form>
]]></unicode> </value> ]]></unicode> </value>
......
...@@ -100,6 +100,7 @@ function Edit(data){\n ...@@ -100,6 +100,7 @@ function Edit(data){\n
$("form#create_new_event").append("<input type=\'hidden\' id=\'event_id\'/>");\n $("form#create_new_event").append("<input type=\'hidden\' id=\'event_id\'/>");\n
$("input#event_id").attr("value", data[9]);\n $("input#event_id").attr("value", data[9]);\n
$("form#create_new_event select").val(data[10]);\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[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_year\']").attr("value", data[2].getFullYear());\n
$("input.start_date_field[name=\'start_date_month\']").attr("value", (parseInt(data[2].getMonth()) + 1));\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 ...@@ -259,7 +260,7 @@ $(document).ready(function() { \n
});\n });\n
$("div#new_event_dialog").dialog({\n $("div#new_event_dialog").dialog({\n
autoOpen: false,\n autoOpen: false,\n
height: 192,\n height: 255,\n
width: 410,\n width: 410,\n
modal: true,\n modal: true,\n
});\n });\n
......
206 207
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment