<field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
<field reporter:label="Patron" name="patron" reporter:datatype="link"/>
<field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
+ <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
</fields>
<links>
<link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
use strict; use warnings;
use OpenSRF::EX qw(:try);
use Data::Dumper;
+use DateTime;
+use DateTime::Format::ISO8601;
+use OpenSRF::Utils qw/:datetime/;
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Application::AppUtils;
use OpenILS::Utils::Fieldmapper;
$Data::Dumper::Indent = 0;
my $U = "OpenILS::Application::AppUtils";
+my $_dt_parser = DateTime::Format::ISO8601->new;
# returns ( $newid, $evt ). If $evt, then there was an error
/
);
+
sub fetch_noncat {
my( $self, $conn, $auth, $circid ) = @_;
my $e = OpenILS::Utils::Editor->new( authtoken => $auth );
if( $c->patron ne $e->requestor->id ) {
return $e->event unless $e->allowed('VIEW_CIRCULATIONS'); # XXX rely on editor perm
}
+
+ my $otype = $e->retrieve_config_non_cataloged_type($c->item_type)
+ or return $e->die_event;
+
+ my $duedate = $_dt_parser->parse_datetime( clense_ISO8601($c->circ_time) );
+ $duedate = $duedate
+ ->add( seconds => interval_to_seconds($otype->circ_duration) )
+ ->strftime('%FT%T%z');
+
+ my $offset = $e->request(
+ 'open-ils.storage.actor.org_unit.closed_date.overlap',
+ $c->circ_lib,
+ $duedate
+ );
+
+ $duedate = $offset->{end} if ($offset);
+ $c->duedate($duedate);
+
return $c;
}