View | Details | Raw Unified | Return to bug 2553
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tmpl (+4 lines)
Lines 42-48 Link Here
42
        <th>Notes</th>
42
        <th>Notes</th>
43
    </tr>
43
    </tr>
44
     <!-- TMPL_LOOP NAME="itemsloop"-->
44
     <!-- TMPL_LOOP NAME="itemsloop"-->
45
        <!-- TMPL_UNLESS NAME="__odd__" -->
46
        <tr class="highlight">
47
        <!-- TMPL_ELSE -->
45
        <tr>
48
        <tr>
49
        <!-- /TMPL_UNLESS -->
46
            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->" title="<!-- TMPL_VAR NAME="itemnotes"-->">
50
            <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->" title="<!-- TMPL_VAR NAME="itemnotes"-->">
47
						  <!-- TMPL_VAR NAME="title" escape="html" -->
51
						  <!-- TMPL_VAR NAME="title" escape="html" -->
48
					 </a></td>
52
					 </a></td>
(-)a/reports/itemslost.pl (-15 / +10 lines)
Lines 23-28 This script displays lost items. Link Here
23
=cut
23
=cut
24
24
25
use strict;
25
use strict;
26
use warnings;
27
26
use CGI;
28
use CGI;
27
use C4::Auth;
29
use C4::Auth;
28
use C4::Output;
30
use C4::Output;
Lines 30-35 use C4::Biblio; Link Here
30
use C4::Items;
32
use C4::Items;
31
use C4::Koha;                  # GetItemTypes
33
use C4::Koha;                  # GetItemTypes
32
use C4::Branch; # GetBranches
34
use C4::Branch; # GetBranches
35
use C4::Dates qw/format_date/;
33
36
34
my $query = new CGI;
37
my $query = new CGI;
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 62-67 if ( $get_items ) { Link Here
62
    $where{$itype}            = $itemtypesfilter if defined $itemtypesfilter;
65
    $where{$itype}            = $itemtypesfilter if defined $itemtypesfilter;
63
66
64
    my $items = GetLostItems( \%where, $orderbyfilter ); 
67
    my $items = GetLostItems( \%where, $orderbyfilter ); 
68
    foreach my $it (@$items) {
69
        $it->{'datelastseen'} = format_date($it->{'datelastseen'});
70
    }
65
    $template->param(
71
    $template->param(
66
                     total       => scalar @$items,
72
                     total       => scalar @$items,
67
                     itemsloop   => $items,
73
                     itemsloop   => $items,
Lines 71-93 if ( $get_items ) { Link Here
71
}
77
}
72
78
73
# getting all branches.
79
# getting all branches.
74
my $branches = GetBranches;
80
#my $branches = GetBranches;
75
my $branch   = C4::Context->userenv->{"branchname"};
81
#my $branch   = C4::Context->userenv->{"branchname"};
76
my @branchloop;
77
foreach my $thisbranch ( keys %$branches ) {
78
    my $selected = 1 if $thisbranch eq $branch;
79
    my %row = (
80
        value      => $thisbranch,
81
        selected   => $selected,
82
        branchname => $branches->{$thisbranch}->{'branchname'},
83
    );
84
    push @branchloop, \%row;
85
}
86
82
87
# getting all itemtypes
83
# getting all itemtypes
88
my $itemtypes = &GetItemTypes();
84
my $itemtypes = &GetItemTypes();
89
my @itemtypesloop;
85
my @itemtypesloop;
90
foreach my $thisitemtype ( sort keys %$itemtypes ) {
86
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{description}} keys %$itemtypes ) {
91
    my %row = (
87
    my %row = (
92
        value       => $thisitemtype,
88
        value       => $thisitemtype,
93
        description => $itemtypes->{$thisitemtype}->{'description'},
89
        description => $itemtypes->{$thisitemtype}->{'description'},
Lines 98-104 foreach my $thisitemtype ( sort keys %$itemtypes ) { Link Here
98
# get lost statuses
94
# get lost statuses
99
my $lost_status_loop = C4::Koha::GetAuthorisedValues( 'LOST' );
95
my $lost_status_loop = C4::Koha::GetAuthorisedValues( 'LOST' );
100
96
101
$template->param( branchloop     => \@branchloop,
97
$template->param( branchloop     => GetBranchesLoop(C4::Context->userenv->{'branch'}),
102
                  itemtypeloop   => \@itemtypesloop,
98
                  itemtypeloop   => \@itemtypesloop,
103
                  loststatusloop => $lost_status_loop,
99
                  loststatusloop => $lost_status_loop,
104
);
100
);
105
- 

Return to bug 2553