Commit db6ab3b3 authored by Gabriel Monnerat's avatar Gabriel Monnerat

fix issue to create new event hitting Enter

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45260 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e679f1b
......@@ -36,7 +36,7 @@
<key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<form id="create_new_event">\n
<form id="create_new_event" action="javascript:createNewEvent()">\n
<table>\n
<tbody>\n
<tr>\n
......
......@@ -67,33 +67,33 @@ function Edit(data){\n
title: "Update Event",\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_month + "/" + \n
dataHash.start_date_day + "/" + \n
dataHash.start_date_year + " " + \n
dataHash.start_date_hour + ":" + \n
dataHash.start_date_minute;\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_month + "/" + \n
dataHash.start_date_day + "/" + \n
dataHash.start_date_year + " " + \n
dataHash.start_date_hour + ":" + \n
dataHash.start_date_minute;\n
\n
stop_date = dataHash.stop_date_month + "/" + \n
dataHash.stop_date_day + "/" + \n
dataHash.stop_date_year + " " + \n
dataHash.stop_date_hour + ":" + \n
dataHash.stop_date_minute;\n
\n
stop_date = dataHash.stop_date_month + "/" + \n
dataHash.stop_date_day + "/" + \n
dataHash.stop_date_year + " " + \n
dataHash.stop_date_hour + ":" + \n
dataHash.stop_date_minute;\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
{name : \'event_text_content\', \'value\': dataHash.event_text_content}]\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
{name : \'event_text_content\', \'value\': dataHash.event_text_content}]\n
\n
$.post("Base_updateCalendarEventList", paramList, function(){\n
$("div#new_event_dialog").dialog("close");\n
$("div#showreflashbtn.fbutton").click();\n
});\n
$.post("Base_updateCalendarEventList", paramList, function(){\n
$("div#new_event_dialog").dialog("close");\n
$("div#showreflashbtn.fbutton").click();\n
});\n
},\n
},\n
});\n
......@@ -125,10 +125,19 @@ function View(data){\n
});\n
alert(str);\n
}\n
\n
function Delete(data, callback){\n
hiConfirm("Are You Sure to Delete this Event", \'Confirm\', function(r){ r && callback(0);});\n
}\n
\n
function createNewEvent(){\n
$.post("EventModule_createNewEvent",\n
$("form#create_new_event").serialize(), function(){\n
$("div#new_event_dialog").dialog("close");\n
$("div#showreflashbtn.fbutton").click();\n
});\n
}\n
\n
function createFieldToInsertOnDialog(){\n
return "<th class=\'cb-key\'>Event Type</th>" + \n
"<td class=\'cb-value\'><select name=\'portal_type\'>" +\n
......@@ -145,11 +154,11 @@ function createFieldToInsertOnDialog(){\n
"</select></td>"\n
}\n
\n
i18n.xgcalendar.content = "Title"\n
i18n.xgcalendar.location = "Event Id"\n
i18n.xgcalendar.participant = "Event Type"\n
i18n.xgcalendar.repeat_event = "Description"\n
i18n.xgcalendar.event = "Title"\n
i18n.xgcalendar.content = "Title";\n
i18n.xgcalendar.location = "Event Id";\n
i18n.xgcalendar.participant = "Event Type";\n
i18n.xgcalendar.repeat_event = "Description";\n
i18n.xgcalendar.event = "Title";\n
\n
$(document).ready(function() { \n
var DATA_FEED_URL = "Base_updateCalendarEventList";\n
......@@ -212,19 +221,6 @@ $(document).ready(function() { \n
}); \n
//Add a new event\n
$("span.addcal").click(function() {\n
$("div#new_event_dialog").dialog({\n
title: "Create New Event",\n
buttons: {\n
"Create": function(){\n
$.post("EventModule_createNewEvent",\n
$("form#create_new_event").serialize(),\n
function(){\n
$("div#new_event_dialog").dialog("close");\n
$("div#showreflashbtn.fbutton").click();\n
});\n
}\n
},\n
});\n
var url ="WebSection_newEvent";\n
var date = new Date();\n
$("div#new_event_dialog").load(url, {}, function(){\n
......@@ -252,11 +248,11 @@ $(document).ready(function() { \n
});\n
$("div#new_event_dialog").dialog({\n
autoOpen: false,\n
height: 258,\n
height: 228,\n
width: 410,\n
modal: true,\n
});\n
$( "#datepicker" ).datepicker({\n
$("#datepicker").datepicker({\n
onSelect: function(dateText, inst){\n
var dateList = dateText.split("/");\n
var month = dateList[0] - 1;\n
......@@ -348,6 +344,16 @@ $(document).ready(function() { \n
});\n
});\n
\n
$("div#new_event_dialog").ready(function(){\n
$("div#new_event_dialog").dialog({\n
title: "Create New Event",\n
autoOpen: false,\n
buttons: {\n
"Create": createNewEvent,\n
},\n
});\n
});\n
\n
window.onload = function(){\n
$("div#dvCalMain.calmain").parent().css("padding", "0 0 0 1px");\n
}
......
341
\ No newline at end of file
342
\ 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