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

(-)a/admin/systempreferences.pl (-1 / +2 lines)
Lines 379-385 $tabsysprefs{OPACItemHolds} = "OPAC"; Link Here
379
$tabsysprefs{OPACGroupResults}     = "OPAC";
379
$tabsysprefs{OPACGroupResults}     = "OPAC";
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{OPACSearchReboundBy}  = "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 292-294 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
292
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo');
292
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo');
293
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo');
293
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','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');
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 ( 'OPACSearchReboundBy', 'term', 'term|authority', 'determines if the rebound search use authority number or term.', 'Choice' );
296
 
(-)a/installer/data/mysql/updatedatabase.pl (+11 lines)
Lines 4090-4095 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4090
    SetVersion ($DBversion);
4090
    SetVersion ($DBversion);
4091
}
4091
}
4092
4092
4093
$DBversion = 'XXX';
4094
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4095
    $dbh->do(q{
4096
      INSERT INTO systempreferences (variable,value,explanation,options,type)
4097
      VALUES ('OPACSearchReboundBy', 'term', 'determines if the search rebound use authority number or term.','term|authority','Choice');
4098
});
4099
    print "Upgrade to $DBversion done. (Add a new system preference OPACSearchReboundBy)\n";
4100
    SetVersion ($DBversion);
4101
}
4102
4103
4093
=head1 FUNCTIONS
4104
=head1 FUNCTIONS
4094
4105
4095
=head2 DropAllForeignKeys($table)
4106
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 225-230 OPAC: Link Here
225
                  yes: Allow
225
                  yes: Allow
226
                  no: "Don't allow"
226
                  no: "Don't allow"
227
            - patrons to place holds on items from the OPAC.
227
            - patrons to place holds on items from the OPAC.
228
        -
229
            - Do search rebound on
230
            - pref: OPACSearchReboundBy
231
              choices:
232
                  authority: Authority
233
                  term: Term
228
    Policy:
234
    Policy:
229
        -
235
        -
230
            - pref: singleBranchMode
236
            - pref: singleBranchMode
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+30 lines)
Lines 1956-1961 a.p1:active { Link Here
1956
div.ft {
1956
div.ft {
1957
	clear : both;
1957
	clear : both;
1958
}
1958
}
1959
1960
.authorSearch {
1961
    position: absolute;
1962
    display: none;
1963
    z-index: 2;
1964
    background-color: white;
1965
    border: 1px solid black;
1966
    padding: 4px;
1967
}
1968
.authorSearch li {
1969
    list-style-type: none;
1970
}
1971
.authorSearch ul {
1972
    padding-left: 0px; 
1973
}
1974
.subjectSearch {
1975
    position: absolute;
1976
    display: none;
1977
    z-index: 2;
1978
    background-color: white;
1979
    border: 1px solid black;
1980
    padding: 4px;
1981
}
1982
.subjectSearch li {
1983
    list-style-type: none;
1984
}
1985
.subjectSearch ul {
1986
    padding-left: 0px; 
1987
}
1988
1959
#basket td ul li {
1989
#basket td ul li {
1960
	font-size:90%;
1990
	font-size:90%;
1961
	list-style:disc outside url("../../images/item-bullet.gif");
1991
	list-style:disc outside url("../../images/item-bullet.gif");
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl (-9 / +130 lines)
Lines 44-49 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
44
	
44
	
45
//]]>
45
//]]>
46
</script>
46
</script>
47
<script type="text/JavaScript" language="JavaScript">
48
    function showAuthors(element, value){
49
        check("#authorsList", value);
50
        makeAuthorRequest();
51
        var left = element.offsetLeft || 0;
52
        var top = element.offsetTop || 0;
53
        $('.authorSearch').css('display', 'block');
54
        $('.authorSearch').css('left', left);
55
        $('.authorSearch').css('top', top + 15);
56
    }
57
58
    function hideMenu(elem) {
59
        $(elem).css('display', 'none');
60
    }
61
    
62
    function check(elem, value) {
63
        $(elem).find("li").each(function (){
64
            if ($(this).find("input").val() == value) { $(this).find("input").attr("checked", "true"); }
65
            else { $(this).find("input").attr("checked", ""); }
66
        });
67
    }
68
    
69
    function checkAll(elem) {
70
        var check = "";
71
        if ($(elem).find("li:first").find("input").attr("checked")){ check = true; }
72
        $(elem).find("li").not(":first").each(function (){
73
            $(this).find("input").attr("checked", check);
74
        });
75
        elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest();
76
    }
77
    
78
    function makeAuthorRequest(){
79
        var request = "/cgi-bin/koha/opac-search.pl?q=";
80
        var alreadyFound = false;
81
        $("#authorsList").find("li").each(function (){ 
82
            if ($(this).find("input").attr("checked") && $(this).find("input").attr("name") == "checkbox") {
83
                value = $(this).find("input").val();
84
                if (alreadyFound){ request += " and " + value; }
85
                else { 
86
                    request += value; 
87
                    alreadyFound = true;
88
                }  
89
            }
90
        });
91
        if (alreadyFound) {
92
            $("#validAuthorSearch").attr("href", request);
93
        }else {
94
            $("#validAuthorSearch").removeAttr("href");
95
        }
96
        
97
    }
98
    //Subjects
99
    function showSubjects(element, value, code){
100
        $("#subjectsList").find("li").each(function (){
101
            $(this).find("input").attr("checked", "");
102
        });
103
        $("#subjectsList").find("li").each(function (){
104
            if ($(this).find("input").val() == value && $(this).find("input").attr("code") == code) { 
105
                $(this).find("input").attr("checked", "true");
106
                var elem = this;
107
                while ($(elem).prev("li").children().attr("id") == "checkbox") {
108
                    $(elem).prev("li").find("input").attr("checked", "true");
109
                    elem = $(elem).prev("li");
110
                } 
111
            }
112
        });
113
        makeSubjectRequest();
114
        var left = element.offsetLeft || 0;
115
        var top = element.offsetTop || 0;
116
        $('.subjectSearch').css('display', 'block');
117
        $('.subjectSearch').css('left', left);
118
        $('.subjectSearch').css('top', top + 15);
119
    }
120
    function makeSubjectRequest() {
121
        var request = "/cgi-bin/koha/opac-search.pl?q=";
122
        var alreadyFound = false;
123
        $("#subjectsList").find("li").each(function (){
124
            if ($(this).find("input").attr("checked") && $(this).find("input").attr("name") == "checkbox") {
125
                value = $(this).find("input").val();
126
                if (alreadyFound){ request += " and " + value; }
127
                else { 
128
                    request += value; 
129
                    alreadyFound = true;
130
                }  
131
            }
132
        });
133
        alreadyFound ? $("#validSubjectSearch").attr("href", request) : $("#validSubjectSearch").removeAttr("href");
134
    }
135
</script>
47
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" --><style type="text/css">
136
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" --><style type="text/css">
48
    #addtagl { display: none; }
137
    #addtagl { display: none; }
49
</style><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
138
</style><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
Lines 101-112 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
101
    </span>
190
    </span>
102
191
103
    <!-- TMPL_IF name="MARCAUTHORS" -->
192
    <!-- TMPL_IF name="MARCAUTHORS" -->
104
    <span class="results_summary"><span class="label">Authors:</span>
193
    <span class="results_summary">
105
                <!-- TMPL_LOOP NAME="MARCAUTHORS" -->
194
                <span class="label">Authors:</span>
106
                <!-- TMPL_LOOP NAME="MARCAUTHOR_SUBFIELDS_LOOP" --><!-- TMPL_VAR NAME="separator" --><a title="&#8225;<!-- TMPL_VAR NAME=code --> <!-- TMPL_VAR NAME=value -->" href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_LOOP NAME=link_loop --><!-- TMPL_VAR NAME=operator ESCAPE="URL" --><!-- TMPL_VAR NAME='limit' ESCAPE="URL" -->:<!-- TMPL_VAR NAME=link ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP --> 
195
                <div class="authorSearch">
107
        <!-- TMPL_UNLESS NAME="__last__" -->|
196
                    <span><b>Select the item(s) to search :</b></span>
108
<!-- /TMPL_UNLESS -->
197
                    <ul id="authorsList">
198
                        <li><input type="checkbox" onchange="checkAll('#authorsList')"> <b>all</b></li>
199
                        <!-- TMPL_LOOP NAME="bouncemarcauthorsarray" -->
200
                                <li><input type="checkbox" name="checkbox" onclick="makeAuthorRequest()" value="<!-- TMPL_IF name="searchbyauthority" --><!-- TMPL_IF name="authoritylink" -->an:<!-- TMPL_VAR name="authoritylink" --><!-- TMPL_ELSE -->au,wrdl:<!-- TMPL_LOOP name="term" --><!-- TMPL_VAR name="value" --><!-- TMPL_UNLESS NAME="__last__" -->+<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP --><!-- /TMPL_IF --><!-- TMPL_ELSE -->au,wrdl:<!-- TMPL_LOOP name="term" --><!-- TMPL_VAR name="value" --><!-- TMPL_UNLESS NAME="__last__" -->+<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP --><!-- /TMPL_IF -->"><!-- TMPL_LOOP name="term" --> <!-- TMPL_VAR name="value" --> <!-- /TMPL_LOOP --></li>
201
                        <!-- /TMPL_LOOP -->
202
                    </ul>
203
                        <a href="#" onclick="hideMenu('.authorSearch');">Cancel</a>&nbsp;|&nbsp;<a id="validAuthorSearch"href="#">Search</a>
204
                </div>
205
                <!-- TMPL_LOOP NAME="bouncemarcauthorsarray" -->
206
                    <a href="<!-- TMPL_IF name="authoritylink" -->/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<!-- TMPL_VAR name="authoritylink" --><!-- TMPL_ELSE --><!-- /TMPL_IF -->" >
207
                        <img height="15" src="/opac-tmpl/prog/images/filefind.png">
208
                    </a>
209
                    <a href="#" onclick="showAuthors(this, '<!-- TMPL_IF name="searchbyauthority" --><!-- TMPL_IF name="authoritylink" -->an:<!-- TMPL_VAR name="authoritylink" --><!-- TMPL_ELSE -->au,wrdl:<!-- TMPL_LOOP name="term" --><!-- TMPL_VAR name="value" --><!-- TMPL_UNLESS NAME="__last__" -->+<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP --><!-- /TMPL_IF --><!-- TMPL_ELSE -->au,wrdl:<!-- TMPL_LOOP name="term" --><!-- TMPL_VAR name="value" --><!-- TMPL_UNLESS NAME="__last__" -->+<!-- /TMPL_UNLESS --><!-- /TMPL_LOOP --><!-- /TMPL_IF -->')"><!-- TMPL_LOOP name="term" --><!-- TMPL_VAR name="value" --> <!-- /TMPL_LOOP --></a>&nbsp;|&nbsp;
109
                <!-- /TMPL_LOOP -->
210
                <!-- /TMPL_LOOP -->
211
    <!-- /TMPL_UNLESS -->
212
    <!-- /TMPL_LOOP -->
110
    </span>
213
    </span>
111
    <!-- /TMPL_IF -->
214
    <!-- /TMPL_IF -->
112
215
Lines 160-171 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
160
    <!-- /TMPL_IF -->
263
    <!-- /TMPL_IF -->
161
264
162
    <!-- TMPL_IF NAME="MARCSUBJCTS" -->
265
    <!-- TMPL_IF NAME="MARCSUBJCTS" -->
163
            <span class="results_summary"><span class="label">Subject(s):</span> 
266
            <span class="results_summary"><span class="label">Subject(s):</span>
267
                <div class="subjectSearch" >
268
                    <span><b>Select the item(s) to search :</b></span>
269
                    <ul id="subjectsList">
270
                        <li><input id="all" type="checkbox" onchange="checkAll('#subjectsList')"> <b>all</b></li>
271
                        <!-- TMPL_LOOP NAME="MARCSUBJCTS" -->
272
                            <!-- TMPL_LOOP NAME="MARCSUBJECT_SUBFIELDS_LOOP" -->
273
                                <li><input type="checkbox" onclick="makeSubjectRequest()" name="checkbox" id="checkbox" code="<!-- TMPL_VAR name="value" -->" value="<!-- TMPL_IF name="searchbyauthority" -->an:<!-- TMPL_LOOP name="link_loop" --><!-- TMPL_VAR name="link" --><!-- /TMPL_LOOP --><!-- TMPL_ELSE -->su,wrdl:<!-- TMPL_VAR name="value" --><!-- /TMPL_IF -->"> <!-- TMPL_VAR name="value" --></li>
274
                            <!-- /TMPL_LOOP -->
275
                                <li><hr id="trait"></li>
276
                        <!-- /TMPL_LOOP -->
277
                    </ul>
278
                    <a href="#" onclick="hideMenu('.subjectSearch')">Cancel</a>&nbsp;|&nbsp;<a id="validSubjectSearch"href="#">Search</a>
279
                </div>
164
                <!-- TMPL_LOOP NAME="MARCSUBJCTS" -->
280
                <!-- TMPL_LOOP NAME="MARCSUBJCTS" -->
165
                    <!-- TMPL_LOOP NAME="MARCSUBJECT_SUBFIELDS_LOOP" -->
281
                    <!-- TMPL_LOOP NAME="MARCSUBJECT_SUBFIELDS_LOOP" -->
166
                        <!-- TMPL_VAR NAME="separator" --><a title="$<!-- TMPL_VAR NAME="code" --> <!-- TMPL_VAR NAME="value" -->" href="/cgi-bin/koha/opac-search.pl?q=<!-- TMPL_LOOP NAME="link_loop" --><!-- TMPL_VAR NAME="operator" ESCAPE="URL" --><!-- TMPL_VAR NAME="limit" ESCAPE="URL" -->:<!-- TMPL_VAR NAME="link" ESCAPE="URL" --><!-- /TMPL_LOOP -->"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP -->
282
                        <!-- TMPL_VAR NAME="separator" -->
167
        <!-- TMPL_IF NAME="__LAST__" --><!-- TMPL_ELSE -->|<!-- /TMPL_IF -->
283
                        <span>
168
                <!-- /TMPL_LOOP --></span>
284
                            <a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<!-- TMPL_LOOP NAME="link_loop" --><!-- TMPL_VAR NAME="link" ESCAPE="URL" --><!-- /TMPL_LOOP -->"><img height="15" src="/opac-tmpl/prog/images/filefind.png"></a>                           
285
                        </span>
286
                        <a href="#" onclick="showSubjects(this, '<!-- TMPL_IF name="searchbyauthority" -->an:<!-- TMPL_LOOP name="link_loop" --><!-- TMPL_VAR name="link" --><!-- /TMPL_LOOP --><!-- TMPL_ELSE -->su,wrdl:<!-- TMPL_VAR name="value" --><!-- /TMPL_IF -->', '<!-- TMPL_VAR name="value" -->')"><!-- TMPL_VAR NAME="value" --></a><!-- /TMPL_LOOP -->
287
                        <!-- TMPL_IF NAME="__LAST__" --><!-- TMPL_ELSE -->|<!-- /TMPL_IF -->
288
                <!-- /TMPL_LOOP -->
289
            </span>
169
    <!-- TMPL_ELSE -->
290
    <!-- TMPL_ELSE -->
170
    <!-- TMPL_IF name="subjects" --><span class="results_summary"><span class="label">Subject(s):</span> <!-- TMPL_LOOP name="subjects" --><a href="/cgi-bin/koha/opac-search.pl?q=su:<!-- TMPL_VAR NAME="subject" escape="URL" -->"><!-- TMPL_VAR NAME="subject" --></a> | <!-- /TMPL_LOOP --></span><!-- /TMPL_IF -->
291
    <!-- TMPL_IF name="subjects" --><span class="results_summary"><span class="label">Subject(s):</span> <!-- TMPL_LOOP name="subjects" --><a href="/cgi-bin/koha/opac-search.pl?q=su:<!-- TMPL_VAR NAME="subject" escape="URL" -->"><!-- TMPL_VAR NAME="subject" --></a> | <!-- /TMPL_LOOP --></span><!-- /TMPL_IF -->
171
    <!-- /TMPL_IF -->
292
    <!-- /TMPL_IF -->
(-)a/opac/opac-detail.pl (-1 / +33 lines)
Lines 205-210 my $marcseriesarray = GetMarcSeries ($record,$marcflavour); Link Here
205
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
205
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
206
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
206
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
207
207
208
#search rebound parameter
209
my $searchByauthority = 0;
210
if ( C4::Context->preference("OPACSearchReboundBy") eq "authority" ) {
211
    $searchByauthority = 1;
212
}
213
214
#search rebound on author
215
my @reboundmarcauthorsarray;
216
foreach my $author (@$marcauthorsarray) {
217
    my ( $a, $b, $authoritylink, @term );
218
    foreach my $subfield ( @{ $author->{'MARCAUTHOR_SUBFIELDS_LOOP'} } ) {
219
        if ( $subfield->{'code'} eq "a" && @{ $subfield->{'link_loop'} }[0]->{"limit"} eq "an" ) {
220
            $authoritylink = @{ $subfield->{'link_loop'} }[0]->{"link"};
221
        }
222
        unless ( $subfield->{'code'} eq "3" || $subfield->{'code'} eq "4" ) { push( @term, { value => $subfield->{'value'} } ); }
223
    }
224
    push(
225
        @reboundmarcauthorsarray,
226
        {   term              => \@term,
227
            authoritylink     => $authoritylink,
228
            searchbyauthority => $searchByauthority,
229
        }
230
    );
231
}
232
233
#search rebound on subject
234
foreach my $subject (@$marcsubjctsarray) {
235
    foreach my $subfield ( @{ $subject->{'MARCSUBJECT_SUBFIELDS_LOOP'} } ) {
236
        $subfield->{'searchbyauthority'} = $searchByauthority;
237
    }
238
}
239
208
    $template->param(
240
    $template->param(
209
                     MARCNOTES               => $marcnotesarray,
241
                     MARCNOTES               => $marcnotesarray,
210
                     MARCSUBJCTS             => $marcsubjctsarray,
242
                     MARCSUBJCTS             => $marcsubjctsarray,
Lines 220-225 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib Link Here
220
                     itemdata_itemnotes          => $itemfields{itemnotes},
252
                     itemdata_itemnotes          => $itemfields{itemnotes},
221
                     authorised_value_images => $biblio_authorised_value_images,
253
                     authorised_value_images => $biblio_authorised_value_images,
222
                     subtitle                => $subtitle,
254
                     subtitle                => $subtitle,
255
                     bouncemarcauthorsarray  => \@reboundmarcauthorsarray,
223
    );
256
    );
224
257
225
foreach ( keys %{$dat} ) {
258
foreach ( keys %{$dat} ) {
226
- 

Return to bug 5888