CBARCODE => 'CONC4000036'
};
-# Because this may run multiple times, without a DB reload, we search
-# for the workstation before registering it. Takes an authtoken, the
-# id of the workstation lib, and the name of the workstation.
-sub find_workstation {
- my ($authtoken, $lib, $workstation) = @_;
- my $r = $apputils->simplereq(
- 'open-ils.actor',
- 'open-ils.actor.workstation.list',
- $authtoken,
- $lib
- );
- if ($r->{$lib}) {
- return scalar(grep {$_->name() eq $workstation} @{$r->{$lib}});
- }
- return 0;
-}
-
# Store authtokens
my @authtoken = ();
});
# Register workstation at BR1.
-unless (find_workstation($authtoken[0], BR1_ID, BR1_WORKSTATION)) {
+unless ($script->find_workstation(BR1_WORKSTATION, BR1_ID)) {
$script->register_workstation(BR1_WORKSTATION, BR1_ID);
}
});
# Register workstation at BR3.
-unless (find_workstation($authtoken[1], BR3_ID, BR3_WORKSTATION)) {
+unless ($script->find_workstation(BR3_WORKSTATION, BR3_ID)) {
$script->register_workstation(BR3_WORKSTATION, BR3_ID);
}