}
);
+sub mark_unstaged {
+ my ($self, $conn, $authtoken, $appointment) = @_;
+ my $e = new_editor(xact => 1, authtoken => $authtoken);
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless $e->allowed("STAFF_LOGIN");
+
+ my $slot = $e->retrieve_action_curbside($appointment);
+ return undef unless ($slot);
+
+ $slot->clear_staged();
+ $slot->clear_stage_staff();
+ $e->update_action_curbside($slot) or return $e->die_event;
+ $e->commit;
+
+ return $e->retrieve_action_curbside($slot->id);
+}
+__PACKAGE__->register_method(
+ method => "mark_unstaged",
+ api_name => "open-ils.curbside.mark_unstaged",
+ signature => {
+ params => [
+ {type => 'string', desc => 'Authentication token'},
+ {type => 'number', desc => 'Appointment ID'},
+ ],
+ return => { desc => 'Appointment on success, nothing when no appointment found, '.
+ 'an ILS Event on permission error'}
+ }
+);
+
sub mark_arrived {
my ($self, $conn, $authtoken, $appointment) = @_;
my $e = new_editor(xact => 1, authtoken => $authtoken);
s.SUCCESS_CURBSIDE_MARK_ARRIVED = "[% l('Marked curbside appointment {{slot_id}} as patron arrived') %]";
s.NOTFOUND_CURBSIDE_MARK_ARRIVED = "[% l('Could not find curbside appointment {{slot_id}} to mark as patron arrived') %]";
s.FAILED_CURBSIDE_MARK_ARRIVED = "[% l('Failed to mark curbside appointment {{slot_id}} as patron arrived: {{evt_code}}') %]";
+ s.SUCCESS_CURBSIDE_MARK_UNSTAGED = "[% l('Marked curbside appointment {{slot_id}} back to to-be-staged') %]";
+ s.NOTFOUND_CURBSIDE_MARK_UNSTAGED = "[% l('Could not find curbside appointment {{slot_id}} to mark as to-be-staged') %]";
+ s.FAILED_CURBSIDE_MARK_UNSTAGED = "[% l('Failed to mark curbside appointment {{slot_id}} as to-be-staged: {{evt_code}}') %]";
s.SUCCESS_CURBSIDE_MARK_DELIVERED = "[% l('Marked curbside appointment {{slot_id}} as delivered') %]";
s.NOTFOUND_CURBSIDE_MARK_DELIVERED = "[% l('Could not find curbside appointment {{slot_id}} to mark as delivered') %]";
s.FAILED_CURBSIDE_MARK_DELIVERED = "[% l('Failed to mark curbside appointment {{slot_id}} as delivered: {{evt_code}}') %]";
</button>
</div>
</div>
+ <div class="row">
+ <div class="col-xs-12">
+ <button class="btn btn-sm btn-warning"
+ ng-disabled="col.handlers.wasHandled(item['slot_id'])"
+ ng-click="col.handlers.mark_unstaged(item['slot_id'])">
+ [% l('Set Back to To Be Staged') %]
+ </button>
+ </div>
+ </div>
</eg-grid-field>
</eg-grid>
</div>
$timeout(function() { $scope.refresh_staged() }, 500);
});
}
+ $scope.gridCellHandlers.mark_unstaged = function(id) {
+ egCurbsideCoreSvc.mark_unstaged(id).then(function(resp) {
+ if (evt = egCore.evt.parse(resp)) {
+ ngToast.danger(egCore.strings.$replace(
+ egCore.strings.FAILED_CURBSIDE_MARK_UNSTAGED,
+ { slot_id : id, evt_code : evt.code }
+ ));
+ return;
+ }
+ if (!angular.isDefined(resp)) {
+ ngToast.warning(egCore.strings.$replace(
+ egCore.strings.NOTFOUND_CURBSIDE_MARK_UNSTAGED,
+ { slot_id : id }
+ ));
+ return;
+ }
+ ngToast.success(egCore.strings.$replace(
+ egCore.strings.SUCCESS_CURBSIDE_MARK_UNSTAGED,
+ { slot_id : id }
+ ));
+ $scope.wasHandled[id] = true;
+ $timeout(function() { $scope.refresh_staged() }, 500);
+ });
+ }
$scope.gridCellHandlers.mark_delivered = function(id) {
egProgressDialog.open();
egCurbsideCoreSvc.mark_delivered(id).then(function(resp) {
slot_id
);
}
+ service.mark_unstaged = function(slot_id) {
+ return egCore.net.request(
+ 'open-ils.curbside',
+ 'open-ils.curbside.mark_unstaged',
+ egCore.auth.token(),
+ slot_id
+ );
+ }
service.mark_arrived = function(slot_id) {
return egCore.net.request(
'open-ils.curbside',