3 #attention fichier pour notices MARC21
21 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
23 template_name => "opac-recentacquisitions.tmpl",
32 die() unless C4::Context->preference("OpacRecentAcquisitions");
34 my $op = $query->param('op') || '';
35 if ($op eq "show_list"){
37 my $datebegin = C4::Dates->new($query->param('datebegin'));
38 my $dateend = C4::Dates->new($query->param('dateend')) if ($query->param('dateend'));
40 my $orderby = $query->param('orderby') if ($query->param('orderby'));
41 my $criteria = $query->param('criteria');
42 my @itemtypes = $query->param('itemtypes');
45 my $loopacquisitions = SearchAcquisitions($datebegin, $dateend, \@itemtypes,
48 $template->param(loopacquisitions=>$loopacquisitions,
51 my $period = C4::Context->preference("recentacquisitionregularPeriod")||30;
52 my $dateend = C4::Dates->new();
53 #warn " dateend :".$dateend->output("syspref");
54 my @dateend = Date::Calc::Today;
55 my @datebegin = Date::Calc::Add_Delta_Days(@dateend,-$period) if ($period);
56 my $datebegin = C4::Dates->new(sprintf("%04d-%02d-%02d",@datebegin[0..2]),'iso');
57 #warn 'datebegin :'.$datebegin->output("syspref")." dateend :".$dateend->output("syspref");
58 my $itemtypes = GetItemTypes;
63 my $imgdir = getitemtypeimagesrc();
65 foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
66 my %row =( number=>$cnt++,
67 imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
68 code => $thisitemtype,
69 selected => $selected,
70 description => $itemtypes->{$thisitemtype}->{'description'},
73 $selected = 0 if ($selected) ;
74 push @itemtypesloop, \%row;
77 $template->param(datebegin => $datebegin->output("syspref"),
78 dateend => $dateend->output("syspref"),);
79 $template->param(period => $period,
80 itemtypeloop => \@itemtypesloop,
81 DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
85 output_html_with_http_headers $query, $cookie, $template->output;