Commit eea04e7b authored by Gabriel Monnerat's avatar Gabriel Monnerat

Add field to input the end date of the event

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42746 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b829444
...@@ -55,10 +55,12 @@ ...@@ -55,10 +55,12 @@
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
start_date = DateTime("%(date_year)s/%(date_month)s/%(date_day)s %(date_hour)s:%(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
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
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -54,13 +54,21 @@ ...@@ -54,13 +54,21 @@
<label>Title: </label>\n <label>Title: </label>\n
<input name="title" value="" type="text" size="30">\n <input name="title" value="" type="text" size="30">\n
<p>\n <p>\n
<label>Date: </label>\n <label>Start Date: </label>\n
<input class="date_field" name="date_year" value="2011" maxlength="4" type="text" size="4">/\n <input class="start_date_field" name="start_date_year" value="2011" maxlength="4" type="text" size="4">/\n
<input class="date_field" name="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="date_field" name="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
&nbsp;&nbsp;&nbsp;\n &nbsp;&nbsp;&nbsp;\n
<input class="date_field" name="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="date_field" name="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
<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
&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_minute" value="" maxlength="2" type="text" size="2">\n
</form> </form>
]]></unicode> </value> ]]></unicode> </value>
......
...@@ -164,7 +164,15 @@ $(document).ready(function() { \n ...@@ -164,7 +164,15 @@ $(document).ready(function() { \n
//Add a new event\n //Add a new event\n
$("#faddbtn").click(function() {\n $("#faddbtn").click(function() {\n
var url ="WebSection_newEvent";\n var url ="WebSection_newEvent";\n
$("div#new_event_dialog").load(url);\n var date = new Date();\n
$("div#new_event_dialog").load(url, {}, function(){\n
$("input.start_date_field[name=\'start_date_month\'], input.stop_date_field[name=\'stop_date_month\']").attr("value", ""+date.getMonth()+1);\n
$("input.start_date_field[name=\'start_date_day\'], input.stop_date_field[name=\'stop_date_day\']").attr("value", date.getDate());\n
$("input.start_date_field[name=\'start_date_hour\'], input.stop_date_field[name=\'stop_date_hour\']").attr("value", date.getHours());\n
$("input.start_date_field[name=\'start_date_minute\'], input.stop_date_field[name=\'stop_date_minute\']").attr("value", date.getMinutes());\n
});\n
//$("input.start_date_field[name=\'start_date_month\'],\n
// input.stop_date_field[name=\'stop_date_month\']").attr("value", ""+date.getMonth()+1);\n
$("div#new_event_dialog").dialog("open");\n $("div#new_event_dialog").dialog("open");\n
});\n });\n
//go to today\n //go to today\n
......
195 196
\ 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