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

(-)a/circ/request-article.pl (-1 / +24 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
use C4::Output;
22
use C4::Output;
23
use C4::Auth;
23
use C4::Auth;
24
use C4::Utils::DataTables::Members;
24
use Koha::Biblios;
25
use Koha::Biblios;
25
use Koha::Borrowers;
26
use Koha::Borrowers;
26
use Koha::ArticleRequests;
27
use Koha::ArticleRequests;
Lines 39-47 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( Link Here
39
40
40
my $biblionumber      = $input->param('biblionumber');
41
my $biblionumber      = $input->param('biblionumber');
41
my $patron_cardnumber = $input->param('patron_cardnumber');
42
my $patron_cardnumber = $input->param('patron_cardnumber');
43
my $patron_id         = $input->param('patron_id');
42
44
43
my $biblio = Koha::Biblios->find($biblionumber);
45
my $biblio = Koha::Biblios->find($biblionumber);
44
my $patron = $patron_cardnumber ? Koha::Borrowers->find( { cardnumber => $patron_cardnumber } ) : undef;
46
my $patron = Koha::Borrowers->find( $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } );
47
48
if (!$patron && $patron_cardnumber) {
49
    my $results = C4::Utils::DataTables::Members::search(
50
        {
51
            searchmember => $patron_cardnumber,
52
            dt_params    => { iDisplayLength => -1 },
53
        }
54
    );
55
56
    my $patrons = $results->{patrons};
57
58
    if ( scalar @$patrons == 1 ) {
59
        $patron = Koha::Borrowers->find( $patrons->[0]->{borrowernumber} );
60
    }
61
    elsif (@$patrons) {
62
        $template->param( patrons => $patrons );
63
    }
64
    else {
65
        $template->param( no_patrons_found => $patron_cardnumber );
66
    }
67
}
45
68
46
$template->param(
69
$template->param(
47
    biblio => $biblio,
70
    biblio => $biblio,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt (-3 / +37 lines)
Lines 112-119 $(document).ready(function() { Link Here
112
                <div class="yui-b">
112
                <div class="yui-b">
113
113
114
                    <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
114
                    <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
115
115
                    [% IF no_patrons_found %]
116
                    [% UNLESS patron %]
116
                        <div class="dialog alert">
117
                            <h3>Patron not found</h3>
118
                            <p>No patron with this name, please, try another</p>
119
                        </div>
120
                    [% ELSIF patrons %]
121
                        <form id="article_request_patron_results" method="post">
122
                            <fieldset>
123
                                <table id="table_borrowers">
124
                                    <thead>
125
                                        <tr>
126
                                            <th></th>
127
                                            <th>Name</th>
128
                                            <th>Cardnumber</th>
129
                                            <th>Category</th>
130
                                            <th>Library</th>
131
                                            <th>Address</th>
132
                                        </tr>
133
                                    </thead>
134
                                    <tbody>
135
                                        [% FOREACH patron IN patrons %]
136
                                            <tr>
137
                                                <td><input type="radio" name="patron_id" value="[% patron.borrowernumber %]"/></td>
138
                                                <td>[% patron.surname %], [% patron.firstname %]</td>
139
                                                <td>[% patron.cardnumber %]</td>
140
                                                <td>[% patron.categorycode %]</td>
141
                                                <td>[% patron.branchcode %]</td>
142
                                                <td>[% patron.address %]</td>
143
                                            </tr>
144
                                        [% END %]
145
                                    </tbody>
146
                                </table>
147
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
148
                                <fieldset class="action"><input type="submit" value="Select" /></fieldset>
149
                            </fieldset>
150
                        </form>
151
                    [% ELSIF !patron %]
117
                        <form id="article_requests_patronsearch" action="request-article.pl" method="post">
152
                        <form id="article_requests_patronsearch" action="request-article.pl" method="post">
118
                            <fieldset class="brief">
153
                            <fieldset class="brief">
119
                                <label for="patron">Patron: </label>
154
                                <label for="patron">Patron: </label>
120
- 

Return to bug 14610