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 190-198 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
190
        <li><span class="label">Publication place:</span>[% place |html %]</li>
190
        <li><span class="label">Publication place:</span>[% place |html %]</li>
191
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
191
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
192
        <li><span class="label">Document type:</span>
192
        <li><span class="label">Document type:</span>
193
            [% FOREACH itemtypeloo IN itemtypeloop %]
193
            [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) %]
194
                [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
195
            [% END %]
196
        </li>
194
        </li>
197
        [% IF ( patron_reason_loop ) %]
195
        [% IF ( patron_reason_loop ) %]
198
          <li><span class="label">Reason for suggestion: </span>
196
          <li><span class="label">Reason for suggestion: </span>
Lines 313-324 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
313
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
311
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place %]"/></li>
314
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
312
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle %]"/></li>
315
        <li><label for="itemtype">Document type:</label>
313
        <li><label for="itemtype">Document type:</label>
316
            <select id="itemtype" name="itemtype" >
314
            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
317
            [% FOREACH itemtypeloo IN itemtypeloop %]
318
                [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %]
319
                [% itemtypeloo.description %]</option>
320
            [% END %]
321
            </select>
322
        </li>
315
        </li>
323
        [% 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 %]
316
        [% 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 %]
324
                [% 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 %]
317
                [% 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 487-493 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
487
                    <br />
480
                    <br />
488
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
481
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
489
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
482
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
490
                        [% 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 %]
483
                        [% 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 %]
491
                </td>
484
                </td>
492
                <td>
485
                <td>
493
                    [% 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 %]
486
                    [% 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 / +3 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AuthorisedValues %]
2
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
3
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
3
[% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
4
[% IF ( op_add ) %]Enter a new purchase suggestion[% END %]
4
[% IF ( op_else ) %]Purchase Suggestions[% END %]
5
[% IF ( op_else ) %]Purchase Suggestions[% END %]
Lines 41-58 Link Here
41
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle"  maxlength="80" /></li>
42
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle"  maxlength="80" /></li>
42
                                        <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>
43
                                        <li><label for="itemtype">Item type:</label>
44
                                        <li><label for="itemtype">Item type:</label>
44
                                            <select name="itemtype" id="itemtype">
45
                                            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
45
                                                <option value="">Default</option>
46
                                                [% FOREACH itemtypeloo IN itemtypeloop %]
47
                                                    [% IF ( itemtypeloo.selected ) %]
48
                                                        <option value="[% itemtypeloo.itemtype %]" selected="selected">
49
                                                    [% ELSE %]
50
                                                        <option value="[% itemtypeloo.itemtype %]">
51
                                                    [% END %]
52
                                                            [% itemtypeloo.description %]
53
                                                        </option>
54
                                                [% END %]
55
                                            </select>
56
                                        </li>
46
                                        </li>
57
                                        [% IF ( branchloop ) %]
47
                                        [% IF ( branchloop ) %]
58
                                            <li><label for="branch">Library:</label>
48
                                            <li><label for="branch">Library:</label>
Lines 169-175 Link Here
169
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
159
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
170
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
160
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
171
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
161
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
172
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
162
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
173
                                                        </p>
163
                                                        </p>
174
                                                    </td>
164
                                                    </td>
175
                                                    <td>
165
                                                    <td>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt (-7 / +4 lines)
Lines 101-112 Link Here
101
    <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
101
    <li><label for="publishercode">Publisher:</label><input type="text" id="publishercode" name="publishercode" size="50" maxlength="80" /></li>
102
    <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
102
    <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" /></li>
103
    <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
103
    <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" /></li>
104
    <li><label for="itemtype">Item type:</label><select name="itemtype" id="itemtype">
104
    <li><label for="itemtype">Item type:</label>
105
            <option value="">Default</option>
105
        [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
106
        [% FOREACH itemtypeloo IN itemtypeloop %]
106
    </li>
107
			[% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
108
        [% END %]
109
        </select> </li>
110
    [% IF ( branchloop ) %]
107
    [% IF ( branchloop ) %]
111
    <li><label for="branch">Library:</label>
108
    <li><label for="branch">Library:</label>
112
        <select name="branch" id="branch">
109
        <select name="branch" id="branch">
Lines 194-200 Link Here
194
                        [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
191
                        [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
195
                        [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
192
                        [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
196
                        [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html%][% END %]
193
                        [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html%][% END %]
197
                        [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
194
                        [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
198
                    </p>
195
                    </p>
199
                </td>
196
                </td>
200
                <td>
197
                <td>
(-)a/opac/opac-suggestions.pl (-10 lines)
Lines 106-120 if ( $op eq "delete_confirm" ) { Link Here
106
    exit;
106
    exit;
107
}
107
}
108
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
108
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
109
my $supportlist=GetSupportList();
110
foreach my $support(@$supportlist){
111
	if ($$support{'imageurl'}){
112
		$$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} );
113
	}
114
	else {
115
	   delete $$support{'imageurl'}
116
	}
117
}
118
109
119
foreach my $suggestion(@$suggestions_loop) {
110
foreach my $suggestion(@$suggestions_loop) {
120
    if($suggestion->{'suggestedby'} == $borrowernumber) {
111
    if($suggestion->{'suggestedby'} == $borrowernumber) {
Lines 147-153 if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { Link Here
147
138
148
$template->param(
139
$template->param(
149
	%$suggestion,
140
	%$suggestion,
150
	itemtypeloop=> $supportlist,
151
    suggestions_loop => $suggestions_loop,
141
    suggestions_loop => $suggestions_loop,
152
    patron_reason_loop => $patron_reason_loop,
142
    patron_reason_loop => $patron_reason_loop,
153
    showall    => $allsuggestions,
143
    showall    => $allsuggestions,
(-)a/suggestion/suggestion.pl (-19 / +6 lines)
Lines 58-69 sub Init{ Link Here
58
58
59
sub GetCriteriumDesc{
59
sub GetCriteriumDesc{
60
    my ($criteriumvalue,$displayby)=@_;
60
    my ($criteriumvalue,$displayby)=@_;
61
    unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED) ) {
61
    if ($displayby =~ /status/i) {
62
        return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown";
62
        unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED) ) {
63
            return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown";
64
        }
65
        return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
63
    }
66
    }
64
    return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i);
65
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
67
    return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/);
66
    return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/);
68
    return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/);
67
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
69
    if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){
68
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
70
        my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
69
        return "" unless $borr;
71
        return "" unless $borr;
Lines 309-328 $branchfilter=C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter); Link Here
309
$template->param( branchloop => \@branchloop,
311
$template->param( branchloop => \@branchloop,
310
                branchfilter => $branchfilter);
312
                branchfilter => $branchfilter);
311
313
312
# the index parameter is different for item-level itemtypes
313
my $supportlist = GetSupportList();
314
315
foreach my $support (@$supportlist) {
316
    $$support{'selected'} = (defined $$suggestion_ref{'itemtype'})
317
        ? $$support{'itemtype'} eq $$suggestion_ref{'itemtype'}
318
        : 0;
319
    if ( $$support{'imageurl'} ) {
320
        $$support{'imageurl'} = getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
321
    } else {
322
        delete $$support{'imageurl'};
323
    }
324
}
325
$template->param(itemtypeloop=>$supportlist);
326
$template->param( returnsuggestedby => $returnsuggestedby );
314
$template->param( returnsuggestedby => $returnsuggestedby );
327
315
328
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
316
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
329
- 

Return to bug 9468