diff --git a/crm/src/main/webapp/js/activityUI.js b/crm/src/main/webapp/js/activityUI.js new file mode 100644 index 0000000..e5bbfbc --- /dev/null +++ b/crm/src/main/webapp/js/activityUI.js @@ -0,0 +1,66 @@ +$(document).ready(function() { + $('#active_back_btn').click(function(e) { + $('#main_container').toggle(); + $('#activity_container').toggle(); + + }); + +}); + +function renderActivityTableOnPage(id) { + console.log("Start to render account detaile page now"); + console.log("activity id is:" + id); + + //get accountTable from local storage + var table = ACTIVITY_UTIL.getRemoteActivitesFromLocalStorage(); + console.log(table); + var tbobj = $("#detail_tb"); + tbobj.empty(); + var isEventLocated = false; + if (table != null && table.cols != undefined && table.tData != undefined) { + + if (table.cols.length > 0 && (table.tData[id] != undefined) && (table.tData[id] != null)) { + isEventLocated = true; + var cols = table.cols; + var colWidth = table.cols.length; + var trs = ""; + var rowData = table.tData[id][0]; + $('#detail_title').append("" + rowData[1] + ""); + for ( var i = 1; i < colWidth; i++) { + if (cols[i].isVisible === false) + continue; + if (i == 2 || i == 3) { + var date = new Date(parseInt(rowData[i])); + console.log(date); + var str_date = $.fullCalendar.formatDate(date, "yyyy-MM-dd HH:mm:ss"); + trs = trs + "" + "" + cols[i].display + "" + "" + str_date + "" + ""; + } else { + trs = trs + "" + "" + cols[i].display + "" + "" + rowData[i] + "" + ""; + } + } + + tbobj.append("" + trs + ""); + } + } + + //if we can't find the event in the remote data + if (!isEventLocated) { + var events = ACTIVITY_UTIL.getCalendarEventFromLocalStorage(); + if (events[id] != undefined) { + var evt = events[id]; + var date = new Date(evt.startt*1000); + var starttime = $.fullCalendar.formatDate(date, "yyyy-MM-dd HH:mm"); + date = new Date(evt.endt*1000); + var endtime = $.fullCalendar.formatDate(date, "yyyy-MM-dd HH:mm"); + $('#detail_title').append("拜访"); + var trs = "" + "" + "开始时间:" + "" + starttime + "" + "" + + "结束时间:" + "" + endtime + "" + "" + + "拜访类型:" + "" + ACTIVITY_UTIL.getEventTitle(evt.activity_type) + "" + ""; + + tbobj.append(trs); + + } + } + + console.log("END of render activity detaile page now"); +} \ No newline at end of file diff --git a/crm/src/main/webapp/offline/activity.html b/crm/src/main/webapp/offline/activity.html deleted file mode 100644 index 873b5ff..0000000 --- a/crm/src/main/webapp/offline/activity.html +++ /dev/null @@ -1,117 +0,0 @@ - - - -拜访详情 - - - - -
-
-
- 返回 -
-
- -
-
-
-
-
-
- - -
-
-
-
- - \ No newline at end of file diff --git a/crm/src/main/webapp/offline/cache.appcache b/crm/src/main/webapp/offline/cache.appcache index ee8df96..180bb3a 100644 --- a/crm/src/main/webapp/offline/cache.appcache +++ b/crm/src/main/webapp/offline/cache.appcache @@ -8,7 +8,6 @@ NETWORK: CACHE: ../offline/main.html ../offline/account.html -../offline/activity.html ../fullcalendar/fullcalendar.css ../fullcalendar/fullcalendar.print.css ../jquery/css/smoothness/jquery-ui-1.10.2.custom.css @@ -47,6 +46,7 @@ CACHE: ../urlparser/purl.js ../bootstrap/css/bootstrap-responsive.css ../js/activityutil.js +../js/activityUI.js ../offline/offline.css FALLBACK: \ No newline at end of file diff --git a/crm/src/main/webapp/offline/main.html b/crm/src/main/webapp/offline/main.html index 4be7525..c4f1864 100644 --- a/crm/src/main/webapp/offline/main.html +++ b/crm/src/main/webapp/offline/main.html @@ -45,6 +45,7 @@ +