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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-10 / +3 lines)
Lines 216-224 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
216
        <li><span class="label">Publication place:</span>[% place |html %]</li>
216
        <li><span class="label">Publication place:</span>[% place |html %]</li>
217
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
217
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
218
        <li><span class="label">Document type:</span>
218
        <li><span class="label">Document type:</span>
219
            [% FOREACH itemtypeloo IN itemtypeloop %]
219
            [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) %]
220
                [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
221
            [% END %]
222
        </li>
220
        </li>
223
        [% IF ( patron_reason_loop ) %]
221
        [% IF ( patron_reason_loop ) %]
224
          <li><span class="label">Reason for suggestion: </span>
222
          <li><span class="label">Reason for suggestion: </span>
Lines 339-350 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
339
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
337
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
340
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
338
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
341
        <li><label for="itemtype">Document type:</label>
339
        <li><label for="itemtype">Document type:</label>
342
            <select id="itemtype" name="itemtype" >
340
            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
343
            [% FOREACH itemtypeloo IN itemtypeloop %]
344
                [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %]
345
                [% itemtypeloo.description %]</option>
346
            [% END %]
347
            </select>
348
        </li>
341
        </li>
349
        [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
342
        [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %]
350
                [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %]
343
                [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %]
Lines 513-519 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
513
                    <br />
506
                    <br />
514
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
507
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
515
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
508
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
516
                        [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% suggestions_loo.itemtype |html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %]
509
                        [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %]
517
                </td>
510
                </td>
518
                <td>
511
                <td>
519
                    [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
512
                    [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-13 / +2 lines)
Lines 42-59 Link Here
42
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
42
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
43
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
43
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
44
                                        <li><label for="itemtype">Item type:</label>
44
                                        <li><label for="itemtype">Item type:</label>
45
                                            <select name="itemtype" id="itemtype">
45
                                            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
46
                                                <option value="">Default</option>
47
                                                [% FOREACH itemtypeloo IN itemtypeloop %]
48
                                                    [% IF ( itemtypeloo.selected ) %]
49
                                                        <option value="[% itemtypeloo.itemtype %]" selected="selected">
50
                                                    [% ELSE %]
51
                                                        <option value="[% itemtypeloo.itemtype %]">
52
                                                    [% END %]
53
                                                            [% itemtypeloo.description %]
54
                                                        </option>
55
                                                [% END %]
56
                                            </select>
57
                                        </li>
46
                                        </li>
58
                                        [% IF ( branchloop ) %]
47
                                        [% IF ( branchloop ) %]
59
                                            <li><label for="branch">Library:</label>
48
                                            <li><label for="branch">Library:</label>
Lines 176-182 Link Here
176
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
165
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
177
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
166
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
178
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
167
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
179
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
168
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
180
                                                        </p>
169
                                                        </p>
181
                                                    </td>
170
                                                    </td>
182
                                                    <td>
171
                                                    <td>
(-)a/opac/opac-suggestions.pl (-10 lines)
Lines 125-139 if ( $op eq "delete_confirm" ) { Link Here
125
    exit;
125
    exit;
126
}
126
}
127
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
127
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
128
my $supportlist=GetSupportList();
129
foreach my $support(@$supportlist){
130
	if ($$support{'imageurl'}){
131
		$$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} );
132
	}
133
	else {
134
	   delete $$support{'imageurl'}
135
	}
136
}
137
128
138
foreach my $suggestion(@$suggestions_loop) {
129
foreach my $suggestion(@$suggestions_loop) {
139
    if($suggestion->{'suggestedby'} == $borrowernumber) {
130
    if($suggestion->{'suggestedby'} == $borrowernumber) {
Lines 166-172 if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { Link Here
166
157
167
$template->param(
158
$template->param(
168
	%$suggestion,
159
	%$suggestion,
169
	itemtypeloop=> $supportlist,
170
    suggestions_loop => $suggestions_loop,
160
    suggestions_loop => $suggestions_loop,
171
    patron_reason_loop => $patron_reason_loop,
161
    patron_reason_loop => $patron_reason_loop,
172
    showall    => $allsuggestions,
162
    showall    => $allsuggestions,
(-)a/suggestion/suggestion.pl (-20 / +4 lines)
Lines 54-67 sub Init{ Link Here
54
sub GetCriteriumDesc{
54
sub GetCriteriumDesc{
55
    my ($criteriumvalue,$displayby)=@_;
55
    my ($criteriumvalue,$displayby)=@_;
56
    if ($displayby =~ /status/i) {
56
    if ($displayby =~ /status/i) {
57
        if ( grep { /^($criteriumvalue)$/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) {
57
        unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) {
58
            return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue)));
58
            return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown";
59
        } else {
60
            return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue) || $criteriumvalue;
61
        }
59
        }
60
        return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
62
    }
61
    }
63
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
62
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
64
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
63
    return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/);
65
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
64
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
66
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
65
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
67
        return "" unless $borr;
66
        return "" unless $borr;
Lines 319-338 $branchfilter=C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter); Link Here
319
$template->param( branchloop => \@branchloop,
318
$template->param( branchloop => \@branchloop,
320
                branchfilter => $branchfilter);
319
                branchfilter => $branchfilter);
321
320
322
# the index parameter is different for item-level itemtypes
323
my $supportlist = GetSupportList();
324
325
foreach my $support (@$supportlist) {
326
    $$support{'selected'} = (defined $$suggestion_ref{'itemtype'})
327
        ? $$support{'itemtype'} eq $$suggestion_ref{'itemtype'}
328
        : 0;
329
    if ( $$support{'imageurl'} ) {
330
        $$support{'imageurl'} = getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
331
    } else {
332
        delete $$support{'imageurl'};
333
    }
334
}
335
$template->param(itemtypeloop=>$supportlist);
336
$template->param( returnsuggestedby => $returnsuggestedby );
321
$template->param( returnsuggestedby => $returnsuggestedby );
337
322
338
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
323
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
339
- 

Return to bug 9468