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

(-)a/admin/systempreferences.pl (+1 lines)
Lines 380-385 $tabsysprefs{OPACGroupResults} = "OPAC"; Link Here
380
$tabsysprefs{XSLTDetailsDisplay}   = "OPAC";
380
$tabsysprefs{XSLTDetailsDisplay}   = "OPAC";
381
$tabsysprefs{XSLTResultsDisplay}   = "OPAC";
381
$tabsysprefs{XSLTResultsDisplay}   = "OPAC";
382
$tabsysprefs{OPACShowCheckoutName}   = "OPAC";
382
$tabsysprefs{OPACShowCheckoutName}   = "OPAC";
383
$tabsysprefs{AllowPurchaseSuggestionBranchChoice}   = "OPAC";
383
384
384
# Serials
385
# Serials
385
$tabsysprefs{RoutingListAddReserves}  	   = "Serials";
386
$tabsysprefs{RoutingListAddReserves}  	   = "Serials";
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+2 lines)
Lines 294-296 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
294
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1,       'Allow the user to choose the branch they want to pickup their hold from','1','YesNo');
294
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1,       'Allow the user to choose the branch they want to pickup their hold from','1','YesNo');
295
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo');
295
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo');
296
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer');
296
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer');
297
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
298
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4106-4111 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4106
}
4106
}
4107
4107
4108
4108
4109
$DBversion = "3.03.00.XXX";
4110
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4111
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo')");
4112
    print "Upgrade to $DBversion done (Add syspref to control if user can choose branch when making purchase suggestion)\n";
4113
    SetVersion ($DBversion);
4114
}
4115
4116
4109
=head1 FUNCTIONS
4117
=head1 FUNCTIONS
4110
4118
4111
=head2 DropAllForeignKeys($table)
4119
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+13 lines)
Lines 274-279 OPAC: Link Here
274
                  yes: Show
274
                  yes: Show
275
                  no: "Don't show"
275
                  no: "Don't show"
276
            - purchase suggestions from other patrons on the OPAC.
276
            - purchase suggestions from other patrons on the OPAC.
277
        -
278
            - pref: AllowPurchaseSuggestionBranchChoice
279
              default: 0
280
              choices:
281
                  no: "Don't allow"
282
                  yes: Allow
283
            - patrons to select branch when making a purchase suggestion
284
        -
285
            - pref: SearchMyLibraryFirst
286
              choices:
287
                  yes: Limit
288
                  no: "Don't limit"
289
            - "patrons' searches to the library they are registered at."
277
    Privacy:
290
    Privacy:
278
        -
291
        -
279
            - pref: AnonSuggestions
292
            - pref: AnonSuggestions
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl (+13 lines)
Lines 91-96 $.tablesorter.addParser({ Link Here
91
			<!-- TMPL_IF name="selected" --><option value="<!-- TMPL_VAR name="itemtype"-->" selected="selected"> <!--TMPL_ELSE--><option value="<!-- TMPL_VAR name="itemtype" -->"> <!--/TMPL_IF--> <!-- TMPL_VAR name="description" --></option>
91
			<!-- TMPL_IF name="selected" --><option value="<!-- TMPL_VAR name="itemtype"-->" selected="selected"> <!--TMPL_ELSE--><option value="<!-- TMPL_VAR name="itemtype" -->"> <!--/TMPL_IF--> <!-- TMPL_VAR name="description" --></option>
92
        <!-- /TMPL_LOOP -->
92
        <!-- /TMPL_LOOP -->
93
        </select> </li>
93
        </select> </li>
94
    <!-- TMPL_IF NAME="branch_loop" -->
95
    <li><label for="branch">Branch:</label>
96
        <select name="branch" id="branch"
97
        <!-- TMPL_LOOP NAME="branch_loop" -->
98
            <!-- TMPL_IF name="selected" -->
99
            <option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
100
            <!-- TMPL_ELSE -->
101
            <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
102
            <!-- /TMPL_IF -->
103
        <!-- /TMPL_LOOP -->
104
        </select>
105
    </li>
106
    <!-- /TMPL_IF -->
94
    <!-- TMPL_IF NAME="patron_reason_loop" --><li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value="">-- Choose --</option><!-- TMPL_LOOP NAME="patron_reason_loop" -->
107
    <!-- TMPL_IF NAME="patron_reason_loop" --><li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value="">-- Choose --</option><!-- TMPL_LOOP NAME="patron_reason_loop" -->
95
           <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!--TMPL_VAR NAME="lib" --></option>
108
           <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!--TMPL_VAR NAME="lib" --></option>
96
    <!-- /TMPL_LOOP --></select></li><!-- /TMPL_IF -->
109
    <!-- /TMPL_LOOP --></select></li><!-- /TMPL_IF -->
(-)a/opac/opac-suggestions.pl (-2 / +14 lines)
Lines 20-25 use warnings; Link Here
20
20
21
use CGI;
21
use CGI;
22
use C4::Auth;    # get_template_and_user
22
use C4::Auth;    # get_template_and_user
23
use C4::Members;
23
use C4::Branch;
24
use C4::Branch;
24
use C4::Koha;
25
use C4::Koha;
25
use C4::Output;
26
use C4::Output;
Lines 77-83 if ( $op eq "add_confirm" ) { Link Here
77
	}
78
	}
78
	else {
79
	else {
79
		$$suggestion{'suggesteddate'}=C4::Dates->today;
80
		$$suggestion{'suggesteddate'}=C4::Dates->today;
80
		$$suggestion{'branchcode'}=C4::Context->userenv->{"branch"};
81
		$$suggestion{'branchcode'}= $input->param('branch') || C4::Context->userenv->{"branch"};
81
		&NewSuggestion($suggestion);
82
		&NewSuggestion($suggestion);
82
		# empty fields, to avoid filter in "SearchSuggestion"
83
		# empty fields, to avoid filter in "SearchSuggestion"
83
		$$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>;
84
		$$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>;
Lines 122-127 foreach my $suggestion(@$suggestions_loop) { Link Here
122
123
123
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
124
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
124
125
126
# Is the person allowed to choose their branch
127
if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) {
128
    my ( $borr ) = GetMemberDetails( $borrowernumber );
129
130
# pass the pickup branch along....
131
    my $branch = $input->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
132
133
# make branch selection options...
134
    my $CGIbranchloop = GetBranchesLoop($branch);
135
    $template->param( branch_loop => $CGIbranchloop );
136
}
137
125
$template->param(
138
$template->param(
126
	%$suggestion,
139
	%$suggestion,
127
	itemtypeloop=> $supportlist,
140
	itemtypeloop=> $supportlist,
128
- 

Return to bug 5928