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 @@ ...@@ -36,7 +36,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<form id="create_new_event">\n <form id="create_new_event" action="javascript:createNewEvent()">\n
<table>\n <table>\n
<tbody>\n <tbody>\n
<tr>\n <tr>\n
......
...@@ -76,7 +76,7 @@ function Edit(data){\n ...@@ -76,7 +76,7 @@ function Edit(data){\n
dataHash.start_date_year + " " + \n dataHash.start_date_year + " " + \n
dataHash.start_date_hour + ":" + \n dataHash.start_date_hour + ":" + \n
dataHash.start_date_minute;\n dataHash.start_date_minute;\n
\n \n
stop_date = dataHash.stop_date_month + "/" + \n stop_date = dataHash.stop_date_month + "/" + \n
dataHash.stop_date_day + "/" + \n dataHash.stop_date_day + "/" + \n
dataHash.stop_date_year + " " + \n dataHash.stop_date_year + " " + \n
...@@ -125,10 +125,19 @@ function View(data){\n ...@@ -125,10 +125,19 @@ function View(data){\n
});\n });\n
alert(str);\n alert(str);\n
}\n }\n
\n
function Delete(data, callback){\n function Delete(data, callback){\n
hiConfirm("Are You Sure to Delete this Event", \'Confirm\', function(r){ r && callback(0);});\n hiConfirm("Are You Sure to Delete this Event", \'Confirm\', function(r){ r && callback(0);});\n
}\n }\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 function createFieldToInsertOnDialog(){\n
return "<th class=\'cb-key\'>Event Type</th>" + \n return "<th class=\'cb-key\'>Event Type</th>" + \n
"<td class=\'cb-value\'><select name=\'portal_type\'>" +\n "<td class=\'cb-value\'><select name=\'portal_type\'>" +\n
...@@ -145,11 +154,11 @@ function createFieldToInsertOnDialog(){\n ...@@ -145,11 +154,11 @@ function createFieldToInsertOnDialog(){\n
"</select></td>"\n "</select></td>"\n
}\n }\n
\n \n
i18n.xgcalendar.content = "Title"\n i18n.xgcalendar.content = "Title";\n
i18n.xgcalendar.location = "Event Id"\n i18n.xgcalendar.location = "Event Id";\n
i18n.xgcalendar.participant = "Event Type"\n i18n.xgcalendar.participant = "Event Type";\n
i18n.xgcalendar.repeat_event = "Description"\n i18n.xgcalendar.repeat_event = "Description";\n
i18n.xgcalendar.event = "Title"\n i18n.xgcalendar.event = "Title";\n
\n \n
$(document).ready(function() { \n $(document).ready(function() { \n
var DATA_FEED_URL = "Base_updateCalendarEventList";\n var DATA_FEED_URL = "Base_updateCalendarEventList";\n
...@@ -212,19 +221,6 @@ $(document).ready(function() { \n ...@@ -212,19 +221,6 @@ $(document).ready(function() { \n
}); \n }); \n
//Add a new event\n //Add a new event\n
$("span.addcal").click(function() {\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 url ="WebSection_newEvent";\n
var date = new Date();\n var date = new Date();\n
$("div#new_event_dialog").load(url, {}, function(){\n $("div#new_event_dialog").load(url, {}, function(){\n
...@@ -252,11 +248,11 @@ $(document).ready(function() { \n ...@@ -252,11 +248,11 @@ $(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: 258,\n height: 228,\n
width: 410,\n width: 410,\n
modal: true,\n modal: true,\n
});\n });\n
$( "#datepicker" ).datepicker({\n $("#datepicker").datepicker({\n
onSelect: function(dateText, inst){\n onSelect: function(dateText, inst){\n
var dateList = dateText.split("/");\n var dateList = dateText.split("/");\n
var month = dateList[0] - 1;\n var month = dateList[0] - 1;\n
...@@ -348,6 +344,16 @@ $(document).ready(function() { \n ...@@ -348,6 +344,16 @@ $(document).ready(function() { \n
});\n });\n
});\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 window.onload = function(){\n
$("div#dvCalMain.calmain").parent().css("padding", "0 0 0 1px");\n $("div#dvCalMain.calmain").parent().css("padding", "0 0 0 1px");\n
} }
......
341 342
\ 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