entry.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * Copyright (c) UNA, Inc - https://una.io
  3. * MIT License - https://opensource.org/licenses/MIT
  4. *
  5. * @defgroup Events Events
  6. * @ingroup UnaModules
  7. *
  8. * @{
  9. */
  10. function BxEventsEntry(oOptions) {
  11. BxBaseModGroupsEntry.call(this, oOptions);
  12. this._sObjName = oOptions.sObjName == undefined ? 'oBxEventsEntry' : oOptions.sObjName;
  13. var $this = this;
  14. $(document).ready(function() {
  15. $this.init();
  16. });
  17. }
  18. BxEventsEntry.prototype = Object.create(BxBaseModGroupsEntry.prototype);
  19. BxEventsEntry.prototype.constructor = BxEventsEntry;
  20. BxEventsEntry.prototype.init = function() {
  21. if ('UTC' == $("[name = 'timezone']").val())
  22. $("[name = 'timezone']").val(moment.tz.guess());
  23. };
  24. BxEventsEntry.prototype.checkIn = function(oElement, iId) {
  25. var $this = this;
  26. var oParams = this._getDefaultData();
  27. oParams['id'] = iId;
  28. if(oElement)
  29. this.loadingInButton(oElement, true);
  30. jQuery.get (
  31. this._sActionsUrl + 'check_in',
  32. oParams,
  33. function(oData) {
  34. if(oElement)
  35. $this.loadingInButton(oElement, false);
  36. processJsonData(oData);
  37. },
  38. 'json'
  39. );
  40. };
  41. /** @} */