Commit e79454e9 authored by Gabriel Monnerat's avatar Gabriel Monnerat

- fix identation and added event id in request when the event will be updated

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42769 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1a43838d
...@@ -1168,60 +1168,55 @@ ...@@ -1168,60 +1168,55 @@
}\n }\n
//to populate the data \n //to populate the data \n
function populate() {\n function populate() {\n
if (option.isloading) {\n if (option.isloading){\n
return true;\n return true;\n
}\n }\n
if (option.url && option.url != "") {\n if (option.url && option.url != "") {\n
option.isloading = true;\n option.isloading = true;\n
//clearcontainer();\n //clearcontainer();\n
if (option.onBeforeRequestData && $.isFunction(option.onBeforeRequestData)) {\n if (option.onBeforeRequestData && $.isFunction(option.onBeforeRequestData)) {\n
option.onBeforeRequestData(1);\n option.onBeforeRequestData(1);\n
}\n }\n
var zone = new Date().getTimezoneOffset() / 60 * -1;\n var zone = new Date().getTimezoneOffset() / 60 * -1;\n
var param = [\n var param = [\n
{ name: "showdate", value: dateFormat.call(option.showday, i18n.xgcalendar.dateformat.fulldayvalue) },\n {name: "showdate", value: dateFormat.call(option.showday, i18n.xgcalendar.dateformat.fulldayvalue)},\n
{ name: "viewtype", value: option.view },\n {name: "viewtype", value: option.view},\n
{ name: "timezone", value: zone }\n {name: "timezone", value: zone}\n
];\n ];\n
if (option.extParam) {\n if (option.extParam) {\n
for (var pi = 0; pi < option.extParam.length; pi++) {\n for (var pi = 0; pi < option.extParam.length; pi++) {\n
param[param.length] = option.extParam[pi];\n param[param.length] = option.extParam[pi];\n
}\n }\n
}\n }\n
\n
$.ajax({\n $.ajax({\n
type: option.method, //\n type: option.method,//\n
url: option.url,\n url: option.url,\n
data: param, \n data: param, \n
//dataType: "text", // fixed jquery 1.4 not support Ms Date Json Format /Date(@Tickets)/\n //dataType: "text", // fixed jquery 1.4 not support Ms Date Json Format /Date(@Tickets)/\n
dataType: "json",\n dataType: "json",\n
dataFilter: function(data, type) { \n dataFilter: function(data, type) { \n
//return data.replace(/"\\\\\\/(Date\\([0-9-]+\\))\\\\\\/"/gi, "new $1");\n return data;\n
\n },\n
return data;\n success: function(data) {\n
},\n if (data != null && data.error != null) {\n
success: function(data) {//function(datastr) { \n if (option.onRequestDataError) {\n
//datastr =datastr.replace(/"\\\\\\/(Date\\([0-9-]+\\))\\\\\\/"/gi, \'new $1\'); \n option.onRequestDataError(1, data);\n
//var data = (new Function("return " + datastr))();\n
if (data != null && data.error != null) {\n
if (option.onRequestDataError) {\n
option.onRequestDataError(1, data);\n
}\n
}\n
else {\n
data["start"] = parseDate(data["start"]);\n
data["end"] = parseDate(data["end"]);\n
$.each(data.events, function(index, value) { \n
value[2] = parseDate(value[2]);\n
value[3] = parseDate(value[3]); \n
});\n
responseData(data, data.start, data.end);\n
pushER(data.start, data.end);\n
}\n
if (option.onAfterRequestData && $.isFunction(option.onAfterRequestData)) {\n
option.onAfterRequestData(1);\n
}\n }\n
option.isloading = false;\n }\n
else {\n
data["start"] = parseDate(data["start"]);\n
data["end"] = parseDate(data["end"]);\n
$.each(data.events, function(index, value) { \n
value[2] = parseDate(value[2]);\n
value[3] = parseDate(value[3]); \n
});\n
responseData(data, data.start, data.end);\n
pushER(data.start, data.end);\n
}\n
if (option.onAfterRequestData && $.isFunction(option.onAfterRequestData)) {\n
option.onAfterRequestData(1);\n
}\n
option.isloading = false;\n
},\n },\n
error: function(data) { \n error: function(data) { \n
try { \n try { \n
...@@ -1731,11 +1726,12 @@ ...@@ -1731,11 +1726,12 @@
var od = data[3];\n var od = data[3];\n
var zone = new Date().getTimezoneOffset() / 60 * -1;\n var zone = new Date().getTimezoneOffset() / 60 * -1;\n
var param = [{ "name": "calendarId", value: id },\n var param = [{ "name": "calendarId", value: id },\n
{ "name": "CalendarStartTime", value: dateFormat.call(start, i18n.xgcalendar.dateformat.fulldayvalue + " HH:mm") },\n { "name": "CalendarStartTime", value: dateFormat.call(start, i18n.xgcalendar.dateformat.fulldayvalue + " HH:mm") },\n
{ "name": "CalendarEndTime", value: dateFormat.call(end, i18n.xgcalendar.dateformat.fulldayvalue + " HH:mm") },\n { "name": "CalendarEndTime", value: dateFormat.call(end, i18n.xgcalendar.dateformat.fulldayvalue + " HH:mm") },\n
{ "name": "timezone", value: zone },\n { "name": "timezone", value: zone },\n
{ "name": "title", value: title },\n { "name": "title", value: title },\n
];\n { "name": "event_id", value: data[9]},\n
];\n
var d;\n var d;\n
if (option.quickUpdateHandler && $.isFunction(option.quickUpdateHandler)) {\n if (option.quickUpdateHandler && $.isFunction(option.quickUpdateHandler)) {\n
option.quickUpdateHandler.call(this, param);\n option.quickUpdateHandler.call(this, param);\n
...@@ -1815,10 +1811,10 @@ ...@@ -1815,10 +1811,10 @@
}\n }\n
var zone = new Date().getTimezoneOffset() / 60 * -1;\n var zone = new Date().getTimezoneOffset() / 60 * -1;\n
var param = [{ "name": "CalendarTitle", value: what },\n var param = [{ "name": "CalendarTitle", value: what },\n
{ "name": "CalendarStartTime", value: datestart },\n { "name": "CalendarStartTime", value: datestart },\n
{ "name": "CalendarEndTime", value: dateend },\n { "name": "CalendarEndTime", value: dateend },\n
{ "name": "IsAllDayEvent", value: allday },\n { "name": "IsAllDayEvent", value: allday },\n
{ "name": "timezone", value: zone}];\n { "name": "timezone", value: zone}];\n
\n \n
if (option.extParam) {\n if (option.extParam) {\n
for (var pi = 0; pi < option.extParam.length; pi++) {\n for (var pi = 0; pi < option.extParam.length; pi++) {\n
...@@ -1835,24 +1831,22 @@ ...@@ -1835,24 +1831,22 @@
$("#bbit-cal-buddle").css("visibility", "hidden");\n $("#bbit-cal-buddle").css("visibility", "hidden");\n
var newdata = [];\n var newdata = [];\n
var tId = -1;\n var tId = -1;\n
option.onBeforeRequestData && option.onBeforeRequestData(2);\n option.onBeforeRequestData && option.onBeforeRequestData(2); \n
$.post(option.quickAddUrl, param, function(data) {\n $.post(option.quickAddUrl, param, function(data) {\n
if (data) {\n if (data) {\n
if (data.IsSuccess == true) {\n if (data.IsSuccess == true) {\n
option.isloading = false;\n option.isloading = false;\n
option.eventItems[tId][0] = data.Data;\n option.eventItems[tId][0] = data.Data;\n
option.eventItems[tId][8] = 1;\n option.eventItems[tId][8] = 1;\n
render();\n render();\n
option.onAfterRequestData && option.onAfterRequestData(2);\n option.onAfterRequestData && option.onAfterRequestData(2);\n
}\n
else {\n
option.onRequestDataError && option.onRequestDataError(2, data);\n
option.isloading = false;\n
option.onAfterRequestData && option.onAfterRequestData(2);\n
}\n
\n
}\n }\n
\n else {\n
option.onRequestDataError && option.onRequestDataError(2, data);\n
option.isloading = false;\n
option.onAfterRequestData && option.onAfterRequestData(2);\n
}\n
}\n
}, "json");\n }, "json");\n
\n \n
newdata.push(-1, what);\n newdata.push(-1, what);\n
......
9 10
\ 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