2 * UI tools and directives.
4 angular.module('egUiMod', ['egCoreMod', 'ui.bootstrap'])
8 * <input focus-me="iAmOpen"/>
9 * $scope.iAmOpen = true;
13 function($timeout , $parse) {
15 link: function(scope, element, attrs) {
16 var model = $parse(attrs.focusMe);
17 scope.$watch(model, function(value) {
19 $timeout(function() {element[0].focus()});
21 element.bind('blur', function() {
23 scope.$apply(model.assign(scope, false));
31 * <input blur-me="pleaseBlurMe"/>
32 * $scope.pleaseBlurMe = true
33 * Useful for de-focusing when no other obvious focus target exists
37 function($timeout , $parse) {
39 link: function(scope, element, attrs) {
40 var model = $parse(attrs.blurMe);
41 scope.$watch(model, function(value) {
43 $timeout(function() {element[0].blur()});
45 element.bind('focus', function() {
47 scope.$apply(model.assign(scope, false));
55 // <input select-me="iWantToBeSelected"/>
56 // $scope.iWantToBeSelected = true;
57 .directive('selectMe',
59 function($timeout , $parse) {
61 link: function(scope, element, attrs) {
62 var model = $parse(attrs.selectMe);
63 scope.$watch(model, function(value) {
65 $timeout(function() {element[0].select()});
67 element.bind('blur', function() {
69 scope.$apply(model.assign(scope, false));
78 // <div ng-repeat="item in items | reverse">{{item.name}}</div>
79 // http://stackoverflow.com/questions/15266671/angular-ng-repeat-in-reverse
80 // TODO: perhaps this should live elsewhere
81 .filter('reverse', function() {
82 return function(items) {
83 return items.slice().reverse();
88 // Uses moment.js and moment-timezone.js to put dates into the most appropriate
89 // timezone for a given (optional) org unit based on its lib.timezone setting
90 .filter('egOrgDate',['egCore',
108 var formatReplace = [
122 var tzcache = {'*':null};
124 function eg_date_filter (date, format, ouID) {
125 var fmt = formatMap[format] || format;
126 angular.forEach(formatReplace, function (r) {
127 fmt = fmt.replace(r[0],r[1]);
132 if (angular.isObject(ouID)) {
133 if (angular.isFunction(ouID.id)) {
140 if (tzcache[ouID] && tzcache[ouID] !== '-') {
141 d = moment(date).tz(tzcache[ouID]);
144 if (!tzcache[ouID]) {
147 egCore.org.settings('lib.timezone', ouID)
149 tzcache[ouID] = s['lib.timezone'] || OpenSRF.tz;
159 return d.isValid() ? d.format(fmt) : '';
162 eg_date_filter.$stateful = true;
164 return eg_date_filter;
167 // 'egOrgDateInContext' filter
168 // Uses the egOrgDate filter to make time and date location aware, and further
169 // modifies the format if one of [short, medium, long, full] to show only the
170 // date if the optional interval parameter is day-granular. This is
171 // particularly useful for due dates on circulations.
172 .filter('egOrgDateInContext',['$filter','egCore',
173 function($filter , egCore) {
175 function eg_context_date_filter (date, format, orgID, interval) {
177 if (!fmt) fmt = 'shortDate';
179 // if this is a simple, one-word format, and it doesn't say "Date" in it...
180 if (['short','medium','long','full'].filter(function(x){return fmt == x}).length > 0 && interval) {
181 var secs = egCore.date.intervalToSeconds(interval);
182 if (secs !== null && secs % 86400 == 0) fmt += 'Date';
185 return $filter('egOrgDate')(date, fmt, orgID);
188 eg_context_date_filter.$stateful = true;
190 return eg_context_date_filter;
193 // 'egDueDate' filter
194 // Uses the egOrgDateInContext filter to make time and date location aware, but
195 // only if the supplied interval is day-granular. This is as wrapper for
196 // egOrgDateInContext to be used for circulation due date /only/.
197 .filter('egDueDate',['$filter','egCore',
198 function($filter , egCore) {
200 function eg_context_due_date_filter (date, format, orgID, interval) {
202 var secs = egCore.date.intervalToSeconds(interval);
203 if (secs === null || secs % 86400 != 0) {
208 return $filter('egOrgDateInContext')(date, format, orgID, interval);
211 eg_context_due_date_filter.$stateful = true;
213 return eg_context_due_date_filter;
219 * egProgressDialog.open();
220 * egProgressDialog.open({value : 0});
221 * egProgressDialog.open({value : 0, max : 123});
222 * egProgressDialog.increment();
223 * egProgressDialog.increment();
224 * egProgressDialog.close();
226 * Each dialog has 2 numbers, 'max' and 'value'.
227 * The content of these values determines how the dialog displays.
229 * There are 3 flavors:
231 * -- value is set, max is set
232 * determinate: shows a progression with a percent complete.
234 * -- value is set, max is unset
235 * semi-determinate, with a value report. Shows a value-less
236 * <progress/>, but shows the value as a number in the dialog.
238 * This is useful in cases where the total number of items to retrieve
239 * from the server is unknown, but we know how many items we've
240 * retrieved thus far. It helps to reinforce that something specific
241 * is happening, but we don't know when it will end.
244 * indeterminate: shows a generic value-less <progress/> with no
245 * clear indication of progress.
247 * Only 1 egProgressDialog instance will be activate at a time.
248 * Each invocation of .open() destroys any existing instance.
251 /* Simple storage class for egProgressDialog data maintenance.
252 * This data lives outside of egProgressDialog so it can be
253 * directly imported into egProgressDialog's $uibModalInstance.
255 .factory('egProgressData', [
257 var service = {}; // max/value initially unset
259 service.reset = function() {
261 delete service.value;
264 service.hasvalue = function() {
265 return Number.isInteger(service.value);
268 service.hasmax = function() {
269 return Number.isInteger(service.max);
272 service.percent = function() {
273 if (service.hasvalue() &&
276 service.value <= service.max)
277 return Math.floor((service.value / service.max) * 100);
285 .factory('egProgressDialog', [
286 'egProgressData','$uibModal',
287 function(egProgressData , $uibModal) {
290 service.open = function(args) {
291 service.close(); // force-kill existing instances.
293 // Reset to an indeterminate progress bar,
294 // overlay with caller values.
295 egProgressData.reset();
296 service.update(angular.extend({}, args));
298 return $uibModal.open({
299 templateUrl: './share/t_progress_dialog',
300 controller: ['$scope','$uibModalInstance','egProgressData',
301 function( $scope , $uibModalInstance , egProgressData) {
302 service.currentInstance = $uibModalInstance;
303 $scope.data = egProgressData; // tiny service
309 service.close = function() {
310 if (service.currentInstance) {
311 service.currentInstance.close();
312 delete service.currentInstance;
316 // Set the current state of the progress bar.
317 service.update = function(args) {
318 if (args.max != undefined)
319 egProgressData.max = args.max;
320 if (args.value != undefined)
321 egProgressData.value = args.value;
324 // Increment the current value. If no amount is specified,
325 // it increments by 1. Calling increment() on an indetermite
326 // progress bar will force it to be a (semi-)determinate bar.
327 service.increment = function(amt) {
328 if (!Number.isInteger(amt)) amt = 1;
330 if (!egProgressData.hasvalue())
331 egProgressData.value = 0;
333 egProgressData.value += amt;
340 * egAlertDialog.open({message : 'hello {{name}}'}).result.then(
341 * function() { console.log('alert closed') });
343 .factory('egAlertDialog',
345 ['$uibModal','$interpolate',
346 function($uibModal , $interpolate) {
349 service.open = function(message, msg_scope) {
350 return $uibModal.open({
351 templateUrl: './share/t_alert_dialog',
352 controller: ['$scope', '$uibModalInstance',
353 function($scope, $uibModalInstance) {
354 $scope.message = $interpolate(message)(msg_scope);
355 $scope.ok = function() {
356 if (msg_scope && msg_scope.ok) msg_scope.ok();
357 $uibModalInstance.close()
368 * egConfirmDialog.open("some message goes {{here}}", {
369 * here : 'foo', ok : function() {}, cancel : function() {}},
372 .factory('egConfirmDialog',
374 ['$uibModal','$interpolate',
375 function($uibModal, $interpolate) {
378 service.open = function(title, message, msg_scope, ok_button_label, cancel_button_label) {
379 return $uibModal.open({
380 templateUrl: './share/t_confirm_dialog',
381 controller: ['$scope', '$uibModalInstance',
382 function($scope, $uibModalInstance) {
383 $scope.title = $interpolate(title)(msg_scope);
384 $scope.message = $interpolate(message)(msg_scope);
385 $scope.ok_button_label = $interpolate(ok_button_label || '')(msg_scope);
386 $scope.cancel_button_label = $interpolate(cancel_button_label || '')(msg_scope);
387 $scope.ok = function() {
388 if (msg_scope.ok) msg_scope.ok();
389 $uibModalInstance.close()
391 $scope.cancel = function() {
392 if (msg_scope.cancel) msg_scope.cancel();
393 $uibModalInstance.dismiss();
404 * egPromptDialog.open(
405 * "prompt message goes {{here}}",
406 * promptValue, // optional
409 * ok : function(value) {console.log(value)},
410 * cancel : function() {console.log('prompt denied')}
414 .factory('egPromptDialog',
416 ['$uibModal','$interpolate',
417 function($uibModal, $interpolate) {
420 service.open = function(message, promptValue, msg_scope) {
421 return $uibModal.open({
422 templateUrl: './share/t_prompt_dialog',
423 controller: ['$scope', '$uibModalInstance',
424 function($scope, $uibModalInstance) {
425 $scope.message = $interpolate(message)(msg_scope);
426 $scope.args = {value : promptValue || ''};
428 $scope.ok = function() {
429 if (msg_scope.ok) msg_scope.ok($scope.args.value);
430 $uibModalInstance.close()
432 $scope.cancel = function() {
433 if (msg_scope.cancel) msg_scope.cancel();
434 $uibModalInstance.dismiss();
445 * egSelectDialog.open(
446 * "message goes {{here}}",
447 * list, // ['values','for','dropdown'],
448 * selectedValue, // optional
451 * ok : function(value) {console.log(value)},
452 * cancel : function() {console.log('prompt denied')}
456 .factory('egSelectDialog',
458 ['$uibModal','$interpolate',
459 function($uibModal, $interpolate) {
462 service.open = function(message, inputList, selectedValue, msg_scope) {
463 return $uibModal.open({
464 templateUrl: './share/t_select_dialog',
465 controller: ['$scope', '$uibModalInstance',
466 function($scope, $uibModalInstance) {
467 $scope.message = $interpolate(message)(msg_scope);
470 value : selectedValue
473 $scope.ok = function() {
474 if (msg_scope.ok) msg_scope.ok($scope.args.value);
475 $uibModalInstance.close()
477 $scope.cancel = function() {
478 if (msg_scope.cancel) msg_scope.cancel();
479 $uibModalInstance.dismiss();
490 * Warn on page unload and give the user a chance to avoid navigating
491 * away from the current page.
492 * Only one handler is supported per page.
493 * NOTE: we can't use an egUnloadDialog as the dialog builder, because
494 * it renders asynchronously, which allows the page to redirect before
495 * the dialog appears.
497 .factory('egUnloadPrompt', [
498 '$window','egStrings',
499 function($window , egStrings) {
500 var service = {attached : false};
502 // attach a page/scope unload prompt
503 service.attach = function($scope, msg) {
504 if (service.attached) return;
505 service.attached = true;
507 // handle page change
508 $($window).on('beforeunload', function() {
510 return msg || egStrings.EG_UNLOAD_PAGE_PROMPT_MSG;
515 // If a scope was provided, attach a scope-change handler,
516 // similar to the page-page prompt.
517 service.locChangeCancel =
518 $scope.$on('$locationChangeStart', function(evt, next, current) {
519 if (confirm(msg || egStrings.EG_UNLOAD_CTRL_PROMPT_MSG)) {
520 // user allowed the page to change.
521 // Clear the unload handler.
524 evt.preventDefault();
529 // remove the page unload prompt
530 service.clear = function() {
531 $($window).off('beforeunload');
532 if (service.locChangeCancel)
533 service.locChangeCancel();
534 service.attached = false;
540 .directive('aDisabled', function() {
543 compile: function(tElement, tAttrs, transclude) {
545 tAttrs["ngClick"] = ("ng-click", "!("+tAttrs["aDisabled"]+") && ("+tAttrs["ngClick"]+")");
547 //Toggle "disabled" to class when aDisabled becomes true
548 return function (scope, iElement, iAttrs) {
549 scope.$watch(iAttrs["aDisabled"], function(newValue) {
550 if (newValue !== undefined) {
551 iElement.toggleClass("disabled", newValue);
555 //Disable href on click
556 iElement.on("click", function(e) {
557 if (scope.$eval(iAttrs["aDisabled"])) {
566 .directive('egBasicComboBox', function() {
571 list: "=", // list of strings
577 '<div class="input-group">'+
578 '<input type="text" ng-disabled="egDisabled" class="form-control" ng-model="selected" ng-change="makeOpen()">'+
579 '<div class="input-group-btn" dropdown ng-class="{open:isopen}">'+
580 '<button type="button" ng-click="showAll()" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>'+
581 '<ul class="dropdown-menu dropdown-menu-right">'+
582 '<li ng-repeat="item in list|filter:selected"><a href ng-click="changeValue(item)">{{item}}</a></li>'+
583 '<li ng-if="complete_list" class="divider"><span></span></li>'+
584 '<li ng-if="complete_list" ng-repeat="item in list"><a href ng-click="changeValue(item)">{{item}}</a></li>'+
588 controller: ['$scope','$filter',
589 function( $scope , $filter) {
591 $scope.complete_list = false;
592 $scope.isopen = false;
593 $scope.clickedopen = false;
594 $scope.clickedclosed = null;
596 $scope.showAll = function () {
598 $scope.clickedopen = !$scope.clickedopen;
600 if ($scope.clickedclosed === null) {
601 if (!$scope.clickedopen) {
602 $scope.clickedclosed = true;
605 $scope.clickedclosed = !$scope.clickedopen;
608 if ($scope.selected.length > 0) $scope.complete_list = true;
609 if ($scope.selected.length == 0) $scope.complete_list = false;
613 $scope.makeOpen = function () {
614 $scope.isopen = $scope.clickedopen || ($filter('filter')(
617 ).length > 0 && $scope.selected.length > 0);
618 if ($scope.clickedclosed) $scope.isopen = false;
621 $scope.changeValue = function (newVal) {
622 $scope.selected = newVal;
623 $scope.isopen = false;
624 $scope.clickedclosed = null;
625 $scope.clickedopen = false;
626 if ($scope.selected.length == 0) $scope.complete_list = false;
635 * Nested org unit selector modeled as a Bootstrap dropdown button.
637 .directive('egOrgSelector', function() {
641 replace : true, // makes styling easier
643 selected : '=', // defaults to workstation or root org,
644 // unless the nodefault attibute exists
646 // Each org unit is passed into this function and, for
647 // any org units where the response value is true, the
648 // org unit will not be added to the selector.
651 // Each org unit is passed into this function and, for
652 // any org units where the response value is true, the
653 // org unit will not be available for selection.
656 // if set to true, disable the UI element altogether
659 // Caller can either $watch(selected, ..) or register an
663 // optional primary drop-down button label
666 // optional name of settings key for persisting
667 // the last selected org unit
671 // any reason to move this into a TT2 template?
673 '<div class="btn-group eg-org-selector" uib-dropdown>'
674 + '<button type="button" class="btn btn-default" uib-dropdown-toggle ng-disabled="disable_button">'
675 + '<span style="padding-right: 5px;">{{getSelectedName()}}</span>'
676 + '<span class="caret"></span>'
678 + '<ul uib-dropdown-menu class="scrollable-menu">'
679 + '<li ng-repeat="org in orgList" ng-hide="hiddenTest(org.id)">'
680 + '<a href ng-click="orgChanged(org)" a-disabled="disableTest(org.id)" '
681 + 'style="padding-left: {{org.depth * 10 + 5}}px">'
682 + '{{org.shortname}}'
688 controller : ['$scope','$timeout','egCore','egStartup',
689 function($scope , $timeout , egCore , egStartup) {
691 if ($scope.alldisabled) {
692 $scope.disable_button = $scope.alldisabled == 'true' ? true : false;
694 $scope.disable_button = false;
697 // avoid linking the full fleshed tree to the scope by
698 // tossing in a flattened list.
700 // Run-time code referencing post-start data should be run
701 // from within a startup block, otherwise accessing this
702 // module before startup completes will lead to failure.
704 // controller() runs before link().
705 // This post-startup code runs after link().
706 egStartup.go().then(function() {
708 $scope.orgList = egCore.org.list().map(function(org) {
711 shortname : org.shortname(),
712 depth : org.ou_type().depth()
716 // Apply default values
718 if ($scope.stickySetting) {
719 var orgId = egCore.hatch.getLocalItem($scope.stickySetting);
721 $scope.selected = egCore.org.get(orgId);
725 if (!$scope.selected && !$scope.nodefault) {
727 egCore.org.get(egCore.auth.user().ws_ou());
730 fire_orgsel_onchange(); // no-op if nothing is selected
734 * Fire onchange handler after a timeout, so the
735 * $scope.selected value has a chance to propagate to
736 * the page controllers before the onchange fires. This
737 * way, the caller does not have to manually capture the
738 * $scope.selected value during onchange.
740 function fire_orgsel_onchange() {
741 if (!$scope.selected || !$scope.onchange) return;
742 $timeout(function() {
744 'egOrgSelector onchange('+$scope.selected.id()+')');
745 $scope.onchange($scope.selected)
749 $scope.getSelectedName = function() {
750 if ($scope.selected && $scope.selected.shortname)
751 return $scope.selected.shortname();
755 $scope.orgChanged = function(org) {
756 $scope.selected = egCore.org.get(org.id);
757 if ($scope.stickySetting) {
758 egCore.hatch.setLocalItem($scope.stickySetting, org.id);
760 fire_orgsel_onchange();
764 link : function(scope, element, attrs, egGridCtrl) {
766 // boolean fields are presented as value-less attributes
770 if (angular.isDefined(attrs[field]))
773 scope[field] = false;
780 /* http://eric.sau.pe/angularjs-detect-enter-key-ngenter/ */
781 .directive('egEnter', function () {
782 return function (scope, element, attrs) {
783 element.bind("keydown keypress", function (event) {
784 if(event.which === 13) {
785 scope.$apply(function (){
786 scope.$eval(attrs.egEnter);
789 event.preventDefault();
796 * Handy wrapper directive for uib-datapicker-popup
799 'egDateInput', ['egStrings', 'egCore',
800 function(egStrings, egCore) {
809 hideDatePicker : '=',
813 templateUrl: './share/t_datetime',
815 link : function(scope, elm, attrs) {
816 if (!scope.closeText)
817 scope.closeText = egStrings.EG_DATE_INPUT_CLOSE_TEXT;
819 if ('showTimePicker' in attrs)
820 scope.showTimePicker = true;
822 var default_format = 'mediumDate';
823 egCore.org.settings(['format.date']).then(function(set) {
824 default_format = set['format.date'];
825 scope.date_format = (scope.dateFormat) ?
835 * egFmValueSelector - widget for selecting a value from list specified
838 .directive('egFmValueSelector', function() {
846 // optional filter for refining the set of rows that
847 // get returned. Example:
849 // filter="{'column':{'=':null}}"
852 // optional name of settings key for persisting
853 // the last selected value
856 // optional OU setting for fetching default value;
857 // used only if sticky setting not set
861 templateUrl : './share/t_fm_value_selector',
862 controller : ['$scope','egCore', function($scope , egCore) {
864 $scope.org = egCore.org; // for use in the link function
865 $scope.auth = egCore.auth; // for use in the link function
866 $scope.hatch = egCore.hatch // for use in the link function
868 function flatten_linked_values(cls, list) {
870 var fields = egCore.idl.classes[cls].fields;
873 angular.forEach(fields, function(fld) {
874 if (fld.datatype == 'id') {
876 selector = fld.selector ? fld.selector : id_field;
880 angular.forEach(list, function(item) {
881 var rec = egCore.idl.toHash(item);
891 search[egCore.idl.classes[$scope.idlClass].pkey] = {'!=' : null};
893 angular.extend(search, $scope.filter);
896 $scope.idlClass, search, {}, {atomic : true}
897 ).then(function(list) {
898 $scope.linked_values = flatten_linked_values($scope.idlClass, list);
901 $scope.handleChange = function(value) {
902 if ($scope.stickySetting) {
903 egCore.hatch.setLocalItem($scope.stickySetting, value);
908 link : function(scope, element, attrs) {
909 if (scope.stickySetting && (angular.isUndefined(scope.ngModel) || (scope.ngModel === null))) {
910 var value = scope.hatch.getLocalItem(scope.stickySetting);
911 scope.ngModel = value;
913 if (scope.ouSetting && (angular.isUndefined(scope.ngModel) || (scope.ngModel === null))) {
914 scope.org.settings([scope.ouSetting], scope.auth.user().ws_ou())
915 .then(function(set) {
916 var value = parseInt(set[scope.ouSetting]);
918 scope.ngModel = value;
925 .factory('egWorkLog', ['egCore', function(egCore) {
928 service.retrieve_all = function() {
929 var workLog = egCore.hatch.getLocalItem('eg.work_log') || [];
930 var patronLog = egCore.hatch.getLocalItem('eg.patron_log') || [];
932 return { 'work_log' : workLog, 'patron_log' : patronLog };
935 service.record = function(message,data) {
938 if (typeof egCore != 'undefined') {
939 if (typeof egCore.env != 'undefined') {
940 if (typeof egCore.env.aous != 'undefined') {
941 max_entries = egCore.env.aous['ui.admin.work_log.max_entries'];
942 max_patrons = egCore.env.aous['ui.admin.patron_log.max_entries'];
944 console.log('worklog: missing egCore.env.aous');
947 console.log('worklog: missing egCore.env');
950 console.log('worklog: missing egCore');
953 if (typeof egCore.org != 'undefined') {
954 if (typeof egCore.org.cachedSettings != 'undefined') {
955 max_entries = egCore.org.cachedSettings['ui.admin.work_log.max_entries'];
957 console.log('worklog: missing egCore.org.cachedSettings');
960 console.log('worklog: missing egCore.org');
964 if (typeof egCore.org != 'undefined') {
965 if (typeof egCore.org.cachedSettings != 'undefined') {
966 max_patrons = egCore.org.cachedSettings['ui.admin.patron_log.max_entries'];
968 console.log('worklog: missing egCore.org.cachedSettings');
971 console.log('worklog: missing egCore.org');
976 console.log('worklog: defaulting to max_entries = ' + max_entries);
980 console.log('worklog: defaulting to max_patrons = ' + max_patrons);
983 var workLog = egCore.hatch.getLocalItem('eg.work_log') || [];
984 var patronLog = egCore.hatch.getLocalItem('eg.patron_log') || [];
988 'action' : data.action,
989 'actor' : egCore.auth.user().usrname()
991 if (data.action == 'checkin') {
992 entry['item'] = data.response.params.copy_barcode;
993 entry['item_id'] = data.response.data.acp.id();
994 if (data.response.data.au) {
995 entry['user'] = data.response.data.au.family_name();
996 entry['patron_id'] = data.response.data.au.id();
999 if (data.action == 'checkout') {
1000 entry['item'] = data.response.params.copy_barcode;
1001 entry['user'] = data.response.data.au.family_name();
1002 entry['item_id'] = data.response.data.acp.id();
1003 entry['patron_id'] = data.response.data.au.id();
1005 if (data.action == 'noncat_checkout') {
1006 entry['user'] = data.response.data.au.family_name();
1007 entry['patron_id'] = data.response.data.au.id();
1009 if (data.action == 'renew') {
1010 entry['item'] = data.response.params.copy_barcode;
1011 entry['user'] = data.response.data.au.family_name();
1012 entry['item_id'] = data.response.data.acp.id();
1013 entry['patron_id'] = data.response.data.au.id();
1015 if (data.action == 'requested_hold'
1016 || data.action == 'edited_patron'
1017 || data.action == 'registered_patron'
1018 || data.action == 'paid_bill') {
1019 entry['patron_id'] = data.patron_id;
1021 if (data.action == 'requested_hold') {
1022 entry['hold_id'] = data.hold_id;
1024 if (data.action == 'paid_bill') {
1025 entry['amount'] = data.total_amount;
1028 workLog.push( entry );
1029 if (workLog.length > max_entries) workLog.shift();
1030 egCore.hatch.setLocalItem('eg.work_log',workLog); // hatch JSONifies the data, so should be okay re: memory leaks?
1032 if (entry['patron_id']) {
1034 for (var i = 0; i < patronLog.length; i++) { // filter out any matching patron
1035 if (patronLog[i]['patron_id'] != entry['patron_id']) temp.push(patronLog[i]);
1038 if (temp.length > max_patrons) temp.shift();
1040 egCore.hatch.setLocalItem('eg.patron_log',patronLog);
1043 console.log('worklog',entry);