<select
class="form-control"
ng-model="type"
- ng-init='types=[{n:"basic",l:"[%l('Basic')%]"},{n:"supplement",l:"[%l('Supplement')%]"},{n:"index",l:"[%l('Index')%]"},{n:"adhoc",l:"[%l('Ad Hoc')%]"}]'
+ ng-init='types=[{n:"basic",l:"[%l('Basic')%]"},{n:"supplement",l:"[%l('Supplement')%]"},{n:"index",l:"[%l('Index')%]"}]'
ng-options='t.n as t.l for t in types'>
</select>
</div>
</div>
+ <div class="row">
+ <div class="col-md-3">
+ <b>[% l('Ad hoc issue?') %]</b>
+ </div>
+ <div class="col-md-1">
+ <input type="checkbox" ng-model="args.adhoc">
+ </div>
+ </div>
- <div ng-show="type=='adhoc'">
+ <div ng-show="args.adhoc">
<div class="pad-vert row">
<div class="col-md-3">
<b>[% l('Issuance Label') %]</b>
</div>
</div>
- <div ng-hide="type=='adhoc'">
+ <div ng-hide="args.adhoc">
<div class="row container" ng-if="args.enums.length">
<hr/>
<h2>[% l('Enumeration labels') %]</h2>
title : egCore.strings.SERIALS_EDIT_SISS_HC,
curr_iss : egCore.idl.fromHash('siss',item.issuance),
label : item.issuance.label,
- type : item.issuance.type ? item.issuance.type : 'adhoc'
+ type : item.issuance.type ? item.issuance.type : 'basic'
}).then(function(result) {
- if (result.type != 'adhoc') {
+ if (result.adhoc) {
item.issuance.holding_code = JSON.stringify(result.holding_code);
item.issuance.holding_type = result.type;
} else {
$scope.following_issuance = function (items) {
return egSerialsCoreSvc.new_holding_code({
title : egCore.strings.SERIALS_ISSUANCE_ADD,
- type : 'adhoc',
prev_iss : egCore.idl.fromHash('siss',items[0].issuance)
}).then(function(hc) {
- if (hc.type == 'adhoc') {
+ if (hc.adhoc) {
var new_iss = new egCore.idl.siss();
new_iss.creator( egCore.auth.user().id() );
new_iss.editor( egCore.auth.user().id() );
new_iss.date_published( hc.date.toISOString() );
new_iss.subscription( $scope.ssubId );
new_iss.label( hc.label );
+ new_iss.holding_type( hc.type );
return egCore.pcrud.create(new_iss).then(function(issuance) {
var new_item = new egCore.idl.sitem();
var date = args.date;
var prev_iss = args.prev_iss;
var curr_iss = args.curr_iss;
+ var adhoc = false;
var link = '1.1';
var sub = service.get_ssub(service.subId);
if (!sub) return args;
var scap;
- if (prev_iss) { // we're predicting
+ if (prev_iss && prev_iss.holding_code()) { // we're predicting
var old_link_parts = JSON.parse(prev_iss.holding_code())[3].split('.');
var olink = old_link_parts[0];
var oseq = parseInt(old_link_parts[1]) + 1;
});
if (angular.isArray(tmp) && tmp[0]) scap = tmp[0];
}
+ if (!curr_iss.holding_code()) {
+ adhoc = true;
+ }
date = new Date(curr_iss.date_published());
} else {
enums : enums,
chrons : chrons,
others : others,
- freq : freq
+ freq : freq,
+ adhoc : adhoc
};
}
$scope.save_label = options.save_label;
$scope.pubdate = options.date;
$scope.type = options.type || 'basic';
- $scope.args = {};
+ $scope.args = { adhoc : false };
+ if (options.adhoc) $scope.args.adhoc = true;
function refresh (n,o) {
if (n && o && n !== o) {
type : $scope.type,
date : $scope.pubdate,
prev_iss : options.prev_iss,
- curr_iss : options.curr_iss
+ curr_iss : options.curr_iss,
});
if ($scope.args.type && $scope.type != $scope.args.type)