From: Galen Charlton Date: Tue, 2 May 2017 21:59:37 +0000 (-0400) Subject: webstaff: more work on the regularity UI X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d6b78b3210a49344058cf8d3fa2f7eec4922cd2;p=working%2FEvergreen.git webstaff: more work on the regularity UI Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js index beb2b15e3d..8cb05468b1 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js @@ -306,11 +306,42 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider) { self.chron_levels.pop(); } } + this.add_regularity = function() { + self.regularity.push({ + regularity_type : null, + chron_type : null, + parts : [{ sub_type : null }] + }); + } + this.remove_regularity = function(idx) { + if (self.regularity.length > idx) { + self.regularity.splice(idx, 1); + } + // and add a blank entry back if need be + if (self.regularity.length == 0) { + self.add_regularity(); + } + } + this.add_regularity_part = function(reg) { + reg.parts.push({ + sub_type : null + }); + } + this.remove_regularity_part = function(reg, idx) { + if (reg.parts.length > idx) { + reg.parts.splice(idx, 1); + } + // and add a blank entry back if need be + if (reg.parts.length == 0) { + self.add_regularity_part(reg); + } + } + } // TODO chron only // dummy pattern - $scope.pattern = new PredictionPattern(["3","0","8","1","a","v.","b","no.","u","6","v","r","g","sequence","i","(year)","j","month","m","(day)","w","m","x","06,12"]); + $scope.pattern = new PredictionPattern(["3","0","8","1","a","v.","b","no.","u","6","v","r","g","sequence","i","(year)","j","month","m","(day)","w","m","x","06,12","y","pw02we","y","ow0402th,0501"]); console.debug($scope.pattern); }] }