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 213-221 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
213
        <li><span class="label">Publication place:</span>[% place |html %]</li>
213
        <li><span class="label">Publication place:</span>[% place |html %]</li>
214
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
214
        <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li>
215
        <li><span class="label">Document type:</span>
215
        <li><span class="label">Document type:</span>
216
            [% FOREACH itemtypeloo IN itemtypeloop %]
216
            [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) %]
217
                [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
218
            [% END %]
219
        </li>
217
        </li>
220
        [% IF ( patron_reason_loop ) %]
218
        [% IF ( patron_reason_loop ) %]
221
          <li><span class="label">Reason for suggestion: </span>
219
          <li><span class="label">Reason for suggestion: </span>
Lines 336-347 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
336
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
334
        <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li>
337
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
335
        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li>
338
        <li><label for="itemtype">Document type:</label>
336
        <li><label for="itemtype">Document type:</label>
339
            <select id="itemtype" name="itemtype" >
337
            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %]
340
            [% FOREACH itemtypeloo IN itemtypeloop %]
341
                [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %]
342
                [% itemtypeloo.description %]</option>
343
            [% END %]
344
            </select>
345
        </li>
338
        </li>
346
        [% 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 %]
339
        [% 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 %]
347
                [% 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 %]
340
                [% 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 526-532 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
526
                    <br />
519
                    <br />
527
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
520
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate |html %] [% END %]
528
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
521
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %]
529
                        [% 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 %]
522
                        [% 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 %]
530
                </td>
523
                </td>
531
                <td>
524
                <td>
532
                    [% 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.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby %])[% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
525
                    [% 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.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby %])[% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-13 / +2 lines)
Lines 43-60 Link Here
43
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
43
                                        <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li>
44
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
44
                                        <li><label for="place">Publication place:</label><input type="text" id="place" name="place"  maxlength="80" /></li>
45
                                        <li><label for="itemtype">Item type:</label>
45
                                        <li><label for="itemtype">Item type:</label>
46
                                            <select name="itemtype" id="itemtype">
46
                                            [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %]
47
                                                <option value="">Default</option>
48
                                                [% FOREACH itemtypeloo IN itemtypeloop %]
49
                                                    [% IF ( itemtypeloo.selected ) %]
50
                                                        <option value="[% itemtypeloo.itemtype %]" selected="selected">
51
                                                    [% ELSE %]
52
                                                        <option value="[% itemtypeloo.itemtype %]">
53
                                                    [% END %]
54
                                                            [% itemtypeloo.description %]
55
                                                        </option>
56
                                                [% END %]
57
                                            </select>
58
                                        </li>
47
                                        </li>
59
                                        [% IF ( branchloop ) %]
48
                                        [% IF ( branchloop ) %]
60
                                            <li><label for="branch">Library:</label>
49
                                            <li><label for="branch">Library:</label>
Lines 195-201 Link Here
195
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
184
                                                                [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %]
196
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
185
                                                                [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %]
197
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
186
                                                                [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %]
198
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %]
187
                                                                [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %]
199
                                                        </p>
188
                                                        </p>
200
                                                    </td>
189
                                                    </td>
201
                                                    <td>
190
                                                    <td>
(-)a/opac/opac-suggestions.pl (-10 lines)
Lines 148-162 if ( $op eq "delete_confirm" ) { Link Here
148
    exit;
148
    exit;
149
}
149
}
150
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
150
map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop;
151
my $supportlist=GetSupportList();
152
foreach my $support(@$supportlist){
153
	if ($$support{'imageurl'}){
154
		$$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} );
155
	}
156
	else {
157
	   delete $$support{'imageurl'}
158
	}
159
}
160
151
161
foreach my $suggestion(@$suggestions_loop) {
152
foreach my $suggestion(@$suggestions_loop) {
162
    if($suggestion->{'suggestedby'} == $borrowernumber) {
153
    if($suggestion->{'suggestedby'} == $borrowernumber) {
Lines 189-195 if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { Link Here
189
180
190
$template->param(
181
$template->param(
191
	%$suggestion,
182
	%$suggestion,
192
	itemtypeloop=> $supportlist,
193
    suggestions_loop => $suggestions_loop,
183
    suggestions_loop => $suggestions_loop,
194
    patron_reason_loop => $patron_reason_loop,
184
    patron_reason_loop => $patron_reason_loop,
195
    "op_$op"         => 1,
185
    "op_$op"         => 1,
(-)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 324-343 $branchfilter=C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter); Link Here
324
$template->param( branchloop => \@branchloop,
323
$template->param( branchloop => \@branchloop,
325
                branchfilter => $branchfilter);
324
                branchfilter => $branchfilter);
326
325
327
# the index parameter is different for item-level itemtypes
328
my $supportlist = GetSupportList();
329
330
foreach my $support (@$supportlist) {
331
    $$support{'selected'} = (defined $$suggestion_ref{'itemtype'})
332
        ? $$support{'itemtype'} eq $$suggestion_ref{'itemtype'}
333
        : 0;
334
    if ( $$support{'imageurl'} ) {
335
        $$support{'imageurl'} = getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
336
    } else {
337
        delete $$support{'imageurl'};
338
    }
339
}
340
$template->param(itemtypeloop=>$supportlist);
341
$template->param( returnsuggestedby => $returnsuggestedby );
326
$template->param( returnsuggestedby => $returnsuggestedby );
342
327
343
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
328
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
344
- 

Return to bug 9468