RestActions.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. MWF.xApplication.MinderEditor = MWF.xApplication.MinderEditor || {};
  2. MWF.xApplication.MinderEditor.Actions = MWF.xApplication.MinderEditor.Actions || {};
  3. MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
  4. MWF.require("MWF.widget.UUID", null, false);
  5. MWF.xApplication.MinderEditor.Actions.RestActions = new Class({
  6. initialize: function(){
  7. this.action = new MWF.xDesktop.Actions.RestActions("/Actions/action.json", "x_attendance_assemble_control", "x_component_Minder");
  8. },
  9. getId: function(count, success, failure, async){
  10. this.action.invoke({"name": "getId","async": async, "parameter": {"count": count}, "success": success, "failure": failure});
  11. },
  12. getUUID: function(success){
  13. var id = "";
  14. this.action.invoke({"name": "getId","async": false, "parameter": {"count": "1"}, "success": function(ids){
  15. id = ids.data[0];
  16. if (success) success(id);
  17. }, "failure": null});
  18. return id;
  19. },
  20. getHoliday: function(id, success, failure){
  21. this.action.invoke({"name": "getHoliday", "parameter": {"id": id },"success": success,"failure": failure});
  22. },
  23. listHolidayAll: function(success, failure, async){
  24. this.action.invoke({"name": "listHolidayAll","async": async, "success": success, "failure": failure});
  25. },
  26. listHolidayFilter : function( filterData, success,failure, async){
  27. this.action.invoke({"name": "listHolidayFilter", "data": filterData, "async": async, "success": success, "failure": failure});
  28. },
  29. saveHoliday: function(data, success, failure, async){
  30. this.action.invoke({"name": "saveHoliday","data": data, "async": async,"parameter": {"id": data.id},"success": success,"failure": failure});
  31. },
  32. deleteHoliday: function(id, success, failure, async){
  33. this.action.invoke({"name": "deleteHoliday", "async": async, "parameter": {"id": id}, "success": success, "failure": failure});
  34. }
  35. });