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.

shiftcalender.js 50KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let Hrms;
  15. (function (Hrms) {
  16. let Components;
  17. (function (Components) {
  18. class ShiftCalender extends Unibase.Platform.Core.BaseComponent {
  19. constructor() {
  20. super(...arguments);
  21. this.holidaycalendar = new Array();
  22. this.firstweekcheckedarray = [];
  23. this.secondweekcheckedarray = [];
  24. this.thirdweekcheckedarray = [];
  25. this.fourthweekcheckedarray = [];
  26. this.fifththweekcheckedarray = [];
  27. }
  28. init(formpropertyid, prop, callback) {
  29. var instance = this;
  30. this.holidaycalendar = [];
  31. this.firstweekcheckedarray = [];
  32. this.secondweekcheckedarray = [];
  33. this.thirdweekcheckedarray = [];
  34. this.fourthweekcheckedarray = [];
  35. this.fifththweekcheckedarray = [];
  36. $('#SelectAllSunday').change(function () {
  37. let checkelemnt = $(this).is(':checked');
  38. if (checkelemnt == true) {
  39. $(".Sunday").prop("checked", true);
  40. }
  41. else {
  42. $(".Sunday").prop("checked", false);
  43. }
  44. });
  45. $(".Sunday").click(function () {
  46. let checkelemnt = $(this).is(':checked');
  47. if (checkelemnt == true) {
  48. $(this).prop("checked", true);
  49. }
  50. else {
  51. $(this).prop("checked", false);
  52. }
  53. });
  54. $('#SelectAllMonday').change(function () {
  55. let checkelemnt = $(this).is(':checked');
  56. if (checkelemnt == true) {
  57. $(".Monday").prop("checked", true);
  58. }
  59. else {
  60. $(".Monday").prop("checked", false);
  61. }
  62. });
  63. $(".Monday").click(function () {
  64. let checkelemnt = $(this).is(':checked');
  65. if (checkelemnt == true) {
  66. $(this).prop("checked", true);
  67. }
  68. else {
  69. $(this).prop("checked", false);
  70. }
  71. });
  72. $('#SelectAllTuesday').change(function () {
  73. let checkelemnt = $(this).is(':checked');
  74. if (checkelemnt == true) {
  75. $(".Tuesday").prop("checked", true);
  76. }
  77. else {
  78. $(".Tuesday").prop("checked", false);
  79. }
  80. });
  81. $(".Tuesday").click(function () {
  82. let checkelemnt = $(this).is(':checked');
  83. if (checkelemnt == true) {
  84. $(this).prop("checked", true);
  85. }
  86. else {
  87. $(this).prop("checked", false);
  88. }
  89. });
  90. $('#SelectAllWednesday').change(function () {
  91. let checkelemnt = $(this).is(':checked');
  92. if (checkelemnt == true) {
  93. $(".Wednesday").prop("checked", true);
  94. }
  95. else {
  96. $(".Wednesday").prop("checked", false);
  97. }
  98. });
  99. $(".Wednesday").click(function () {
  100. let checkelemnt = $(this).is(':checked');
  101. if (checkelemnt == true) {
  102. $(this).prop("checked", true);
  103. }
  104. else {
  105. $(this).prop("checked", false);
  106. }
  107. });
  108. $('#SelectAllThursday').change(function () {
  109. let checkelemnt = $(this).is(':checked');
  110. if (checkelemnt == true) {
  111. $(".Thursday").prop("checked", true);
  112. }
  113. else {
  114. $(".Thursday").prop("checked", false);
  115. }
  116. });
  117. $(".Thursday").click(function () {
  118. let checkelemnt = $(this).is(':checked');
  119. if (checkelemnt == true) {
  120. $(this).prop("checked", true);
  121. }
  122. else {
  123. $(this).prop("checked", false);
  124. }
  125. });
  126. $('#SelectAllFriday').change(function () {
  127. let checkelemnt = $(this).is(':checked');
  128. if (checkelemnt == true) {
  129. $(".Friday").prop("checked", true);
  130. }
  131. else {
  132. $(".Friday").prop("checked", false);
  133. }
  134. });
  135. $(".Friday").click(function () {
  136. let checkelemnt = $(this).is(':checked');
  137. if (checkelemnt == true) {
  138. $(this).prop("checked", true);
  139. }
  140. else {
  141. $(this).prop("checked", false);
  142. }
  143. });
  144. $('#SelectAllSaturday').change(function () {
  145. let checkelemnt = $(this).is(':checked');
  146. if (checkelemnt == true) {
  147. $(".Saturday").prop("checked", true);
  148. }
  149. else {
  150. $(".Saturday").prop("checked", false);
  151. }
  152. });
  153. $(".Saturday").click(function () {
  154. let checkelemnt = $(this).is(':checked');
  155. if (checkelemnt == true) {
  156. $(this).prop("checked", true);
  157. }
  158. else {
  159. $(this).prop("checked", false);
  160. }
  161. });
  162. $(".fifthweek").click(function () {
  163. let checkelemnt = $(this).is(':checked');
  164. let day = $(this).val();
  165. var splt = day.toString().split(':');
  166. let dayname = splt[0];
  167. let dayval = Boolean(splt[1]);
  168. let weekday = { [dayname]: dayval };
  169. if (checkelemnt == true) {
  170. $(this).prop("checked", true);
  171. instance.fifththweekcheckedarray.push({ [dayname]: dayval });
  172. console.log(instance.fifththweekcheckedarray);
  173. }
  174. else {
  175. $(this).prop("checked", false);
  176. let newArray = [];
  177. for (let i = 0; i < instance.fifththweekcheckedarray.length; i++) {
  178. if (JSON.stringify(instance.fifththweekcheckedarray[i]) !== JSON.stringify(weekday)) {
  179. newArray.push(instance.fifththweekcheckedarray[i]);
  180. }
  181. }
  182. instance.fifththweekcheckedarray = [];
  183. instance.fifththweekcheckedarray = newArray;
  184. console.log(instance.fifththweekcheckedarray);
  185. }
  186. });
  187. $(".firstweek").click(function () {
  188. let checkelemnt = $(this).is(':checked');
  189. let day = $(this).val();
  190. var splt = day.toString().split(':');
  191. let dayname = splt[0];
  192. let dayval = Boolean(splt[1]);
  193. let weekday = { [dayname]: dayval };
  194. if (checkelemnt == true) {
  195. $(this).prop("checked", true);
  196. instance.firstweekcheckedarray.push({ [dayname]: dayval });
  197. console.log(instance.firstweekcheckedarray);
  198. }
  199. else {
  200. $(this).prop("checked", false);
  201. let newArray = [];
  202. for (let i = 0; i < instance.firstweekcheckedarray.length; i++) {
  203. if (JSON.stringify(instance.firstweekcheckedarray[i]) != JSON.stringify(weekday)) {
  204. newArray.push(instance.firstweekcheckedarray[i]);
  205. }
  206. }
  207. instance.firstweekcheckedarray = [];
  208. instance.firstweekcheckedarray = newArray;
  209. console.log(instance.firstweekcheckedarray);
  210. }
  211. });
  212. $(".secondweek").click(function () {
  213. let checkelemnt = $(this).is(':checked');
  214. let day = $(this).val();
  215. var splt = day.toString().split(':');
  216. let dayname = splt[0];
  217. let dayval = Boolean(splt[1]);
  218. let weekday = { [dayname]: dayval };
  219. if (checkelemnt == true) {
  220. $(this).prop("checked", true);
  221. instance.secondweekcheckedarray.push({ [dayname]: dayval });
  222. console.log(instance.secondweekcheckedarray);
  223. }
  224. else {
  225. $(this).prop("checked", false);
  226. let newArray = [];
  227. for (let i = 0; i < instance.secondweekcheckedarray.length; i++) {
  228. if (JSON.stringify(instance.secondweekcheckedarray[i]) !== JSON.stringify(weekday)) {
  229. newArray.push(instance.secondweekcheckedarray[i]);
  230. }
  231. }
  232. instance.secondweekcheckedarray = [];
  233. instance.secondweekcheckedarray = newArray;
  234. console.log(instance.secondweekcheckedarray);
  235. }
  236. });
  237. $(".thirdweek").click(function () {
  238. let checkelemnt = $(this).is(':checked');
  239. let day = $(this).val();
  240. var splt = day.toString().split(':');
  241. let dayname = splt[0];
  242. let dayval = Boolean(splt[1]);
  243. let weekday = { [dayname]: dayval };
  244. if (checkelemnt == true) {
  245. $(this).prop("checked", true);
  246. instance.thirdweekcheckedarray.push({ [dayname]: dayval });
  247. console.log(instance.thirdweekcheckedarray);
  248. }
  249. else {
  250. $(this).prop("checked", false);
  251. let newArray = [];
  252. for (let i = 0; i < instance.thirdweekcheckedarray.length; i++) {
  253. if (JSON.stringify(instance.thirdweekcheckedarray[i]) !== JSON.stringify(weekday)) {
  254. newArray.push(instance.thirdweekcheckedarray[i]);
  255. }
  256. }
  257. instance.thirdweekcheckedarray = [];
  258. instance.thirdweekcheckedarray = newArray;
  259. console.log(instance.thirdweekcheckedarray);
  260. }
  261. });
  262. $(".fourthweek").click(function () {
  263. let checkelemnt = $(this).is(':checked');
  264. let day = $(this).val();
  265. var splt = day.toString().split(':');
  266. let dayname = splt[0];
  267. let dayval = Boolean(splt[1]);
  268. let weekday = { [dayname]: dayval };
  269. if (checkelemnt == true) {
  270. $(this).prop("checked", true);
  271. instance.fourthweekcheckedarray.push({ [dayname]: dayval });
  272. console.log(instance.fourthweekcheckedarray);
  273. }
  274. else {
  275. $(this).prop("checked", false);
  276. let newArray = [];
  277. for (let i = 0; i < instance.fourthweekcheckedarray.length; i++) {
  278. if (JSON.stringify(instance.fourthweekcheckedarray[i]) !== JSON.stringify(weekday)) {
  279. newArray.push(instance.fourthweekcheckedarray[i]);
  280. }
  281. }
  282. instance.fourthweekcheckedarray = [];
  283. instance.fourthweekcheckedarray = newArray;
  284. console.log(instance.fourthweekcheckedarray);
  285. }
  286. });
  287. if (callback != null) {
  288. callback();
  289. }
  290. }
  291. loadControl(containerid, prop) {
  292. $("." + containerid).empty();
  293. let html = `<div class="card">
  294. <div class="card-header card-header-action">
  295. <div class="col-12">
  296. <span class="h6 ml-10">
  297. Weekend Definition
  298. </span>
  299. </div>
  300. </div>
  301. <div class="card-body" style="overflow-x:auto;">
  302. <table class="bg-white" id="bizgazecrm_Routes_tbl_DayWise" style="border: 1px solid #c6c6c6;text-align: left; border-collapse: collapse;width: 100%; ">
  303. <thead>
  304. <tr style="border: 1px solid #c6c6c6;" class="list-item-main-title">
  305. <td style="border: 1px solid #c6c6c6;padding: 15px;" rowspan="2"> Days</td>
  306. <td style="text-align:center;border: 1px solid #c6c6c6;padding:10px" colspan="6">Weeks</td>
  307. </tr>
  308. <tr style="border: 1px solid #c6c6c6;text-align;font-weight:500" >
  309. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">All</td>
  310. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">1st</td>
  311. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">2nd</td>
  312. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">3rd</td>
  313. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">4th</td>
  314. <td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">5th</td>
  315. </tr>
  316. </thead>
  317. <tr>
  318. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Sunday</td>
  319. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSunday" name="Sunday" value="" class="SelectAllSunday"></td>
  320. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Sunday firstweek" id="1stSunday" name="1stSunday" value=Sunday:true></td>
  321. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday secondweek" id="2ndSunday" name="2ndSunday" value=Sunday:true></td>
  322. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday thirdweek" id="3rdSunday" name="3rdSunday" value=Sunday:true></td>
  323. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fourthweek" id="4thSunday" name="4thSunday" value=Sunday:true></td>
  324. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fifthweek" id="5thSunday" name="5thSunday" value=Sunday:true></td>
  325. </tr>
  326. <tr>
  327. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Monday</td>
  328. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllMonday" name="Monday" value="" class="SelectAllMonday"></td>
  329. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Monday firstweek" id="1stMonday" name="1stMonday" value=Monday:true></td>
  330. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday secondweek" id="2ndMonday" name="2ndMonday" value=Monday:true></td>
  331. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday thirdweek" id="3rdMonday" name="3rdMonday" value=Monday:true></td>
  332. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fourthweek" id="4thMonday" name="4thMonday" value=Monday:true></td>
  333. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fifthweek" id="5thMonday" name="5thMonday" value=Monday:true></td>
  334. </tr>
  335. <tr>
  336. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Tuesday</td>
  337. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllTuesday" name="Tuesday" value="" class="SelectAllTuesday"></td>
  338. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Tuesday firstweek" id="1stTuesday" name="1stTuesday" value=Tuesday:true></td>
  339. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday secondweek" id="2ndTuesday" name="2ndTuesday" value=Tuesday:true></td>
  340. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday thirdweek" id="3rdTuesday" name="3rdTuesday" value=Tuesday:true></td>
  341. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fourthweek" id="4thTuesday" name="4thTuesday" value=Tuesday:true></td>
  342. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fifthweek" id="5thTuesday" name="5thTuesday" value=Tuesday:true></td>
  343. </tr>
  344. <tr>
  345. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Wednesday</td>
  346. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllWednesday" name="Wednesday" value="" class="SelectAllWednesday"></td>
  347. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Wednesday firstweek" id="1stWednesday" name="1stWednesday" value=Wednesday:true></td>
  348. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday secondweek" id="2ndWednesday" name="2ndWednesday" value=Wednesday:true></td>
  349. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday thirdweek" id="3rdWednesday" name="3rdWednesday" value=Wednesday:true></td>
  350. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fourthweek" id="4thWednesday" name="4thWednesday" value=Wednesday:true></td>
  351. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fifthweek" id="5thWednesday" name="5thWednesday" value=Wednesday:true></td>
  352. </tr>
  353. <tr>
  354. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Thursday</td>
  355. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllThursday" name="Thursday" value="" class="SelectAllThursday"></td>
  356. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Thursday firstweek" id="1stThursday" name="1stThursday" value=Thursday:1></td>
  357. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday secondweek" id="2ndThursday" name="2ndThursday" value=Thursday:true></td>
  358. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday thirdweek" id="3rdThursday" name="3rdThursday" value=Thursday:true></td>
  359. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fourthweek" id="4thThursday" name="4thThursday" value=Thursday:true></td>
  360. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fifthweek" id="5thThursday" name="5thThursday" value=Thursday:true></td>
  361. </tr>
  362. <tr>
  363. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Friday</td>
  364. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllFriday" name="Friday" value="" class="SelectAllFriday"></td>
  365. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Friday firstweek" id="1stFriday" name="1stFriday" value=Friday:true></td>
  366. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday secondweek" id="2ndFriday" name="2ndFriday" value=Friday:true></td>
  367. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday thirdweek" id="3rdFriday" name="3rdFriday" value=Friday:true></td>
  368. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fourthweek" id="4thFriday" name="4thFriday" value=Friday:true></td>
  369. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fifthweek" id="5thFriday" name="5thFriday" value=Friday:true></td>
  370. </tr>
  371. <tr>
  372. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Saturday</td>
  373. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSaturday" name="Saturday" value="AllSundays" class="SelectAllSaturday"></td>
  374. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Saturday firstweek" id="1stSaturday" name="1stSaturday" value=Saturday:true></td>
  375. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday secondweek" id="2ndSaturday" name="2ndSaturday" value=Saturday:true></td>
  376. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday thirdweek" id="3rdSaturday" name="3rdSaturday" value=Saturday:true></td>
  377. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fourthweek" id="4thSaturday" name="4thSaturday" value=Saturday:true></td>
  378. <td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fifthweek" id="5thSaturday" name="5thSaturday" value=Saturday:true></td>
  379. </tr>
  380. <input type="hidden" id="hdn_HolidayCalendarControl" class="value-control" value=" Bizgaze.Apps.Hrms.Components.ShiftCalender.Instance().HolidayCalendarobjitems();">
  381. </table>
  382. </div>
  383. </div>`;
  384. $("#" + containerid).html(html);
  385. }
  386. loadControlSettings(controlsettingjson, formpropertyid) {
  387. return null;
  388. }
  389. loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
  390. return null;
  391. }
  392. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  393. var id = Number(propval);
  394. var instance = this;
  395. var jsfiles = ['apps/hrms/managers/holidaymanager.js'];
  396. instance.fileCacheHelper.loadJsFiles(jsfiles, function (response) {
  397. Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getHolidayCalendar(id).then(function (response) {
  398. if (response.result.length > 0) {
  399. var data = response.result;
  400. var everysunday = data[0].everysunday;
  401. var everymonday = data[0].everymonday;
  402. var everytuesday = data[0].everytuesday;
  403. var everywednesday = data[0].everywednesday;
  404. var everythursday = data[0].everythursday;
  405. var everyfriday = data[0].everyfriday;
  406. var everysaturday = data[0].everysaturday;
  407. if (everysunday == true) {
  408. $(".Sunday").prop("checked", true);
  409. $("#SelectAllSunday").prop("checked", true);
  410. }
  411. else {
  412. $(".Sunday").prop("checked", false);
  413. $("#SelectAllSunday").prop("checked", false);
  414. }
  415. if (everymonday == true) {
  416. $(".Monday").prop("checked", true);
  417. $("#SelectAllMonday").prop("checked", true);
  418. }
  419. else {
  420. $(".Monday").prop("checked", false);
  421. $("#SelectAllMonday").prop("checked", false);
  422. }
  423. if (everytuesday == true) {
  424. $(".Tuesday").prop("checked", true);
  425. $("#SelectAllTuesday").prop("checked", true);
  426. }
  427. else {
  428. $(".Tuesday").prop("checked", false);
  429. $("#SelectAllTuesday").prop("checked", false);
  430. }
  431. if (everywednesday == true) {
  432. $(".Wednesday").prop("checked", true);
  433. $("#SelectAllWednesday").prop("checked", true);
  434. }
  435. else {
  436. $(".Wednesday").prop("checked", false);
  437. $("#SelectAllWednesday").prop("checked", false);
  438. }
  439. if (everythursday == true) {
  440. $(".Thursday").prop("checked", true);
  441. $("#SelectAllThursday").prop("checked", true);
  442. }
  443. else {
  444. $(".Thursday").prop("checked", false);
  445. $("#SelectAllThursday").prop("checked", false);
  446. }
  447. if (everyfriday == true) {
  448. $(".Friday").prop("checked", true);
  449. $("#SelectAllFriday").prop("checked", true);
  450. }
  451. else {
  452. $(".Friday").prop("checked", false);
  453. $("#SelectAllFriday").prop("checked", false);
  454. }
  455. if (everysaturday == true) {
  456. $(".Saturday").prop("checked", true);
  457. $("#SelectAllSaturday").prop("checked", true);
  458. }
  459. else {
  460. $(".Saturday").prop("checked", false);
  461. $("#SelectAllSaturday").prop("checked", false);
  462. }
  463. }
  464. instance.getCalenderWeekItems(id);
  465. });
  466. });
  467. }
  468. getCalenderWeekItems(id) {
  469. return __awaiter(this, void 0, void 0, function* () {
  470. let instance = this;
  471. yield Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getCalendarWeekItems(id).then(function (response) {
  472. if (response.result.length > 0) {
  473. for (var i = 0; i < response.result.length; i++) {
  474. var data = response.result[i];
  475. let weekid = data.weekid;
  476. var sunday = data.sunday;
  477. var monday = data.monday;
  478. var tuesday = data.tuesday;
  479. var wednesday = data.wednesday;
  480. var thursday = data.thursday;
  481. var friday = data.friday;
  482. var saturday = data.saturday;
  483. if (weekid == 1) {
  484. if (sunday == true) {
  485. $("#1stSunday").prop("checked", true);
  486. instance.firstweekcheckedarray.push({ Sunday: true });
  487. }
  488. if (monday == true) {
  489. $("#1stMonday").prop("checked", true);
  490. instance.firstweekcheckedarray.push({ Monday: true });
  491. }
  492. if (tuesday == true) {
  493. $("#1stTuesday").prop("checked", true);
  494. instance.firstweekcheckedarray.push({ Tuesday: true });
  495. }
  496. if (wednesday == true) {
  497. $("#1stWednesday").prop("checked", true);
  498. instance.firstweekcheckedarray.push({ Wednesday: true });
  499. }
  500. if (thursday == true) {
  501. $("#1stThursday").prop("checked", true);
  502. instance.firstweekcheckedarray.push({ Thursday: true });
  503. }
  504. if (friday == true) {
  505. $("#1stFriday").prop("checked", true);
  506. instance.firstweekcheckedarray.push({ Friday: true });
  507. }
  508. if (saturday == true) {
  509. $("#1stSaturday").prop("checked", true);
  510. instance.firstweekcheckedarray.push({ Saturday: true });
  511. }
  512. }
  513. else if (weekid == 2) {
  514. if (sunday == true) {
  515. $("#2ndSunday").prop("checked", true);
  516. instance.secondweekcheckedarray.push({ Sunday: true });
  517. }
  518. if (monday == true) {
  519. $("#2ndMonday").prop("checked", true);
  520. instance.secondweekcheckedarray.push({ Monday: true });
  521. }
  522. if (tuesday == true) {
  523. $("#2ndTuesday").prop("checked", true);
  524. instance.secondweekcheckedarray.push({ Tuesday: true });
  525. }
  526. if (wednesday == true) {
  527. $("#2ndWednesday").prop("checked", true);
  528. instance.secondweekcheckedarray.push({ Wednesday: true });
  529. }
  530. if (thursday == true) {
  531. $("#2ndThursday").prop("checked", true);
  532. instance.secondweekcheckedarray.push({ Thursday: true });
  533. }
  534. if (friday == true) {
  535. $("#2ndFriday").prop("checked", true);
  536. instance.secondweekcheckedarray.push({ Friday: true });
  537. }
  538. if (saturday == true) {
  539. $("#2ndSaturday").prop("checked", true);
  540. instance.secondweekcheckedarray.push({ Saturday: true });
  541. }
  542. }
  543. else if (weekid == 3) {
  544. if (sunday == true) {
  545. $("#3rdSunday").prop("checked", true);
  546. instance.thirdweekcheckedarray.push({ Sunday: true });
  547. }
  548. if (monday == true) {
  549. $("#3rdMonday").prop("checked", true);
  550. instance.thirdweekcheckedarray.push({ Monday: true });
  551. }
  552. if (tuesday == true) {
  553. $("#3rdTuesday").prop("checked", true);
  554. instance.thirdweekcheckedarray.push({ Tuesday: true });
  555. }
  556. if (wednesday == true) {
  557. $("#3rdWednesday").prop("checked", true);
  558. instance.thirdweekcheckedarray.push({ Wednesday: true });
  559. }
  560. if (thursday == true) {
  561. $("#3rdThursday").prop("checked", true);
  562. instance.thirdweekcheckedarray.push({ Thursday: true });
  563. }
  564. if (friday == true) {
  565. $("#3rdFriday").prop("checked", true);
  566. instance.thirdweekcheckedarray.push({ Friday: true });
  567. }
  568. if (saturday == true) {
  569. $("#3rdSaturday").prop("checked", true);
  570. instance.thirdweekcheckedarray.push({ Saturday: true });
  571. }
  572. }
  573. else if (weekid == 4) {
  574. if (sunday == true) {
  575. $("#4thSunday").prop("checked", true);
  576. instance.fourthweekcheckedarray.push({ Sunday: true });
  577. }
  578. if (monday == true) {
  579. $("#4thMonday").prop("checked", true);
  580. instance.fourthweekcheckedarray.push({ Monday: true });
  581. }
  582. if (tuesday == true) {
  583. $("#4thTuesday").prop("checked", true);
  584. instance.fourthweekcheckedarray.push({ Tuesday: true });
  585. }
  586. if (wednesday == true) {
  587. $("#4thWednesday").prop("checked", true);
  588. instance.fourthweekcheckedarray.push({ Wednesday: true });
  589. }
  590. if (thursday == true) {
  591. $("#4thThursday").prop("checked", true);
  592. instance.fourthweekcheckedarray.push({ Thursday: true });
  593. }
  594. if (friday == true) {
  595. $("#4thFriday").prop("checked", true);
  596. instance.fourthweekcheckedarray.push({ Friday: true });
  597. }
  598. if (saturday == true) {
  599. $("#4thSaturday").prop("checked", true);
  600. instance.fourthweekcheckedarray.push({ Saturday: true });
  601. }
  602. }
  603. else if (weekid == 5) {
  604. if (sunday == true) {
  605. $("#5thSunday").prop("checked", true);
  606. instance.fifththweekcheckedarray.push({ Sunday: true });
  607. }
  608. if (monday == true) {
  609. $("#5thMonday").prop("checked", true);
  610. instance.fifththweekcheckedarray.push({ Monday: true });
  611. }
  612. if (tuesday == true) {
  613. $("#5thTuesday").prop("checked", true);
  614. instance.fifththweekcheckedarray.push({ Tuesday: true });
  615. }
  616. if (wednesday == true) {
  617. $("#5thWednesday").prop("checked", true);
  618. instance.fifththweekcheckedarray.push({ Wednesday: true });
  619. }
  620. if (thursday == true) {
  621. $("#5thThursday").prop("checked", true);
  622. instance.fifththweekcheckedarray.push({ Thursday: true });
  623. }
  624. if (friday == true) {
  625. $("#5thFriday").prop("checked", true);
  626. instance.fifththweekcheckedarray.push({ Friday: true });
  627. }
  628. if (saturday == true) {
  629. $("#5thSaturday").prop("checked", true);
  630. instance.fifththweekcheckedarray.push({ Saturday: true });
  631. }
  632. }
  633. }
  634. }
  635. });
  636. });
  637. }
  638. HolidayCalendarobj() {
  639. let instance = this;
  640. var allsundays;
  641. var allmondays;
  642. var alltuesdays;
  643. var allwednesdays;
  644. var allthursdays;
  645. var allfridays;
  646. var allsaturdays;
  647. if ($("#SelectAllSunday").is(':checked')) {
  648. allsundays = true;
  649. }
  650. else {
  651. allsundays = false;
  652. }
  653. if ($("#SelectAllMonday").is(':checked')) {
  654. allmondays = true;
  655. }
  656. else {
  657. allmondays = false;
  658. }
  659. if ($("#SelectAllTuesday").is(':checked')) {
  660. alltuesdays = true;
  661. }
  662. else {
  663. alltuesdays = false;
  664. }
  665. if ($("#SelectAllWednesday").is(':checked')) {
  666. allwednesdays = true;
  667. }
  668. else {
  669. allwednesdays = false;
  670. }
  671. if ($("#SelectAllThursday").is(':checked')) {
  672. allthursdays = true;
  673. }
  674. else {
  675. allthursdays = false;
  676. }
  677. if ($("#SelectAllFriday").is(':checked')) {
  678. allfridays = true;
  679. }
  680. else {
  681. allfridays = false;
  682. }
  683. if ($("#SelectAllSaturday").is(':checked')) {
  684. allsaturdays = true;
  685. }
  686. else {
  687. allsaturdays = false;
  688. }
  689. instance.holidaycalendar.push({
  690. AllSundays: allsundays,
  691. AllMondays: allmondays,
  692. AllTuesdays: alltuesdays,
  693. AllWednesdays: allwednesdays,
  694. AllThursdays: allthursdays,
  695. AllFridays: allfridays,
  696. AllSaturdays: allsaturdays
  697. });
  698. }
  699. HolidayCalendarobjitems() {
  700. let instance = this;
  701. instance.HolidayCalendarobj();
  702. var holidaycalendaritems = new Array();
  703. holidaycalendaritems.push({
  704. AllWeeks: instance.holidaycalendar,
  705. FirstWeek: instance.firstweekcheckedarray,
  706. SecondWeek: instance.secondweekcheckedarray,
  707. ThirdWeek: instance.thirdweekcheckedarray,
  708. FourthWeek: instance.fourthweekcheckedarray,
  709. FifthWeek: instance.fifththweekcheckedarray
  710. });
  711. return holidaycalendaritems;
  712. }
  713. static Instance() {
  714. if (this.instance === undefined) {
  715. this.instance = new ShiftCalender();
  716. }
  717. return this.instance;
  718. }
  719. }
  720. Components.ShiftCalender = ShiftCalender;
  721. })(Components = Hrms.Components || (Hrms.Components = {}));
  722. })(Hrms = Apps.Hrms || (Apps.Hrms = {}));
  723. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  724. })(Bizgaze || (Bizgaze = {}));