Merge remote-tracking branch 'working/collab/gmcharlt/lp1708291-webstaff-serials... user/gmcharlt/tmp-serials-batch-patron-edit-merge
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 24 Aug 2017 21:51:58 +0000 (17:51 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 24 Aug 2017 21:51:58 +0000 (17:51 -0400)
Conflicts:
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/services/ui.js
Open-ILS/web/js/ui/default/staff/test/karma.conf.js

13 files changed:
1  2 
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/070.schema.container.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/templates/staff/base_js.tt2
Open-ILS/src/templates/staff/cat/catalog/index.tt2
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/src/templates/staff/share/t_autogrid.tt2
Open-ILS/web/js/ui/default/staff/Gruntfile.js
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/package.json
Open-ILS/web/js/ui/default/staff/services/ui.js
Open-ILS/web/js/ui/default/staff/test/karma.conf.js

Simple merge
@@@ -1679,9 -1679,9 +1679,12 @@@ INSERT INTO permission.perm_list ( id, 
   ( 590, 'ADMIN_COPY_TAG_TYPES', oils_i18n_gettext( 590,
      'Administer copy tag types', 'ppl', 'description' )),
   ( 591, 'ADMIN_COPY_TAG', oils_i18n_gettext( 591,
-     'Administer copy tag', 'ppl', 'description' ))
-  ( 590,'CONTAINER_BATCH_UPDATE', oils_i18n_gettext( 590,
-     'Allow batch update via buckets', 'ppl', 'description' ))
+     'Administer copy tag', 'ppl', 'description' )),
 - ( 592, 'ADMIN_SERIAL_PATTERN_TEMPLATE', oils_i18n_gettext( 592,
++ ( 592,'CONTAINER_BATCH_UPDATE', oils_i18n_gettext( 592,
++    'Allow batch update via buckets', 'ppl', 'description' )),
++ ( 593, 'ADMIN_SERIAL_PATTERN_TEMPLATE', oils_i18n_gettext( 593,
+     'Administer serial prediction pattern templates', 'ppl', 'description' ))
++>>>>>>> working/collab/gmcharlt/lp1708291-webstaff-serials
  ;
  
  SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
@@@ -8,9 -8,12 +8,13 @@@
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/marcrecord.js"></script>
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
 +<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/patron_search.js"></script>
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/record.js"></script>
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/tagtable.js"></script>
+ [% INCLUDE 'staff/serials/share/serials_strings.tt2' %]
+ <script src="[% ctx.media_prefix %]/js/ui/default/staff/serials/app.js"></script>
+ <script src="[% ctx.media_prefix %]/js/ui/default/staff/serials/services/core.js"></script>
+ <script src="[% ctx.media_prefix %]/js/ui/default/staff/serials/directives/sub_selector.js"></script>
  [% INCLUDE 'staff/cat/share/marcedit_strings.tt2' %]
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/marcedit.js"></script>
  <script src="[% ctx.media_prefix %]/js/ui/default/staff/circ/services/circ.js"></script>
@@@ -7,7 -7,7 +7,8 @@@
   *
   */
  
 -angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','ngLocationUpdate','egCoreMod','egGridMod', 'egMarcMod', 'egUserMod', 'egHoldingsMod', 'ngToast', 'egSerialsMod', 'egSerialsAppDep'])
 +angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','ngLocationUpdate','egCoreMod','egGridMod', 'egMarcMod', 'egUserMod', 'egHoldingsMod', 'ngToast','egPatronSearchMod'])
++angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','ngLocationUpdate','egCoreMod','egGridMod', 'egMarcMod', 'egUserMod', 'egHoldingsMod', 'ngToast', 'egSerialsMod', 'egSerialsAppDep','egPatronSearchMod'])
  
  .config(['ngToastProvider', function(ngToastProvider) {
    ngToastProvider.configure({
@@@ -84,145 -84,18 +84,157 @@@ function($timeout , $parse) 
      };
  })
  
 +// 'date' filter
 +// Overriding the core angular date filter with a moment-js based one for
 +// better timezone and formatting support.
 +.filter('date',function() {
 +
 +    var formatMap = {
 +        short  : 'l LT',
 +        medium : 'lll',
 +        long   : 'LLL',
 +        full   : 'LLLL',
 +
 +        shortDate  : 'l',
 +        mediumDate : 'll',
 +        longDate   : 'LL',
 +        fullDate   : 'LL',
 +
 +        shortTime  : 'LT',
 +        mediumTime : 'LTS'
 +    };
 +
 +    var formatReplace = [
 +        [ /yyyy/g, 'YYYY' ],
 +        [ /yy/g,   'YY'   ],
 +        [ /y/g,    'Y'    ],
 +        [ /ww/g,   'WW'   ],
 +        [ /w/g,    'W'    ],
 +        [ /dd/g,   'DD'   ],
 +        [ /d/g,    'D'    ],
 +        [ /sss/g,  'SSS'  ],
 +        [ /EEEE/g, 'dddd' ],
 +        [ /EEE/g,  'ddd'  ],
 +        [ /Z/g,    'ZZ'   ]
 +    ];
 +
 +    return function (date, format, tz) {
 +        if (!date) return '';
 +
 +        if (date == 'now') 
 +            date = new Date().toISOString();
 +
 +        if (format) {
 +            var fmt = formatMap[format] || format;
 +            angular.forEach(formatReplace, function (r) {
 +                fmt = fmt.replace(r[0],r[1]);
 +            });
 +        }
 +
 +        var d = moment(date);
 +        if (tz && tz !== '-') d.tz(tz);
 +
 +        return d.isValid() ? d.format(fmt) : '';
 +    }
 +
 +})
 +
 +// 'egOrgDate' filter
 +// Uses moment.js and moment-timezone.js to put dates into the most appropriate
 +// timezone for a given (optional) org unit based on its lib.timezone setting
 +.filter('egOrgDate',['$filter','egCore',
 +             function($filter , egCore) {
 +
 +    var tzcache = {};
 +
 +    function eg_date_filter (date, fmt, ouID) {
 +        if (ouID) {
 +            if (angular.isObject(ouID)) {
 +                if (angular.isFunction(ouID.id)) {
 +                    ouID = ouID.id();
 +                } else {
 +                    ouID = ouID.id;
 +                }
 +            }
 +    
 +            if (!tzcache[ouID]) {
 +                tzcache[ouID] = '-';
 +                egCore.org.settings('lib.timezone', ouID)
 +                .then(function(s) {
 +                    tzcache[ouID] = s['lib.timezone'] || OpenSRF.tz;
 +                });
 +            }
 +        }
 +
 +        return $filter('date')(date, fmt, tzcache[ouID]);
 +    }
 +
 +    eg_date_filter.$stateful = true;
 +
 +    return eg_date_filter;
 +}])
 +
 +// 'egOrgDateInContext' filter
 +// Uses the egOrgDate filter to make time and date location aware, and further
 +// modifies the format if one of [short, medium, long, full] to show only the
 +// date if the optional interval parameter is day-granular.  This is
 +// particularly useful for due dates on circulations.
 +.filter('egOrgDateInContext',['$filter','egCore',
 +                      function($filter , egCore) {
 +
 +    function eg_context_date_filter (date, format, orgID, interval) {
 +        var fmt = format;
 +        if (!fmt) fmt = 'shortDate';
 +
 +        // if this is a simple, one-word format, and it doesn't say "Date" in it...
 +        if (['short','medium','long','full'].filter(function(x){return fmt == x}).length > 0 && interval) {
 +            var secs = egCore.date.intervalToSeconds(interval);
 +            if (secs !== null && secs % 86400 == 0) fmt += 'Date';
 +        }
 +
 +        return $filter('egOrgDate')(date, fmt, orgID);
 +    }
 +
 +    eg_context_date_filter.$stateful = true;
 +
 +    return eg_context_date_filter;
 +}])
 +
 +// 'egDueDate' filter
 +// Uses the egOrgDateInContext filter to make time and date location aware, but
 +// only if the supplied interval is day-granular.  This is as wrapper for
 +// egOrgDateInContext to be used for circulation due date /only/.
 +.filter('egDueDate',['$filter','egCore',
 +                      function($filter , egCore) {
 +
 +    function eg_context_due_date_filter (date, format, orgID, interval) {
 +        if (interval) {
 +            var secs = egCore.date.intervalToSeconds(interval);
 +            if (secs === null || secs % 86400 != 0) {
 +                orgID = null;
 +                interval = null;
 +            }
 +        }
 +        return $filter('egOrgDateInContext')(date, format, orgID, interval);
 +    }
 +
 +    eg_context_due_date_filter.$stateful = true;
 +
 +    return eg_context_due_date_filter;
 +}])
 +
+ // 'join' filter
+ // TODO: perhaps this should live elsewhere
+ .filter('join', function() {
+     return function(arr,sep) {
+         if (typeof arr == 'object' && arr.constructor == Array) {
+             return arr.join(sep || ',');
+         } else {
+             return '';
+         }
+     };
+ })
  /**
   * Progress Dialog. 
   *
@@@ -44,9 -44,8 +44,10 @@@ module.exports = function(config)
        'services/ui.js',
        'services/grid.js',
        'services/op_change.js',
 +      'services/patron_search.js',
        'services/navbar.js', 'services/date.js',
 +      'services/user-bucket.js',
+       'services/i18n.js',
        // load app scripts
        'app.js',
        'circ/**/*.js',