Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

workweek.component.js 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let HRMS;
  6. (function (HRMS) {
  7. let Controls;
  8. (function (Controls) {
  9. class workweek extends Unibase.Platform.Core.BaseComponent {
  10. init(formpropertyid, prop, callback) {
  11. }
  12. loadControl(containerid, prop) {
  13. var html = '<div class="week_days"><h5 class="font-weight-600 mb-0">Select your work week<span class="text-danger">*</span></h5><p>The days worked in a calender week</p><div><div class="btn-group btn-group-toggle work_weeks" data-toggle="buttons"><input type = "hidden" id = "hdn_Earningscontrol" class="value-control" value = "Bizgaze.Apps.HRMS.Controls.workweek.Instance().workweekobj();" ><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option1" autocomplete="off" > SUN</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option2" autocomplete="off" > MON</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option3" autocomplete="off"> TUE</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option4" autocomplete="off" > WED</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option5" autocomplete="off"> THU</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option6" autocomplete="off"> FRI</label><label class="btn btn-outline-primary"><input type="checkbox" name="options" id="option7" autocomplete="off" > SAT</label></div></div></div>';
  14. $("#" + containerid).html(html);
  15. }
  16. loadControlSettings(controlsettingjson, formpropertyid) {
  17. }
  18. loadPropertySettings(propertysettings, formpropertyid) {
  19. return null;
  20. }
  21. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  22. return null;
  23. }
  24. workweekobj() {
  25. debugger;
  26. var workweek = new Array();
  27. $('.work_weeks').each(function (index) {
  28. debugger;
  29. var element = $(this);
  30. var sunday = Number($("#option1").val());
  31. var monday = Number($("#option2").val());
  32. var tuesday = Number($("#option3").val());
  33. var wednesday = Number($("#option4").val());
  34. var thursday = Number($("#option5").val());
  35. var friday = Number($("#option6").val());
  36. var saturday = Number($("#option7").val());
  37. if ($("#option1").prop("checked") == true) {
  38. var sunday = 1;
  39. }
  40. else {
  41. var sunday = 0;
  42. }
  43. if ($("#option2").prop("checked") == true) {
  44. var monday = 1;
  45. }
  46. else {
  47. var monday = 0;
  48. }
  49. if ($("#option3").prop("checked") == true) {
  50. var tuesday = 1;
  51. }
  52. else {
  53. var tuesday = 0;
  54. }
  55. if ($("#option4").prop("checked") == true) {
  56. var wednesday = 1;
  57. }
  58. else {
  59. var wednesday = 0;
  60. }
  61. if ($("#option5").prop("checked") == true) {
  62. var thursday = 1;
  63. }
  64. else {
  65. var thursday = 0;
  66. }
  67. if ($("#option6").prop("checked") == true) {
  68. var friday = 1;
  69. }
  70. else {
  71. var friday = 0;
  72. }
  73. if ($("#option7").prop("checked") == true) {
  74. var saturday = 1;
  75. }
  76. else {
  77. var saturday = 0;
  78. }
  79. workweek.push({
  80. sunday: sunday,
  81. monday: monday,
  82. tuesday: tuesday,
  83. wednesday: wednesday,
  84. thursday: thursday,
  85. friday: friday,
  86. saturday: saturday
  87. });
  88. });
  89. return workweek;
  90. }
  91. static Instance() {
  92. if (this.instance === undefined) {
  93. this.instance = new workweek();
  94. }
  95. return this.instance;
  96. }
  97. }
  98. Controls.workweek = workweek;
  99. })(Controls = HRMS.Controls || (HRMS.Controls = {}));
  100. })(HRMS = Apps.HRMS || (Apps.HRMS = {}));
  101. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  102. })(Bizgaze || (Bizgaze = {}));