3 #attention fichier pour notices MARC21
21 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
23 template_name => "catalogue/recentacquisitions.tmpl",
27 flagsrequired => {catalogue => 1},
32 my $op = $query->param('op') || '';
33 if ($op eq "show_list"){
35 my $datebegin = C4::Dates->new($query->param('datebegin'));
36 my $dateend = C4::Dates->new($query->param('dateend')) if ($query->param('dateend'));
38 my $orderby = $query->param('orderby') if ($query->param('orderby'));
39 my $criteria = $query->param('criteria');
40 my @itemtypes = $query->param('itemtypes');
43 my $loopacquisitions = SearchAcquisitions($datebegin, $dateend, \@itemtypes,
46 $template->param(loopacquisitions=>$loopacquisitions,
49 my $period = C4::Context->preference("recentacquisitionregularPeriod")||30;
50 my $dateend = C4::Dates->new();
51 #warn " dateend :".$dateend->output("syspref");
52 my @dateend = Date::Calc::Today;
53 my @datebegin = Date::Calc::Add_Delta_Days(@dateend,-$period) if ($period);
54 my $datebegin = C4::Dates->new(sprintf("%04d-%02d-%02d",@datebegin[0..2]),'iso');
55 #warn 'datebegin :'.$datebegin->output("syspref")." dateend :".$dateend->output("syspref");
56 my $itemtypes = GetItemTypes;
61 my $imgdir = getitemtypeimagesrc();
63 foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
64 my %row =( number=>$cnt++,
65 imageurl=> $itemtypes->{$thisitemtype}->{'imageurl'}?($imgdir."/".$itemtypes->{$thisitemtype}->{'imageurl'}):"",
66 code => $thisitemtype,
67 selected => $selected,
68 description => $itemtypes->{$thisitemtype}->{'description'},
71 $selected = 0 if ($selected) ;
72 push @itemtypesloop, \%row;
75 $template->param(datebegin => $datebegin->output("syspref"),
76 dateend => $dateend->output("syspref"),);
77 $template->param(period => $period,
78 itemtypeloop => \@itemtypesloop,
79 DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
83 output_html_with_http_headers $query, $cookie, $template->output;