return $note->id;
}
+__PACKAGE__->register_method (
+ method => 'create_hold_note',
+ api_name => 'open-ils.circ.hold_note.create',
+ signature => q/
+ Creates a new hold request note object
+ @param authtoken The login session key
+ @param note The hold note object to create
+ @return ID of the new object on success, Event on error
+ /
+);
+
+sub create_hold_note {
+ my( $self, $conn, $auth, $note ) = @_;
+ my $e = new_editor(authtoken=>$auth, xact=>1);
+ return $e->die_event unless $e->checkauth;
+
+ my $hold = $e->retrieve_action_hold_request($note->hold)
+ or return $e->die_event;
+ my $patron = $e->retrieve_actor_user($hold->usr)
+ or return $e->die_event;
+
+ return $e->die_event unless
+ $e->allowed('UPDATE_HOLD', $patron->home_ou); # FIXME: Using permcrud perm listed in fm_IDL.xml for ahrn. Probably want something more specific
+
+ $e->create_action_hold_request_note($note) or return $e->die_event;
+ $e->commit;
+ return $note->id;
+}
__PACKAGE__->register_method(
method => 'reset_hold',
'FM_ACPN_DELETE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_note.delete', 'secure' : false },
'FM_ACTSC_RETRIEVE_BATCH' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.batch', 'secure' : false },
'FM_ACTSC_RETRIEVE_VIA_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.all', 'secure' : false },
+ 'FM_AHRN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_note.create' },
'FM_AHN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.create' },
'FM_AHN_RETRIEVE_VIA_AHR' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.retrieve_by_hold' },
'FM_AHN_RETRIEVE_VIA_AHR.authoritative' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.retrieve_by_hold.authoritative' },
note.pub( get_bool( fancy_prompt_data.pub ) ? get_db_true() : get_db_false() );
note.slip( get_bool( fancy_prompt_data.slip ) ? get_db_true() : get_db_false() );
note.staff( true );
- //var r = g.network.simple_request('FM_AHN_CREATE',[ ses(), notification ]); if (typeof r.ilsevent != 'undefined') throw(r);
- g.pcrud.create(note);
+ var r = g.network.simple_request('FM_AHRN_CREATE',[ ses(), note ]); if (typeof r.ilsevent != 'undefined') throw(r);
+ //g.pcrud.create(note);
setTimeout(function(){fetch_and_render_all();},0);
}
} catch(E) {