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

(-)a/C4/Auth.pm (-1 lines)
Lines 475-481 sub get_template_and_user { Link Here
475
            OPACShelfBrowser                      => "" . C4::Context->preference("OPACShelfBrowser"),
475
            OPACShelfBrowser                      => "" . C4::Context->preference("OPACShelfBrowser"),
476
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
476
            OPACURLOpenInNewWindow                => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
477
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
477
            OPACUserCSS                           => "" . C4::Context->preference("OPACUserCSS"),
478
            OPACViewOthersSuggestions             => "" . C4::Context->preference("OPACViewOthersSuggestions"),
479
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
478
            OpacAuthorities                       => C4::Context->preference("OpacAuthorities"),
480
            OPACBaseURL                           => ( $using_https ? "https://" : "http://" ) . $opac_base_url,
479
            OPACBaseURL                           => ( $using_https ? "https://" : "http://" ) . $opac_base_url,
481
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
480
            opac_css_override                     => $ENV{'OPAC_CSS_OVERRIDE'},
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-4 / +4 lines)
Lines 92-98 Link Here
92
                                    </ol>
92
                                    </ol>
93
                                </fieldset>
93
                                </fieldset>
94
                                <fieldset class="action">
94
                                <fieldset class="action">
95
                                    <input type="hidden" name="suggestedby" value="[% suggestedbyme %]" />
95
                                    <input type="hidden" name="suggestedby" value="[% suggestedby %]" />
96
                                    <input type="hidden" name="op" value="add_confirm" />
96
                                    <input type="hidden" name="op" value="add_confirm" />
97
                                    <input type="submit" onclick="Check(this.form); return false;" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
97
                                    <input type="submit" onclick="Check(this.form); return false;" class="btn" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a>
98
                                </fieldset>
98
                                </fieldset>
Lines 124-131 Link Here
124
                                            <label for="suggestedby">Suggested by:</label>
124
                                            <label for="suggestedby">Suggested by:</label>
125
                                            <div class="input-append">
125
                                            <div class="input-append">
126
                                                <select name="suggestedby" id="suggestedby">
126
                                                <select name="suggestedby" id="suggestedby">
127
                                                    <option value="0">Anyone</option>
127
                                                    <option value="suggested_by_anyone">Anyone</option>
128
                                                    <option value="1">Me</option>
128
                                                    <option value="suggested_by_me">Me</option>
129
                                                </select>
129
                                                </select>
130
                                                <button type="submit" class="btn">Go</button>
130
                                                <button type="submit" class="btn">Go</button>
131
                                            </div>
131
                                            </div>
Lines 269-275 Link Here
269
                [% IF ( loggedinusername ) %]null,[% END %]
269
                [% IF ( loggedinusername ) %]null,[% END %]
270
                { "sType": "anti-the" },
270
                { "sType": "anti-the" },
271
                null,
271
                null,
272
                [% IF ( OPACViewOthersSuggestions ) %]null,[% END %]
272
                [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %]null,[% END %]
273
                [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
273
                [% IF Koha.Preference( 'OpacSuggestionManagedBy' ) %]null,[% END %]
274
                null
274
                null
275
            ]
275
            ]
(-)a/opac/opac-suggestions.pl (-13 / +9 lines)
Lines 33-39 use C4::Scrubber; Link Here
33
use Koha::DateUtils qw( dt_from_string );
33
use Koha::DateUtils qw( dt_from_string );
34
34
35
my $input           = new CGI;
35
my $input           = new CGI;
36
my $allsuggestions  = $input->param('showall');
37
my $op              = $input->param('op');
36
my $op              = $input->param('op');
38
my $suggestion      = $input->Vars;
37
my $suggestion      = $input->Vars;
39
delete $suggestion->{negcap};
38
delete $suggestion->{negcap};
Lines 51-58 if ( ! C4::Context->preference('suggestion') ) { Link Here
51
    exit;
50
    exit;
52
}
51
}
53
52
54
delete $$suggestion{$_} foreach qw<op suggestedbyme>;
53
delete $suggestion->{op};
55
$op = 'else' unless $op;
54
$op = 'else' unless $op;
55
$suggestion->{suggestedby} //= 'suggested_by_anyone';
56
56
57
my ( $template, $borrowernumber, $cookie );
57
my ( $template, $borrowernumber, $cookie );
58
my $deleted = $input->param('deleted');
58
my $deleted = $input->param('deleted');
Lines 67-75 if ( C4::Context->preference("AnonSuggestions") ) { Link Here
67
            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
67
            authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
68
        }
68
        }
69
    );
69
    );
70
    if ( !$$suggestion{suggestedby} ) {
71
        $$suggestion{suggestedby} = C4::Context->preference("AnonymousPatron");
72
    }
73
}
70
}
74
else {
71
else {
75
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
72
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Lines 81-93 else { Link Here
81
        }
78
        }
82
    );
79
    );
83
}
80
}
84
if ($allsuggestions){
81
85
	delete $$suggestion{suggestedby};
82
if (  C4::Context->preference("AnonSuggestions") and C4::Context->preference("AnonymousPatron") ) {
86
}
83
    $suggestion->{suggestedby} = C4::Context->preference("AnonymousPatron");
87
else {
84
} elsif ( C4::Context->preference("OPACViewOthersSuggestions") and $suggestion->{suggestedby} eq 'suggested_by_anyone' ) {
88
	$$suggestion{suggestedby} ||= $borrowernumber unless ($allsuggestions);
85
    delete $suggestion->{suggestedby};
86
} else {
87
    $suggestion->{suggestedby} = $borrowernumber;
89
}
88
}
90
# warn "bornum:",$borrowernumber;
91
89
92
my $suggestions_loop =
90
my $suggestions_loop =
93
  &SearchSuggestion( $suggestion);
91
  &SearchSuggestion( $suggestion);
Lines 169-175 $template->param( Link Here
169
	itemtypeloop=> $supportlist,
167
	itemtypeloop=> $supportlist,
170
    suggestions_loop => $suggestions_loop,
168
    suggestions_loop => $suggestions_loop,
171
    patron_reason_loop => $patron_reason_loop,
169
    patron_reason_loop => $patron_reason_loop,
172
    showall    => $allsuggestions,
173
    "op_$op"         => 1,
170
    "op_$op"         => 1,
174
    suggestionsview => 1,
171
    suggestionsview => 1,
175
);
172
);
176
- 

Return to bug 4137