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

(-)a/authorities/detail.pl (-50 / +60 lines)
Lines 175-227 my $authid = $query->param('authid'); Link Here
175
175
176
176
177
my $authtypecode = &GetAuthTypeCode($authid);
177
my $authtypecode = &GetAuthTypeCode($authid);
178
$tagslib = &GetTagsLabels(1,$authtypecode);
179
180
my $record;
181
if (C4::Context->preference("AuthDisplayHierarchy")){
182
  my $trees=BuildUnimarcHierarchies($authid);
183
  my @trees = split /;/,$trees ;
184
  push @trees,$trees unless (@trees);
185
  my @loophierarchies;
186
  foreach my $tree (@trees){
187
    my @tree=split /,/,$tree;
188
    push @tree,$tree unless (@tree);
189
    my $cnt=0;
190
    my @loophierarchy;
191
    foreach my $element (@tree){
192
      my $elementdata = GetAuthority($element);
193
      $record= $elementdata if ($authid==$element);
194
      push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
195
      $cnt++;
196
    }
197
    push @loophierarchies, { 'loopelement' =>\@loophierarchy};
198
  }
199
  $template->param(
200
    'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
201
    'loophierarchies' =>\@loophierarchies,
202
  );
203
} else {
204
  $record=GetAuthority($authid);
205
}
206
my $count = CountUsage($authid);
207
208
# find the marc field/subfield used in biblio by this authority
209
my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
210
$sth->execute($authtypecode);
211
my $biblio_fields;
212
while (my ($tagfield) = $sth->fetchrow) {
213
	$biblio_fields.= $tagfield."9,";
214
}
215
chop $biblio_fields;
216
178
179
if ( defined $authtypecode ) {
180
	# authid is valid
181
	$tagslib = &GetTagsLabels(1,$authtypecode);
182
183
	my $record;
184
	if (C4::Context->preference("AuthDisplayHierarchy")){
185
		my $trees=BuildUnimarcHierarchies($authid);
186
		my @trees = split /;/,$trees ;
187
		push @trees,$trees unless (@trees);
188
		my @loophierarchies;
189
		foreach my $tree (@trees){
190
			my @tree=split /,/,$tree;
191
			push @tree,$tree unless (@tree);
192
			my $cnt=0;
193
			my @loophierarchy;
194
			foreach my $element (@tree){
195
			my $elementdata = GetAuthority($element);
196
			$record= $elementdata if ($authid==$element);
197
			push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
198
			$cnt++;
199
			}
200
			push @loophierarchies, { 'loopelement' =>\@loophierarchy};
201
		}
202
		$template->param(
203
			'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
204
			'loophierarchies' =>\@loophierarchies,
205
		);
206
	} else {
207
		$record=GetAuthority($authid);
208
	}
209
210
	my $count = CountUsage($authid);
211
212
	# find the marc field/subfield used in biblio by this authority
213
	my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
214
	$sth->execute($authtypecode);
215
	my $biblio_fields;
216
	while (my ($tagfield) = $sth->fetchrow) {
217
		$biblio_fields.= $tagfield."9,";
218
	}
219
	chop $biblio_fields;
220
221
	# loop through each tab 0 through 9
222
	# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
223
	# loop through each tag
224
	build_tabs ($template, $record, $dbh,"",$query);
225
226
	$template->param(authid => $authid,
227
		count => $count,
228
		biblio_fields => $biblio_fields,
229
	);
217
230
218
# fill arrays
231
} else {
219
my @loop_data =();
232
	# authid invalid
220
my $tag;
233
	# set default $authtypecode
221
# loop through each tab 0 through 9
234
	$authtypecode = '';
222
# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
235
    $template->param ( errauthid => $authid,unknownauthid => 1 );
223
# loop through each tag
236
}
224
  build_tabs ($template, $record, $dbh,"",$query);
225
237
226
my $authtypes = getauthtypes;
238
my $authtypes = getauthtypes;
227
my @authtypesloop;
239
my @authtypesloop;
Lines 233-243 foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$ Link Here
233
	push @authtypesloop, \%row;
245
	push @authtypesloop, \%row;
234
}
246
}
235
247
236
$template->param(authid => $authid,
248
$template->param (
237
		count => $count,
238
		biblio_fields => $biblio_fields,
239
		authtypetext => $authtypes->{$authtypecode}{'authtypetext'},
249
		authtypetext => $authtypes->{$authtypecode}{'authtypetext'},
240
		authtypesloop => \@authtypesloop,
250
		authtypesloop => \@authtypesloop,
241
		);
251
);
242
output_html_with_http_headers $query, $cookie, $template->output;
243
252
253
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/catalogue/detail.pl (-8 / +13 lines)
Lines 52-62 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
52
);
52
);
53
53
54
my $biblionumber = $query->param('biblionumber');
54
my $biblionumber = $query->param('biblionumber');
55
my $fw = GetFrameworkCode($biblionumber);
56
55
57
## get notes and subjects from MARC record
56
## get notes and subjects from MARC record
58
my $marcflavour      = C4::Context->preference("marcflavour");
57
my $record			= GetMarcBiblio($biblionumber);
59
my $record           = GetMarcBiblio($biblionumber);
58
59
if ( not defined $record ) {
60
	# biblionumber invalid -> report and exit
61
	$template->param( unknownbiblionumber => 1,
62
				biblionumber => $biblionumber
63
	);
64
	output_html_with_http_headers $query, $cookie, $template->output;
65
	exit;
66
}
67
68
my $fw 				= GetFrameworkCode($biblionumber);
69
my $marcflavour		= C4::Context->preference("marcflavour");
60
70
61
# XSLT processing of some stuff
71
# XSLT processing of some stuff
62
if (C4::Context->preference("XSLTDetailsDisplay") ) {
72
if (C4::Context->preference("XSLTDetailsDisplay") ) {
Lines 81-91 $template->param( Link Here
81
    normalized_isbn => $isbn,
91
    normalized_isbn => $isbn,
82
);
92
);
83
93
84
unless (defined($record)) {
85
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
86
	exit;
87
}
88
89
my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
94
my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
90
my $marcisbnsarray   = GetMarcISBN( $record, $marcflavour );
95
my $marcisbnsarray   = GetMarcISBN( $record, $marcflavour );
91
my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
96
my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl (-48 / +50 lines)
Lines 1-5 Link Here
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2
<title>Koha &rsaquo; Authorities &rsaquo; Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</title>
2
<title>Koha &rsaquo; Authorities &rsaquo; <!-- TMPL_IF NAME="unknownauthid" --> Unknown authority<!-- TMPL_ELSE -->Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --></title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4
<script type="text/javascript">
4
<script type="text/javascript">
5
5
Lines 62-68 function searchauthority() { Link Here
62
<body>
62
<body>
63
<!-- TMPL_INCLUDE NAME="header.inc" -->
63
<!-- TMPL_INCLUDE NAME="header.inc" -->
64
<!-- TMPL_INCLUDE NAME="authorities-search.inc" -->
64
<!-- TMPL_INCLUDE NAME="authorities-search.inc" -->
65
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> &rsaquo; Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->) </div>
65
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> &rsaquo; <!-- TMPL_IF NAME="unknownauthid" --> Unknown authority<!-- TMPL_ELSE--> Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --></div>
66
66
67
<div id="doc" class="yui-t7">
67
<div id="doc" class="yui-t7">
68
68
Lines 103-157 function searchauthority() { Link Here
103
</div>
103
</div>
104
<!-- /TMPL_IF -->
104
<!-- /TMPL_IF -->
105
105
106
<h1>Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</h1>
106
<!-- TMPL_IF NAME="unknownauthid" -->
107
   <div class="dialog message">The authority you requested does not exist (<!-- TMPL_VAR NAME="errauthid" -->).</div>
108
<!-- TMPL_ELSE -->
107
109
108
<div id="action">
110
	<h1>Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</h1>
109
    
111
	<div id="action">
110
    
112
		Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=<!--TMPL_VAR Name="authid" -->"><!-- TMPL_VAR name="count" --> record(s)</a>
111
    Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=<!--TMPL_VAR Name="authid" -->"><!-- TMPL_VAR name="count" --> record(s)</a>
113
	</div>
112
</div>
113
114
114
<div id="authoritiestabs" class="toptabs numbered">
115
	<div id="authoritiestabs" class="toptabs numbered">
115
    <ul>
116
		<ul>
116
        <!-- TMPL_LOOP name="BIG_LOOP" -->
117
			<!-- TMPL_LOOP name="BIG_LOOP" -->
117
            <li>
118
				<li>
118
                <a href="/cgi-bin/koha/cataloguing/addbiblio.pl#tab<!-- TMPL_VAR name="number" -->XX"><!-- TMPL_VAR name="number"--></a>
119
					<a href="/cgi-bin/koha/cataloguing/addbiblio.pl#tab<!-- TMPL_VAR name="number" -->XX"><!-- TMPL_VAR name="number"--></a>
119
            </li>
120
				</li>
120
        <!-- /TMPL_LOOP -->
121
			<!-- /TMPL_LOOP -->
121
    </ul>
122
		</ul>
122
123
123
<!-- TMPL_LOOP name="BIG_LOOP" -->
124
	<!-- TMPL_LOOP name="BIG_LOOP" -->
124
    <div id="tab<!-- TMPL_VAR name="number" -->XX">
125
		<div id="tab<!-- TMPL_VAR name="number" -->XX">
125
    <!-- TMPL_LOOP NAME="innerloop" -->
126
		<!-- TMPL_LOOP NAME="innerloop" -->
126
        <!-- TMPL_IF name="tag" -->
127
			<!-- TMPL_IF name="tag" -->
127
            <div class="tag">
128
				<div class="tag">
128
            <div class="tag_title">
129
				<div class="tag_title">
129
                <!-- TMPL_VAR NAME="tag" -->
130
					<!-- TMPL_VAR NAME="tag" -->
130
            </div>
131
				</div>
131
        <!-- TMPL_ELSE -->
132
			<!-- TMPL_ELSE -->
132
            <div class="tag">
133
				<div class="tag">
133
        <!-- /TMPL_IF -->
134
			<!-- /TMPL_IF -->
134
        <!-- TMPL_LOOP NAME="subfield" -->
135
			<!-- TMPL_LOOP NAME="subfield" -->
135
            <p>
136
				<p>
136
                <label class="labelsubfield">&nbsp;
137
					<label class="labelsubfield">&nbsp;
137
                <!-- TMPL_UNLESS name="hide_marc" --><b><!-- TMPL_VAR NAME="marc_subfield" --></b><!-- /TMPL_UNLESS -->
138
					<!-- TMPL_UNLESS name="hide_marc" --><b><!-- TMPL_VAR NAME="marc_subfield" --></b><!-- /TMPL_UNLESS -->
138
                <span title="<!-- TMPL_VAR name="long_desc" -->"><!-- TMPL_VAR NAME="short_desc" --></span></label>
139
					<span title="<!-- TMPL_VAR name="long_desc" -->"><!-- TMPL_VAR NAME="short_desc" --></span></label>
139
                <!-- TMPL_VAR NAME="marc_value" -->
140
					<!-- TMPL_VAR NAME="marc_value" -->
140
                <!-- TMPL_IF name="link" -->
141
					<!-- TMPL_IF name="link" -->
141
                    <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&amp;marclist=<!-- TMPL_VAR NAME="link" -->&amp;operator==&amp;type=intranet&amp;value=<!-- TMPL_VAR NAME="marc_value" ESCAPE="URL" -->">
142
						<a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&amp;marclist=<!-- TMPL_VAR NAME="link" -->&amp;operator==&amp;type=intranet&amp;value=<!-- TMPL_VAR NAME="marc_value" ESCAPE="URL" -->">
142
                        <img border="0" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/filefind.png" height="15" title="Search on <!-- TMPL_VAR name="marc_value" -->">
143
							<img border="0" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/filefind.png" height="15" title="Search on <!-- TMPL_VAR name="marc_value" -->">
143
                    </a>
144
						</a>
144
                <!-- /TMPL_IF -->
145
					<!-- /TMPL_IF -->
145
                <!-- TMPL_IF NAME="authority" -->
146
					<!-- TMPL_IF NAME="authority" -->
146
                    <a href="/cgi-bin/koha/authorities/detail.pl?authid=<!-- TMPL_VAR name="authority" -->" class="button">Auth</a>
147
						<a href="/cgi-bin/koha/authorities/detail.pl?authid=<!-- TMPL_VAR name="authority" -->" class="button">Auth</a>
147
                <!-- /TMPL_IF -->
148
					<!-- /TMPL_IF -->
148
            </p>
149
				</p>
149
        <!-- /TMPL_LOOP -->
150
			<!-- /TMPL_LOOP -->
150
        </div>
151
			</div>
151
    <!-- /TMPL_LOOP -->
152
		<!-- /TMPL_LOOP -->
152
    </div>
153
		</div>
153
<!-- /TMPL_LOOP -->
154
	<!-- /TMPL_LOOP -->
154
</div>
155
	</div>
156
<!-- /TMPL_IF -->
155
</div>
157
</div>
156
</div>
158
</div>
157
</div>
159
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl (-4 / +8 lines)
Lines 1-5 Link Here
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2
<title>Koha &rsaquo; Catalog &rsaquo; Details for <!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_LOOP NAME="subtitle" --> <!-- TMPL_VAR NAME="subfield" --><!-- /TMPL_LOOP --></title>
2
<title>Koha &rsaquo; Catalog &rsaquo; <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown biblio<!-- TMPL_ELSE -->Details for <!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_LOOP NAME="subtitle" --> <!-- TMPL_VAR NAME="subfield" --><!-- /TMPL_LOOP --><!-- /TMPL_IF --></title>
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --><script type="text/JavaScript" language="JavaScript">
3
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --><script type="text/JavaScript" language="JavaScript">
4
//<![CDATA[
4
//<![CDATA[
5
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
5
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
Lines 44-53 function verify_images() { Link Here
44
<!-- TMPL_INCLUDE NAME="header.inc" -->
44
<!-- TMPL_INCLUDE NAME="header.inc" -->
45
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
45
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
46
46
47
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Details for <i><!-- TMPL_VAR NAME="title" escape="html" -->  <!-- TMPL_LOOP NAME="subtitle" --> <!-- TMPL_VAR NAME="subfield" --><!-- /TMPL_LOOP --></i></div>
47
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown biblio<!-- TMPL_ELSE --> Details for <i><!-- TMPL_VAR NAME="title" escape="html" -->  <!-- TMPL_LOOP NAME="subtitle" --> <!-- TMPL_VAR NAME="subfield" --><!-- /TMPL_LOOP --><!-- /TMPL_IF --></i></div>
48
48
49
<div id="doc3" class="yui-t2">
49
<div id="doc3" class="yui-t2">
50
   
50
51
<!-- TMPL_IF NAME="unknownbiblionumber" -->
52
	<div class="dialog message">The biblio you requested does not exist (<!-- TMPL_VAR NAME="biblionumber" -->).</div>
53
<!-- TMPL_ELSE -->
54
51
   <div id="bd">
55
   <div id="bd">
52
    <div id="yui-main">
56
    <div id="yui-main">
53
    <div class="yui-b">
57
    <div class="yui-b">
Lines 506-510 function verify_images() { Link Here
506
<div class="yui-b">
510
<div class="yui-b">
507
<!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
511
<!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
508
</div>
512
</div>
513
<!-- /TMPL_IF -->
509
</div>
514
</div>
510
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
515
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
511
- 

Return to bug 5791