<option value="chron">[% l('Chronological') %]</option>
<option value="enum" >[% l('Enumeration') %]</option>
</select>
+ <label>[% l('Receiving Template') %]</label>
+ <select ng-model="sdist.receive_unit_template"
+ ng-options="t.id() as t.name() for t in receiving_templates[sdist.holding_lib.id()]">
+ <option value=""></option>
+ </select>
</div>
<div class="col-md-2">
<button class="btn btn-sm btn-info" ng-click="add_stream(sdist)">[% l('Add copy stream') %]</button>
grid-controls="distStreamGridControls"
persist-key="serials.dist_stream_grid">
- <eg-grid-action handler="apply_receiving_template"
- label="[% l('Apply Receiving Template') %]"></eg-grid-action>
<eg-grid-action handler="apply_binding_template"
label="[% l('Apply Binding Template') %]"></eg-grid-action>
<eg-grid-action handler="additional_routing" disabled="need_one_selected"
<eg-grid-field label="[% l('End Date') %]" path="end_date" datatype="timestamp" visible></eg-grid-field>
<eg-grid-field label="[% l('Route To') %]" path="sstr.routing_label" visible></eg-grid-field>
<eg-grid-field label="[% l('Additional Routing') %]" path="sstr.additional_routing" visible></eg-grid-field>
- <eg-grid-field label="[% l('Receiving Template') %]" path="sdist.receive_unit_template.name" visible></eg-grid-field>
+ <eg-grid-field label="[% l('Receiving Template') %]" path="sdist.receive_unit_template"></eg-grid-field>
<eg-grid-field label="[% l('MFHD ID') %]" path="sdist.record_entry" visible></eg-grid-field>
<eg-grid-field label="[% l('Summary Display') %]" path="sdist.summary_method" visible></eg-grid-field>
<eg-grid-field label="[% l('Receiving Call Number') %]" path="sdist.receive_call_number.label"></eg-grid-field>
<eg-grid-field label="[% l('Binding Call Number') %]" path="sdist.bind_call_number.label"></eg-grid-field>
- <eg-grid-field label="[% l('Binding Template') %]" path="sdist.bind_unit_template.name"></eg-grid-field>
+ <eg-grid-field label="[% l('Binding Template') %]" path="sdist.bind_unit_template"></eg-grid-field>
<eg-grid-field label="[% l('Unit Label Prefix') %]" path="sdist.unit_label_prefix"></eg-grid-field>
<eg-grid-field label="[% l('Unit Label Suffix') %]" path="sdist.unit_label_suffix"></eg-grid-field>
<eg-grid-field label="[% l('Display Grouping') %]" path="sdist.display_grouping"></eg-grid-field>
return true;
};
+ $scope.receiving_templates = {};
+ var promises = [];
+ angular.forEach(egCore.org.list(), function(org) {
+ promises.push(
+ egSerialsCoreSvc.fetch_templates(org.id()).then(function(list){
+ $scope.receiving_templates[org.id()] = list;
+ })
+ );
+ });
+ $q.all(promises).then(function() {
+ //console.log('finis',$scope.receiving_templates);
+ });
+
$scope.add_subscription = function() {
var new_ssub = egCore.idl.toTypedHash(new egCore.idl.ssub());
new_ssub._isnew = true;
flesh_fields : {
'ssub' : ['owning_lib','distributions', 'scaps', 'notes'],
'sdist' : [ 'record_entry','holding_lib',
- 'receive_call_number','receive_unit_template',
- 'bind_call_number','bind_unit_template',
+ 'receive_call_number',
+ 'bind_call_number',
'streams','notes'],
'sstr' : ['routing_list_users']
}
});
}
+ service.fetch_templates = function(org) {
+ return egCore.pcrud.search('act',
+ {owning_lib : egCore.org.fullPath(org, true)},
+ {order_by : { act : 'name' }}, {atomic : true}
+ );
+ };
+
return service;
}]);