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

(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+4 lines)
Lines 215-217 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
215
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
215
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
216
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo');
216
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo');
217
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
217
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
218
219
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Mollom',0,'Turn ON Mollom antispam for anonimous suggestions - You MUST set MollomPublicKey and MollomPrivateKey if enabled','','YesNo');
220
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MollomPublicKey','','See:  http://mollom.com','','free');
221
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MollomPrivateKey','','See:  http://mollom.com','','free');
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 1965-1970 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
1965
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI','0','if ON, ILS-DI server is enabled',NULL,'YesNo');");
1965
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI','0','if ON, ILS-DI server is enabled',NULL,'YesNo');");
1966
    SetVersion ($DBversion);
1966
    SetVersion ($DBversion);
1967
}
1967
}
1968
1969
$DBversion = "3.01.00.039";
1970
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
1971
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Mollom',0,'Turn ON Mollom antispam for anonimous suggestions - You MUST set MollomPublicKey and MollomPrivateKey if enabled','','YesNo');");
1972
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MollomPublicKey','','See:  http://mollom.com','','free');");
1973
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MollomPrivateKey','','See:  http://mollom.com','','free');");
1974
    SetVersion ($DBversion);
1975
}
1976
1968
if (C4::Context->preference("Version") =~/3\.00/) {
1977
if (C4::Context->preference("Version") =~/3\.00/) {
1969
	warn "inside 3.00";
1978
	warn "inside 3.00";
1970
        my $perllibdir=C4::Context->config('intranetdir');
1979
        my $perllibdir=C4::Context->config('intranetdir');
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl (+1 lines)
Lines 73-78 $.tablesorter.addParser({ Link Here
73
73
74
<!-- TMPL_IF name="op_else" -->
74
<!-- TMPL_IF name="op_else" -->
75
    <h1><!-- TMPL_UNLESS NAME="OPACViewOthersSuggestions" --><!-- TMPL_IF NAME="loggedinusername" -->My <!-- /TMPL_IF --><!-- /TMPL_UNLESS -->Purchase Suggestions</h1>
75
    <h1><!-- TMPL_UNLESS NAME="OPACViewOthersSuggestions" --><!-- TMPL_IF NAME="loggedinusername" -->My <!-- /TMPL_IF --><!-- /TMPL_UNLESS -->Purchase Suggestions</h1>
76
    <!-- TMPL_IF NAME="spam" -->Sorry, your suggestion has been considered as spam. Please login to your account and try again.<!-- /TMPL_IF -->
76
    <!-- TMPL_IF NAME="suggestions_loop" -->
77
    <!-- TMPL_IF NAME="suggestions_loop" -->
77
    <!-- TMPL_IF NAME="OPACViewOthersSuggestions" -->
78
    <!-- TMPL_IF NAME="OPACViewOthersSuggestions" -->
78
	<form action="/cgi-bin/koha/opac-suggestions.pl" method="get">
79
	<form action="/cgi-bin/koha/opac-suggestions.pl" method="get">
(-)a/opac/opac-suggestions.pl (-4 / +30 lines)
Lines 23-28 use C4::Auth; # get_template_and_user Link Here
23
use C4::Branch;
23
use C4::Branch;
24
use C4::Output;
24
use C4::Output;
25
use C4::Suggestions;
25
use C4::Suggestions;
26
use Net::Mollom;
26
27
27
my $input           = new CGI;
28
my $input           = new CGI;
28
my $title           = $input->param('title');
29
my $title           = $input->param('title');
Lines 67-79 else { Link Here
67
    );
68
    );
68
}
69
}
69
70
70
if ( $op eq "add_confirm" ) {
71
sub create_suggestion {
71
    &NewSuggestion(
72
    &NewSuggestion(
72
        $borrowernumber, $title,         $author,     $publishercode,
73
        $borrowernumber, $title,         $author,     $publishercode,
73
        $note,           $copyrightdate, $volumedesc, $publicationyear,
74
        $note,           $copyrightdate, $volumedesc, $publicationyear,
74
        $place,          $isbn,          ''
75
        $place,          $isbn,          ''
75
    );
76
    );
76
77
    # empty fields, to avoid filter in "SearchSuggestion"
77
    # empty fields, to avoid filter in "SearchSuggestion"
78
    $title           = '';
78
    $title           = '';
79
    $author          = '';
79
    $author          = '';
Lines 86-91 if ( $op eq "add_confirm" ) { Link Here
86
    $op              = 'else';
86
    $op              = 'else';
87
}
87
}
88
88
89
if ( $op eq "add_confirm" ) {
90
    # If antispam is enabled and user not logged
91
    if (C4::Context->preference('Mollom')
92
    and $borrowernumber == C4::Context->preference("AnonSuggestions")) {
93
        # Instanciates Mollom Antispam
94
        my $mollom = Net::Mollom->new(
95
                'public_key'  => C4::Context->preference("MollomPublicKey"),
96
                'private_key' => C4::Context->preference("MollomPrivateKey"),
97
            );
98
        # Checks the suggestion content
99
        my $check = $mollom->check_content(
100
            post_title => $title,
101
            post_body  => $author . ' ' . $publishercode . ' ' . $note
102
        );
103
        # You can add a $check->is_unsure case to display a captcha
104
        if ($check->is_ham) {
105
            create_suggestion;
106
        } else {
107
            $template->param(spam => 1);
108
            $op = 'else';
109
        }
110
    # If the user is logged or antispam is turned off, create the suggestion
111
    } else {
112
        create_suggestion;
113
    }
114
}
115
89
if ( $op eq "delete_confirm" ) {
116
if ( $op eq "delete_confirm" ) {
90
    my @delete_field = $input->param("delete_field");
117
    my @delete_field = $input->param("delete_field");
91
    foreach my $delete_field (@delete_field) {
118
    foreach my $delete_field (@delete_field) {
Lines 106-112 $template->param( Link Here
106
    status           => $status,
133
    status           => $status,
107
    suggestedbyme    => $suggestedbyme,
134
    suggestedbyme    => $suggestedbyme,
108
    "op_$op"         => 1,
135
    "op_$op"         => 1,
109
	suggestionsview => 1
136
    suggestionsview  => 1
110
);
137
);
111
138
112
output_html_with_http_headers $input, $cookie, $template->output;
139
output_html_with_http_headers $input, $cookie, $template->output;
113
- 

Return to bug 3144