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

(-)a/Koha/Daemon.pm (-3 / +4 lines)
Lines 61-70 sub log_to_file { Link Here
61
    my ($self,$logfile) = @_;
61
    my ($self,$logfile) = @_;
62
62
63
    #Open a filehandle to append to a log file
63
    #Open a filehandle to append to a log file
64
    my $opened = open(LOG, '>>', $logfile);
64
    my $opened = open(my $fh, '>>', $logfile);
65
    if ($opened){
65
    if ($opened){
66
        LOG->autoflush(1); #Make filehandle hot (ie don't buffer)
66
        $fh->autoflush(1); #Make filehandle hot (ie don't buffer)
67
        *STDOUT = *LOG; #Re-assign STDOUT to LOG | --stdout
67
        *STDOUT = *$fh; #Re-assign STDOUT to LOG | --stdout
68
        *STDERR = *STDOUT; #Re-assign STDERR to STDOUT | --stderr
68
        *STDERR = *STDOUT; #Re-assign STDERR to STDOUT | --stderr
69
    }
69
    }
70
    else {
70
    else {
Lines 76-81 sub make_pidfilehandle { Link Here
76
    my ($self,$pidfile) = @_;
76
    my ($self,$pidfile) = @_;
77
    if ( ! -f $pidfile ){
77
    if ( ! -f $pidfile ){
78
        open(my $fh, '>', $pidfile) or die "Unable to write to $pidfile: $!\n";
78
        open(my $fh, '>', $pidfile) or die "Unable to write to $pidfile: $!\n";
79
        close($fh);
79
    }
80
    }
80
    open(my $pidfilehandle, '+<', $pidfile) or die "Unable to open a filehandle for $pidfile: $!\n";
81
    open(my $pidfilehandle, '+<', $pidfile) or die "Unable to open a filehandle for $pidfile: $!\n";
81
    return $pidfilehandle;
82
    return $pidfilehandle;
(-)a/Koha/OAI/Harvester.pm (-26 / +38 lines)
Lines 32-37 use DateTime::Format::Strptime; Link Here
32
use C4::Context;
32
use C4::Context;
33
use Koha::Database;
33
use Koha::Database;
34
34
35
=head1 API
36
37
=head2 Class Methods
38
39
=cut
40
35
my $day_granularity = DateTime::Format::Strptime->new(
41
my $day_granularity = DateTime::Format::Strptime->new(
36
    pattern   => '%F',
42
    pattern   => '%F',
37
);
43
);
Lines 288-296 sub does_task_repeat { Link Here
288
    if ($task){
294
    if ($task){
289
        my $interval = $task->{interval};
295
        my $interval = $task->{interval};
290
        my $parameters = $task->{parameters};
296
        my $parameters = $task->{parameters};
291
        my $oai_pmh = $parameters->{oai_pmh} if $parameters->{oai_pmh};
297
        if ($parameters){
292
        if ( $interval && ($oai_pmh->{verb} eq "ListRecords") && (! $oai_pmh->{until}) ){
298
            my $oai_pmh = $parameters->{oai_pmh};
293
            return 1;
299
            if ($oai_pmh){
300
                if ( $interval && ($oai_pmh->{verb} eq "ListRecords") && (! $oai_pmh->{until}) ){
301
                    return 1;
302
                }
303
            }
294
        }
304
        }
295
    }
305
    }
296
    return 0;
306
    return 0;
Lines 314-342 sub restore_state { Link Here
314
    my ($self, $kernel, $heap, $session) = @_[OBJECT, KERNEL,HEAP,SESSION];
324
    my ($self, $kernel, $heap, $session) = @_[OBJECT, KERNEL,HEAP,SESSION];
315
325
316
    my $state_file = $self->{state_file};
326
    my $state_file = $self->{state_file};
317
    my $state_backup = "$state_file~";
327
    if ($state_file){
318
328
        my $state_backup = "$state_file~";
319
    #NOTE: If there is a state backup, it means we crashed while saving the state. Otherwise,
329
320
    #let's try the regular state file if it exists.
330
        #NOTE: If there is a state backup, it means we crashed while saving the state. Otherwise,
321
    my $file_to_restore = ( -f $state_backup ) ? $state_backup : ( ( -f $state_file ) ? $state_file : undef );
331
        #let's try the regular state file if it exists.
322
    if ( $file_to_restore ){
332
        my $file_to_restore = ( -f $state_backup ) ? $state_backup : ( ( -f $state_file ) ? $state_file : undef );
323
        my $opened = open( my $fh, '<', $file_to_restore ) or die "Couldn't open state: $!";
333
        if ( $file_to_restore ){
324
        if ($opened){
334
            my $opened = open( my $fh, '<', $file_to_restore ) or die "Couldn't open state: $!";
325
            local $/;
335
            if ($opened){
326
            my $in = <$fh>;
336
                local $/;
327
            my $decoder = Sereal::Decoder->new;
337
                my $in = <$fh>;
328
            my $state = $decoder->decode($in);
338
                my $decoder = Sereal::Decoder->new;
329
            if ($state){
339
                my $state = $decoder->decode($in);
330
                if ($state->{tasks}){
340
                if ($state){
331
                    #Restore tasks from our saved state
341
                    if ($state->{tasks}){
332
                    $heap->{tasks} = $state->{tasks};
342
                        #Restore tasks from our saved state
333
                    foreach my $uuid ( keys %{$heap->{tasks}} ){
343
                        $heap->{tasks} = $state->{tasks};
334
                        my $task = $heap->{tasks}->{$uuid};
344
                        foreach my $uuid ( keys %{$heap->{tasks}} ){
335
345
                            my $task = $heap->{tasks}->{$uuid};
336
                        #If tasks were still downloading, restart the task
346
337
                        if ( ($task->{status} && $task->{status} eq "active") && $task->{downloading} ){
347
                            #If tasks were still downloading, restart the task
338
                            $task->{status} = "new";
348
                            if ( ($task->{status} && $task->{status} eq "active") && $task->{downloading} ){
339
                            $kernel->call("harvester","start_task",$task->{uuid});
349
                                $task->{status} = "new";
350
                                $kernel->call("harvester","start_task",$task->{uuid});
351
                            }
340
                        }
352
                        }
341
                    }
353
                    }
342
                }
354
                }
(-)a/Koha/OAI/Harvester/Downloader.pm (+6 lines)
Lines 23-28 use XML::LibXML::Reader; Link Here
23
use IO::Handle;
23
use IO::Handle;
24
use JSON;
24
use JSON;
25
25
26
=head1 API
27
28
=head2 Class Methods
29
30
=cut
31
26
sub new {
32
sub new {
27
    my ($class, $args) = @_;
33
    my ($class, $args) = @_;
28
    $args = {} unless defined $args;
34
    $args = {} unless defined $args;
(-)a/Koha/OAI/Harvester/Import/RDFXML.pm (-2 / +5 lines)
Lines 29-35 use Koha::RDF; Link Here
29
sub new {
29
sub new {
30
    my ($class, $args) = @_;
30
    my ($class, $args) = @_;
31
    $args = {} unless defined $args;
31
    $args = {} unless defined $args;
32
	return bless ($args, $class);
32
    return bless ($args, $class);
33
}
33
}
34
34
35
sub _parse_rdf_into_model {
35
sub _parse_rdf_into_model {
Lines 106-113 sub import_record { Link Here
106
    my $action = "error";
106
    my $action = "error";
107
107
108
    #Create a model for our Koha triplestore backend
108
    #Create a model for our Koha triplestore backend
109
    my $real_model = undef;
109
    my $context = C4::Context->new();
110
    my $context = C4::Context->new();
110
    my $real_model = $context->triplestore('update') if $context && $context->triplestore('update');
111
    if ( $context && $context->triplestore('update') ){
112
        $real_model = $context->triplestore('update');
113
    }
111
    my $memory_model = $self->_parse_rdf_into_model();
114
    my $memory_model = $self->_parse_rdf_into_model();
112
    my $iterator = $memory_model->as_stream;
115
    my $iterator = $memory_model->as_stream;
113
    if ($iterator){
116
    if ($iterator){
(-)a/Koha/OAI/Harvester/Import/Record.pm (-23 / +38 lines)
Lines 33-38 use Koha::OAI::Harvester::Import::MARCXML; Link Here
33
use Koha::OAI::Harvester::Import::RDFXML;
33
use Koha::OAI::Harvester::Import::RDFXML;
34
use Koha::RDF;
34
use Koha::RDF;
35
35
36
=head1 API
37
38
=head2 Class Methods
39
40
=cut
41
36
my $schema = Koha::Database->new()->schema();
42
my $schema = Koha::Database->new()->schema();
37
43
38
sub new {
44
sub new {
Lines 133-159 sub filter { Link Here
133
                    my $stylesheet = $xslt->parse_stylesheet($style_doc);
139
                    my $stylesheet = $xslt->parse_stylesheet($style_doc);
134
                    if ($stylesheet){
140
                    if ($stylesheet){
135
                        my $results = $stylesheet->transform($doc);
141
                        my $results = $stylesheet->transform($doc);
136
						if ($results){
142
                        if ($results){
137
							my $root = $results->documentElement;
143
                            my $root = $results->documentElement;
138
							if ($root){
144
                            if ($root){
139
								my $namespace = $root->namespaceURI;
145
                                my $namespace = $root->namespaceURI;
140
								if ($namespace eq "http://www.loc.gov/MARC21/slim"){
146
                                if ($namespace eq "http://www.loc.gov/MARC21/slim"){
141
									#NOTE: Both MARC21 and UNIMARC should be covered by this namespace
147
                                    #NOTE: Both MARC21 and UNIMARC should be covered by this namespace
142
									my $marcxml = eval { Koha::OAI::Harvester::Import::MARCXML->new({ dom => $results, }) };
148
                                    my $marcxml = eval { Koha::OAI::Harvester::Import::MARCXML->new({ dom => $results, }) };
143
                                    if ($@){
149
                                    if ($@){
144
                                        warn "Error Koha::OAI::Harvester::Import::MARCXML: $@";
150
                                        warn "Error Koha::OAI::Harvester::Import::MARCXML: $@";
145
                                        return undef;
151
                                        return;
146
                                    } else {
152
                                    } else {
147
                                        return $marcxml;
153
                                        return $marcxml;
148
                                    }
154
                                    }
149
								} elsif ($namespace eq "http://www.w3.org/1999/02/22-rdf-syntax-ns#"){
155
                                } elsif ($namespace eq "http://www.w3.org/1999/02/22-rdf-syntax-ns#"){
150
									my $rdfxml = Koha::OAI::Harvester::Import::RDFXML->new({ dom => $results, });
156
                                    my $rdfxml = Koha::OAI::Harvester::Import::RDFXML->new({ dom => $results, });
151
									if ($rdfxml){
157
                                    if ($rdfxml){
152
										return $rdfxml;
158
                                        return $rdfxml;
153
									}
159
                                    }
154
								}
160
                                }
155
							}
161
                            }
156
						}
162
                        }
157
                    }
163
                    }
158
                }
164
                }
159
            }
165
            }
Lines 217-223 sub _find_rdf_link { Link Here
217
    return ($subject,$graph);
223
    return ($subject,$graph);
218
}
224
}
219
225
220
=head3
226
=head3 import_record
221
227
222
    my ($action,$record_id) = $oai_record->import_record({
228
    my ($action,$record_id) = $oai_record->import_record({
223
        filter => $filter,
229
        filter => $filter,
Lines 247-255 sub import_record { Link Here
247
    });
253
    });
248
254
249
    #NOTE: RDF
255
    #NOTE: RDF
250
    my $context = C4::Context->new();
251
    #Find linkage between OAI-PMH repository-identifier and RDF records in the triplestore
256
    #Find linkage between OAI-PMH repository-identifier and RDF records in the triplestore
252
    my ($linked_subject, $linked_graph) = $self->_find_rdf_link if $context && $context->triplestore('query');
257
    my ($linked_subject, $linked_graph);
258
    my $context = C4::Context->new();
259
    if ( $context && $context->triplestore('query') ){
260
        ($linked_subject, $linked_graph) = $self->_find_rdf_link;
261
    }
253
262
254
    if ($self->is_deleted_upstream){
263
    if ($self->is_deleted_upstream){
255
        #FIXME: If a record is deleted upstream, it will not contain a metadata element, so we don't know what metadata
264
        #FIXME: If a record is deleted upstream, it will not contain a metadata element, so we don't know what metadata
Lines 259-265 sub import_record { Link Here
259
        #https://www.openarchives.org/OAI/openarchivesprotocol.html#DeletedRecords
268
        #https://www.openarchives.org/OAI/openarchivesprotocol.html#DeletedRecords
260
269
261
        if ($linked_graph){
270
        if ($linked_graph){
262
            my $model = $context->triplestore('update') if $context && $context->triplestore('update');
271
            my $model;
272
            if ( $context && $context->triplestore('update') ){
273
                $model = $context->triplestore('update');
274
            }
263
            my $rdf = Koha::RDF->new();
275
            my $rdf = Koha::RDF->new();
264
            if ($rdf){
276
            if ($rdf){
265
                $model->begin_bulk_ops;
277
                $model->begin_bulk_ops;
Lines 321-328 sub import_record { Link Here
321
            #NOTE: Link Koha RDF to Imported RDF
333
            #NOTE: Link Koha RDF to Imported RDF
322
            if ( ($record_type && $linked_id) && ($linked_subject) ){
334
            if ( ($record_type && $linked_id) && ($linked_subject) ){
323
                my $rdf = Koha::RDF->new();
335
                my $rdf = Koha::RDF->new();
336
                my $triplestore;
324
                my $context = C4::Context->new();
337
                my $context = C4::Context->new();
325
                my $triplestore = $context->triplestore('update') if $context && $context->triplestore('update');
338
                if ( $context && $context->triplestore('update') ){
339
                    $triplestore = $context->triplestore('update');
340
                }
326
                if ( $triplestore && $rdf ){
341
                if ( $triplestore && $rdf ){
327
                    my $koha_uri = $rdf->mint_uri($record_type, $linked_id);
342
                    my $koha_uri = $rdf->mint_uri($record_type, $linked_id);
328
                    my $koha_subject = RDF::Trine::Node::Resource->new($koha_uri);
343
                    my $koha_subject = RDF::Trine::Node::Resource->new($koha_uri);
Lines 377-387 sub link_koha_record { Link Here
377
sub delete_koha_record {
392
sub delete_koha_record {
378
    my ($self, $args) = @_;
393
    my ($self, $args) = @_;
379
    my $record_type = $args->{record_type} // "biblio";
394
    my $record_type = $args->{record_type} // "biblio";
380
	my $record_id = $args->{record_id};
395
    my $record_id = $args->{record_id};
381
396
382
    my $action = "error";
397
    my $action = "error";
383
398
384
	if ($record_type eq "biblio"){
399
    if ($record_type eq "biblio"){
385
        my $error = C4::Biblio::DelBiblio($record_id);
400
        my $error = C4::Biblio::DelBiblio($record_id);
386
        if (!$error){
401
        if (!$error){
387
            $action = "deleted";
402
            $action = "deleted";
(-)a/Koha/OAI/Harvester/Request.pm (-51 / +51 lines)
Lines 63-118 sub validate { Link Here
63
            #Step three: validate OAI-PMH parameters
63
            #Step three: validate OAI-PMH parameters
64
64
65
            #Test Set
65
            #Test Set
66
			my $set = $self->oai_set;
66
            my $set = $self->oai_set;
67
            if ($set){
67
            if ($set){
68
                my $set_response = $harvester->ListSets();
68
                my $set_response = $harvester->ListSets();
69
				my @server_sets = $set_response->set;
69
                my @server_sets = $set_response->set;
70
				if ( ! grep {$_->setSpec eq $set} @server_sets ){
70
                if ( ! grep {$_->setSpec eq $set} @server_sets ){
71
                    $errors->{oai_set}->{unavailable} = 1;
71
                    $errors->{oai_set}->{unavailable} = 1;
72
                }
72
                }
73
            }
73
            }
74
74
75
            #Test Metadata Prefix
75
            #Test Metadata Prefix
76
			my $metadataPrefix = $self->oai_metadataPrefix;
76
            my $metadataPrefix = $self->oai_metadataPrefix;
77
			if ($metadataPrefix){
77
            if ($metadataPrefix){
78
				my $metadata_response = $harvester->ListMetadataFormats();
78
                my $metadata_response = $harvester->ListMetadataFormats();
79
				my @server_formats = $metadata_response->metadataFormat;
79
                my @server_formats = $metadata_response->metadataFormat;
80
				if ( ! grep { $_->metadataPrefix eq $metadataPrefix } @server_formats ){
80
                if ( ! grep { $_->metadataPrefix eq $metadataPrefix } @server_formats ){
81
                    $errors->{oai_metadataPrefix}->{unavailable} = 1;
81
                    $errors->{oai_metadataPrefix}->{unavailable} = 1;
82
                }
82
                }
83
			}
83
            }
84
            else {
84
            else {
85
                $errors->{oai_metadataPrefix}->{missing} = 1;
85
                $errors->{oai_metadataPrefix}->{missing} = 1;
86
            }
86
            }
87
87
88
            #Test Granularity and Timestamps
88
            #Test Granularity and Timestamps
89
			my $server_granularity = $identify->granularity;
89
            my $server_granularity = $identify->granularity;
90
			my $from = $self->oai_from;
90
            my $from = $self->oai_from;
91
			my $until = $self->oai_until;
91
            my $until = $self->oai_until;
92
			if ($from || $until){
92
            if ($from || $until){
93
				my ($from_granularity,$until_granularity);
93
                my ($from_granularity,$until_granularity);
94
				if ($from){
94
                if ($from){
95
					$from_granularity = _determine_granularity($from);
95
                    $from_granularity = _determine_granularity($from);
96
					if ($from_granularity eq "YYYY-MM-DDThh:mm:ssZ"){
96
                    if ($from_granularity eq "YYYY-MM-DDThh:mm:ssZ"){
97
						$errors->{oai_from}->{unavailable} = 1 if $server_granularity ne $from_granularity;
97
                        $errors->{oai_from}->{unavailable} = 1 if $server_granularity ne $from_granularity;
98
					} elsif ($from_granularity eq "failed"){
98
                    } elsif ($from_granularity eq "failed"){
99
						$errors->{oai_from}->{malformed} = 1;
99
                        $errors->{oai_from}->{malformed} = 1;
100
					}
100
                    }
101
				}
101
                }
102
				if ($until){
102
                if ($until){
103
					$until_granularity = _determine_granularity($until);
103
                    $until_granularity = _determine_granularity($until);
104
					if ($until_granularity eq "YYYY-MM-DDThh:mm:ssZ"){
104
                    if ($until_granularity eq "YYYY-MM-DDThh:mm:ssZ"){
105
						$errors->{oai_until}->{unavailable} = 1 if $server_granularity ne $until_granularity;
105
                        $errors->{oai_until}->{unavailable} = 1 if $server_granularity ne $until_granularity;
106
					} elsif ($until_granularity eq "failed"){
106
                    } elsif ($until_granularity eq "failed"){
107
						$errors->{oai_until}->{malformed} = 1;
107
                        $errors->{oai_until}->{malformed} = 1;
108
					}
108
                    }
109
				}
109
                }
110
				if ($from && $until){
110
                if ($from && $until){
111
					if ($from_granularity ne $until_granularity){
111
                    if ($from_granularity ne $until_granularity){
112
						$errors->{oai}->{granularity_mismatch} = 1;
112
                        $errors->{oai}->{granularity_mismatch} = 1;
113
					}
113
                    }
114
				}
114
                }
115
			}
115
            }
116
116
117
            #Test if identifier is provided when using GetRecord
117
            #Test if identifier is provided when using GetRecord
118
            my $verb = $self->oai_verb;
118
            my $verb = $self->oai_verb;
Lines 167-173 sub _harvester { Link Here
167
    my $harvester;
167
    my $harvester;
168
    if ($self->http_url){
168
    if ($self->http_url){
169
        $harvester = new HTTP::OAI::Harvester( baseURL => $self->http_url );
169
        $harvester = new HTTP::OAI::Harvester( baseURL => $self->http_url );
170
		my $uri = URI->new($self->http_url);
170
        my $uri = URI->new($self->http_url);
171
        if ($uri->scheme && ($uri->scheme eq 'http' || $uri->scheme eq 'https') ){
171
        if ($uri->scheme && ($uri->scheme eq 'http' || $uri->scheme eq 'https') ){
172
            my $host = $uri->host;
172
            my $host = $uri->host;
173
            my $port = $uri->port;
173
            my $port = $uri->port;
Lines 178-197 sub _harvester { Link Here
178
}
178
}
179
179
180
sub _determine_granularity {
180
sub _determine_granularity {
181
	my ($timestamp) = @_;
181
    my ($timestamp) = @_;
182
	my $granularity;
182
    my $granularity;
183
	if ($timestamp =~ /^(\d{4}-\d{2}-\d{2})(T\d{2}:\d{2}:\d{2}Z)?$/){
183
    if ($timestamp =~ /^(\d{4}-\d{2}-\d{2})(T\d{2}:\d{2}:\d{2}Z)?$/){
184
		if ($1 && $2){
184
        if ($1 && $2){
185
			$granularity = "YYYY-MM-DDThh:mm:ssZ";
185
            $granularity = "YYYY-MM-DDThh:mm:ssZ";
186
		} elsif ($1 && !$2){
186
        } elsif ($1 && !$2){
187
			$granularity = "YYYY-MM-DD";
187
            $granularity = "YYYY-MM-DD";
188
		} else {
188
        } else {
189
			$granularity = "failed";
189
            $granularity = "failed";
190
		}
190
        }
191
	} else {
191
    } else {
192
		$granularity = "failed";
192
        $granularity = "failed";
193
	}
193
    }
194
	return $granularity;
194
    return $granularity;
195
}
195
}
196
196
197
=head1 AUTHOR
197
=head1 AUTHOR
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 4275-4281 CREATE TABLE IF NOT EXISTS `oai_harvester_requests` ( Link Here
4275
  `name` varchar(45) NOT NULL,
4275
  `name` varchar(45) NOT NULL,
4276
  `import_rdf_type` varchar(255) DEFAULT NULL,
4276
  `import_rdf_type` varchar(255) DEFAULT NULL,
4277
  PRIMARY KEY (`id`)
4277
  PRIMARY KEY (`id`)
4278
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
4278
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4279
4279
4280
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4280
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4281
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4281
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc (-17 / +17 lines)
Lines 6-27 Link Here
6
<h5>Patrons and circulation</h5>
6
<h5>Patrons and circulation</h5>
7
<ul>
7
<ul>
8
    [% IF ( CAN_user_tools_manage_patron_lists ) %]
8
    [% IF ( CAN_user_tools_manage_patron_lists ) %]
9
	<li><a href="/cgi-bin/koha/patron_lists/lists.pl">Patron lists</a></li>
9
    <li><a href="/cgi-bin/koha/patron_lists/lists.pl">Patron lists</a></li>
10
    [% END %]
10
    [% END %]
11
    [% IF (CAN_user_clubs) %]
11
    [% IF (CAN_user_clubs) %]
12
        <li><a href="/cgi-bin/koha/clubs/clubs.pl">Patron clubs</a></li>
12
        <li><a href="/cgi-bin/koha/clubs/clubs.pl">Patron clubs</a></li>
13
    [% END %]
13
    [% END %]
14
    [% IF ( CAN_user_tools_moderate_comments ) %]
14
    [% IF ( CAN_user_tools_moderate_comments ) %]
15
	<li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></li>
15
    <li><a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments</a></li>
16
    [% END %]
16
    [% END %]
17
    [% IF ( CAN_user_tools_import_patrons ) %]
17
    [% IF ( CAN_user_tools_import_patrons ) %]
18
	<li><a href="/cgi-bin/koha/tools/import_borrowers.pl">Import patrons</a></li>
18
    <li><a href="/cgi-bin/koha/tools/import_borrowers.pl">Import patrons</a></li>
19
    [% END %]
19
    [% END %]
20
    [% IF ( CAN_user_tools_edit_notices ) %]
20
    [% IF ( CAN_user_tools_edit_notices ) %]
21
    <li><a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a></li>
21
    <li><a href="/cgi-bin/koha/tools/letter.pl">Notices &amp; slips</a></li>
22
    [% END %]
22
    [% END %]
23
    [% IF ( CAN_user_tools_edit_notice_status_triggers ) %]
23
    [% IF ( CAN_user_tools_edit_notice_status_triggers ) %]
24
	<li><a href="/cgi-bin/koha/tools/overduerules.pl">Overdue notice/status triggers</a></li>
24
    <li><a href="/cgi-bin/koha/tools/overduerules.pl">Overdue notice/status triggers</a></li>
25
    [% END %]
25
    [% END %]
26
    [% IF ( CAN_user_tools_label_creator ) %]
26
    [% IF ( CAN_user_tools_label_creator ) %]
27
    <li><a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a></li>
27
    <li><a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a></li>
Lines 36-51 Link Here
36
    <li><a href="/cgi-bin/koha/tags/review.pl">Tag moderation</a></li>
36
    <li><a href="/cgi-bin/koha/tags/review.pl">Tag moderation</a></li>
37
    [% END %]
37
    [% END %]
38
    [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
38
    [% IF ( CAN_user_tools_batch_upload_patron_images ) %]
39
	<li><a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a></li>
39
    <li><a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a></li>
40
    [% END %]
40
    [% END %]
41
</ul>
41
</ul>
42
<h5>Catalog</h5>
42
<h5>Catalog</h5>
43
<ul>
43
<ul>
44
    [% IF ( CAN_user_tools_items_batchdel ) %]
44
    [% IF ( CAN_user_tools_items_batchdel ) %]
45
	<li><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a></li>
45
    <li><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a></li>
46
    [% END %]
46
    [% END %]
47
    [% IF ( CAN_user_tools_items_batchmod ) %]
47
    [% IF ( CAN_user_tools_items_batchmod ) %]
48
	<li><a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a></li>
48
    <li><a href="/cgi-bin/koha/tools/batchMod.pl">Batch item modification</a></li>
49
    [% END %]
49
    [% END %]
50
    [% IF CAN_user_tools_records_batchdel %]
50
    [% IF CAN_user_tools_records_batchdel %]
51
      <li><a href="/cgi-bin/koha/tools/batch_delete_records.pl">Batch record deletion</a></li>
51
      <li><a href="/cgi-bin/koha/tools/batch_delete_records.pl">Batch record deletion</a></li>
Lines 63-70 Link Here
63
        <li><a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a></li>
63
        <li><a href="/cgi-bin/koha/tools/inventory.pl">Inventory</a></li>
64
    [% END %]
64
    [% END %]
65
    [% IF ( CAN_user_tools_label_creator ) %]
65
    [% IF ( CAN_user_tools_label_creator ) %]
66
	<li><a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a></li>
66
    <li><a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a></li>
67
	<li><a href="/cgi-bin/koha/labels/spinelabel-home.pl">Quick spine label creator</a></li>
67
    <li><a href="/cgi-bin/koha/labels/spinelabel-home.pl">Quick spine label creator</a></li>
68
    [% END %]
68
    [% END %]
69
    [% IF ( CAN_user_tools_rotating_collections ) %]
69
    [% IF ( CAN_user_tools_rotating_collections ) %]
70
    <li><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a></li>
70
    <li><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a></li>
Lines 73-106 Link Here
73
        <li><a href="/cgi-bin/koha/tools/marc_modification_templates.pl">Manage MARC modification templates</a></li>
73
        <li><a href="/cgi-bin/koha/tools/marc_modification_templates.pl">Manage MARC modification templates</a></li>
74
    [% END %]
74
    [% END %]
75
    [% IF ( CAN_user_tools_stage_marc_import ) %]
75
    [% IF ( CAN_user_tools_stage_marc_import ) %]
76
	<li><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC for import</a></li>
76
    <li><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC for import</a></li>
77
    [% END %]
77
    [% END %]
78
    [% IF ( CAN_user_tools_manage_staged_marc ) %]
78
    [% IF ( CAN_user_tools_manage_staged_marc ) %]
79
	<li><a href="/cgi-bin/koha/tools/manage-marc-import.pl">Staged MARC management</a></li>
79
    <li><a href="/cgi-bin/koha/tools/manage-marc-import.pl">Staged MARC management</a></li>
80
    [% END %]
80
    [% END %]
81
    [% IF ( CAN_user_tools_upload_local_cover_images ) %]
81
    [% IF ( CAN_user_tools_upload_local_cover_images ) %]
82
    <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a></li>
82
    <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a></li>
83
    [% END %]
83
    [% END %]
84
    [% IF ( CAN_user_tools_manage_staged_marc ) %]
84
    [% IF ( CAN_user_tools_manage_staged_marc ) %]
85
	<li><a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a></li>
85
    <li><a href="/cgi-bin/koha/tools/oai-pmh-harvester/dashboard.pl">OAI-PMH harvester</a></li>
86
    [% END %]
86
    [% END %]
87
</ul>
87
</ul>
88
<h5>Additional tools</h5>
88
<h5>Additional tools</h5>
89
<ul>
89
<ul>
90
    [% IF ( CAN_user_tools_edit_calendar ) %]
90
    [% IF ( CAN_user_tools_edit_calendar ) %]
91
	<li><a href="/cgi-bin/koha/tools/holidays.pl">Calendar</a></li>
91
    <li><a href="/cgi-bin/koha/tools/holidays.pl">Calendar</a></li>
92
    [% END %]
92
    [% END %]
93
    [% IF ( CAN_user_tools_manage_csv_profiles ) %]
93
    [% IF ( CAN_user_tools_manage_csv_profiles ) %]
94
	<li><a href="/cgi-bin/koha/tools/csv-profiles.pl">CSV profiles</a></li>
94
    <li><a href="/cgi-bin/koha/tools/csv-profiles.pl">CSV profiles</a></li>
95
    [% END %]
95
    [% END %]
96
    [% IF ( CAN_user_tools_view_system_logs ) %]
96
    [% IF ( CAN_user_tools_view_system_logs ) %]
97
	<li><a href="/cgi-bin/koha/tools/viewlog.pl">Log viewer</a></li>
97
    <li><a href="/cgi-bin/koha/tools/viewlog.pl">Log viewer</a></li>
98
    [% END %]
98
    [% END %]
99
    [% IF ( CAN_user_tools_edit_news ) %]
99
    [% IF ( CAN_user_tools_edit_news ) %]
100
	<li><a href="/cgi-bin/koha/tools/koha-news.pl">News</a></li>
100
    <li><a href="/cgi-bin/koha/tools/koha-news.pl">News</a></li>
101
    [% END %]
101
    [% END %]
102
    [% IF ( CAN_user_tools_schedule_tasks ) %]
102
    [% IF ( CAN_user_tools_schedule_tasks ) %]
103
	<li><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></li>
103
    <li><a href="/cgi-bin/koha/tools/scheduler.pl">Task scheduler</a></li>
104
    [% END %]
104
    [% END %]
105
    [% IF ( CAN_user_tools_edit_quotes ) %]
105
    [% IF ( CAN_user_tools_edit_quotes ) %]
106
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
106
       <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/oai-pmh-harvester/dashboard.tt (-15 / +12 lines)
Lines 284-296 Link Here
284
                                                [% END %]
284
                                                [% END %]
285
                                            </td>
285
                                            </td>
286
                                            <td>
286
                                            <td>
287
                                                [%  display_framework = "";
287
                                                [% display_framework = "" %]
288
                                                    FOREACH framework IN frameworks;
288
                                                [% FOREACH framework IN frameworks %]
289
                                                        IF ( framework.frameworkcode == saved_request.import_framework_code );
289
                                                    [% IF ( framework.frameworkcode == saved_request.import_framework_code ) %]
290
                                                            display_framework = framework;
290
                                                        [% display_framework = framework %]
291
                                                        END;
291
                                                    [% END %]
292
                                                    END;
292
                                                [% END %]
293
                                                %]
294
                                                [% IF ( display_framework ) %]
293
                                                [% IF ( display_framework ) %]
295
                                                    [% display_framework.frameworktext %]
294
                                                    [% display_framework.frameworktext %]
296
                                                [% ELSE %]
295
                                                [% ELSE %]
Lines 305-317 Link Here
305
                                                [% END %]
304
                                                [% END %]
306
                                            </td>
305
                                            </td>
307
                                            <td>
306
                                            <td>
308
                                                [%  display_matcher = "";
307
                                                [% display_matcher = "" %]
309
                                                    FOREACH matcher IN matchers;
308
                                                [% FOREACH matcher IN matchers %]
310
                                                        IF ( matcher.code == saved_request.import_matcher_code );
309
                                                    [% IF ( matcher.code == saved_request.import_matcher_code ) %]
311
                                                            display_matcher = matcher;
310
                                                        [% display_matcher = matcher %]
312
                                                        END;
311
                                                    [% END %]
313
                                                    END;
312
                                                [% END %]
314
                                                %]
315
                                                [% IF ( display_matcher ) %]
313
                                                [% IF ( display_matcher ) %]
316
                                                    [% display_matcher.description %]
314
                                                    [% display_matcher.description %]
317
                                                [% ELSE %]
315
                                                [% ELSE %]
318
- 

Return to bug 10662