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

(-)a/C4/Auth_with_ldap.pm (-90 / +90 lines)
Lines 457-546 C4::Auth - Authenticates Koha users Link Here
457
=head1 LDAP Configuration
457
=head1 LDAP Configuration
458
458
459
    This module is specific to LDAP authentication. It requires Net::LDAP package and one or more
459
    This module is specific to LDAP authentication. It requires Net::LDAP package and one or more
460
	working LDAP servers.
460
    working LDAP servers.
461
	To use it :
461
    To use it :
462
	   * Modify ldapserver element in KOHA_CONF
462
       * Modify ldapserver element in KOHA_CONF
463
	   * Establish field mapping in <mapping> element.
463
       * Establish field mapping in <mapping> element.
464
464
465
	For example, if your user records are stored according to the inetOrgPerson schema, RFC#2798,
465
    For example, if your user records are stored according to the inetOrgPerson schema, RFC#2798,
466
	the username would match the "uid" field, and the password should match the "userpassword" field.
466
    the username would match the "uid" field, and the password should match the "userpassword" field.
467
467
468
	Make sure that ALL required fields are populated by your LDAP database (and mapped in KOHA_CONF).  
468
    Make sure that ALL required fields are populated by your LDAP database (and mapped in KOHA_CONF).  
469
	What are the required fields?  Well, in mysql you can check the database table "borrowers" like this:
469
    What are the required fields?  Well, in mysql you can check the database table "borrowers" like this:
470
470
471
	mysql> show COLUMNS from borrowers;
471
    mysql> show COLUMNS from borrowers;
472
		+---------------------+--------------+------+-----+---------+----------------+
472
        +---------------------+--------------+------+-----+---------+----------------+
473
		| Field               | Type         | Null | Key | Default | Extra          |
473
        | Field               | Type         | Null | Key | Default | Extra          |
474
		+---------------------+--------------+------+-----+---------+----------------+
474
        +---------------------+--------------+------+-----+---------+----------------+
475
		| borrowernumber      | int(11)      | NO   | PRI | NULL    | auto_increment |
475
        | borrowernumber      | int(11)      | NO   | PRI | NULL    | auto_increment |
476
		| cardnumber          | varchar(16)  | YES  | UNI | NULL    |                |
476
        | cardnumber          | varchar(16)  | YES  | UNI | NULL    |                |
477
		| surname             | mediumtext   | NO   |     | NULL    |                |
477
        | surname             | mediumtext   | NO   |     | NULL    |                |
478
		| firstname           | text         | YES  |     | NULL    |                |
478
        | firstname           | text         | YES  |     | NULL    |                |
479
		| title               | mediumtext   | YES  |     | NULL    |                |
479
        | title               | mediumtext   | YES  |     | NULL    |                |
480
		| othernames          | mediumtext   | YES  |     | NULL    |                |
480
        | othernames          | mediumtext   | YES  |     | NULL    |                |
481
		| initials            | text         | YES  |     | NULL    |                |
481
        | initials            | text         | YES  |     | NULL    |                |
482
		| streetnumber        | varchar(10)  | YES  |     | NULL    |                |
482
        | streetnumber        | varchar(10)  | YES  |     | NULL    |                |
483
		| streettype          | varchar(50)  | YES  |     | NULL    |                |
483
        | streettype          | varchar(50)  | YES  |     | NULL    |                |
484
		| address             | mediumtext   | NO   |     | NULL    |                |
484
        | address             | mediumtext   | NO   |     | NULL    |                |
485
		| address2            | text         | YES  |     | NULL    |                |
485
        | address2            | text         | YES  |     | NULL    |                |
486
		| city                | mediumtext   | NO   |     | NULL    |                |
486
        | city                | mediumtext   | NO   |     | NULL    |                |
487
		| state               | mediumtext   | YES  |     | NULL    |                |
487
        | state               | mediumtext   | YES  |     | NULL    |                |
488
		| zipcode             | varchar(25)  | YES  |     | NULL    |                |
488
        | zipcode             | varchar(25)  | YES  |     | NULL    |                |
489
		| country             | text         | YES  |     | NULL    |                |
489
        | country             | text         | YES  |     | NULL    |                |
490
		| email               | mediumtext   | YES  |     | NULL    |                |
490
        | email               | mediumtext   | YES  |     | NULL    |                |
491
		| phone               | text         | YES  |     | NULL    |                |
491
        | phone               | text         | YES  |     | NULL    |                |
492
		| mobile              | varchar(50)  | YES  |     | NULL    |                |
492
        | mobile              | varchar(50)  | YES  |     | NULL    |                |
493
		| fax                 | mediumtext   | YES  |     | NULL    |                |
493
        | fax                 | mediumtext   | YES  |     | NULL    |                |
494
		| emailpro            | text         | YES  |     | NULL    |                |
494
        | emailpro            | text         | YES  |     | NULL    |                |
495
		| phonepro            | text         | YES  |     | NULL    |                |
495
        | phonepro            | text         | YES  |     | NULL    |                |
496
		| B_streetnumber      | varchar(10)  | YES  |     | NULL    |                |
496
        | B_streetnumber      | varchar(10)  | YES  |     | NULL    |                |
497
		| B_streettype        | varchar(50)  | YES  |     | NULL    |                |
497
        | B_streettype        | varchar(50)  | YES  |     | NULL    |                |
498
		| B_address           | varchar(100) | YES  |     | NULL    |                |
498
        | B_address           | varchar(100) | YES  |     | NULL    |                |
499
		| B_address2          | text         | YES  |     | NULL    |                |
499
        | B_address2          | text         | YES  |     | NULL    |                |
500
		| B_city              | mediumtext   | YES  |     | NULL    |                |
500
        | B_city              | mediumtext   | YES  |     | NULL    |                |
501
		| B_state             | mediumtext   | YES  |     | NULL    |                |
501
        | B_state             | mediumtext   | YES  |     | NULL    |                |
502
		| B_zipcode           | varchar(25)  | YES  |     | NULL    |                |
502
        | B_zipcode           | varchar(25)  | YES  |     | NULL    |                |
503
		| B_country           | text         | YES  |     | NULL    |                |
503
        | B_country           | text         | YES  |     | NULL    |                |
504
		| B_email             | text         | YES  |     | NULL    |                |
504
        | B_email             | text         | YES  |     | NULL    |                |
505
		| B_phone             | mediumtext   | YES  |     | NULL    |                |
505
        | B_phone             | mediumtext   | YES  |     | NULL    |                |
506
		| dateofbirth         | date         | YES  |     | NULL    |                |
506
        | dateofbirth         | date         | YES  |     | NULL    |                |
507
		| branchcode          | varchar(10)  | NO   | MUL |         |                |
507
        | branchcode          | varchar(10)  | NO   | MUL |         |                |
508
		| categorycode        | varchar(10)  | NO   | MUL |         |                |
508
        | categorycode        | varchar(10)  | NO   | MUL |         |                |
509
		| dateenrolled        | date         | YES  |     | NULL    |                |
509
        | dateenrolled        | date         | YES  |     | NULL    |                |
510
		| dateexpiry          | date         | YES  |     | NULL    |                |
510
        | dateexpiry          | date         | YES  |     | NULL    |                |
511
		| gonenoaddress       | tinyint(1)   | YES  |     | NULL    |                |
511
        | gonenoaddress       | tinyint(1)   | YES  |     | NULL    |                |
512
		| lost                | tinyint(1)   | YES  |     | NULL    |                |
512
        | lost                | tinyint(1)   | YES  |     | NULL    |                |
513
		| debarred            | date         | YES  |     | NULL    |                |
513
        | debarred            | date         | YES  |     | NULL    |                |
514
		| debarredcomment     | varchar(255) | YES  |     | NULL    |                |
514
        | debarredcomment     | varchar(255) | YES  |     | NULL    |                |
515
		| contactname         | mediumtext   | YES  |     | NULL    |                |
515
        | contactname         | mediumtext   | YES  |     | NULL    |                |
516
		| contactfirstname    | text         | YES  |     | NULL    |                |
516
        | contactfirstname    | text         | YES  |     | NULL    |                |
517
		| contacttitle        | text         | YES  |     | NULL    |                |
517
        | contacttitle        | text         | YES  |     | NULL    |                |
518
		| borrowernotes       | mediumtext   | YES  |     | NULL    |                |
518
        | borrowernotes       | mediumtext   | YES  |     | NULL    |                |
519
		| relationship        | varchar(100) | YES  |     | NULL    |                |
519
        | relationship        | varchar(100) | YES  |     | NULL    |                |
520
		| ethnicity           | varchar(50)  | YES  |     | NULL    |                |
520
        | ethnicity           | varchar(50)  | YES  |     | NULL    |                |
521
		| ethnotes            | varchar(255) | YES  |     | NULL    |                |
521
        | ethnotes            | varchar(255) | YES  |     | NULL    |                |
522
		| sex                 | varchar(1)   | YES  |     | NULL    |                |
522
        | sex                 | varchar(1)   | YES  |     | NULL    |                |
523
		| password            | varchar(30)  | YES  |     | NULL    |                |
523
        | password            | varchar(30)  | YES  |     | NULL    |                |
524
		| flags               | int(11)      | YES  |     | NULL    |                |
524
        | flags               | int(11)      | YES  |     | NULL    |                |
525
		| userid              | varchar(30)  | YES  | MUL | NULL    |                |
525
        | userid              | varchar(30)  | YES  | MUL | NULL    |                |
526
		| opacnote            | mediumtext   | YES  |     | NULL    |                |
526
        | opacnote            | mediumtext   | YES  |     | NULL    |                |
527
		| contactnote         | varchar(255) | YES  |     | NULL    |                |
527
        | contactnote         | varchar(255) | YES  |     | NULL    |                |
528
		| sort1               | varchar(80)  | YES  |     | NULL    |                |
528
        | sort1               | varchar(80)  | YES  |     | NULL    |                |
529
		| sort2               | varchar(80)  | YES  |     | NULL    |                |
529
        | sort2               | varchar(80)  | YES  |     | NULL    |                |
530
		| altcontactfirstname | varchar(255) | YES  |     | NULL    |                |
530
        | altcontactfirstname | varchar(255) | YES  |     | NULL    |                |
531
		| altcontactsurname   | varchar(255) | YES  |     | NULL    |                |
531
        | altcontactsurname   | varchar(255) | YES  |     | NULL    |                |
532
		| altcontactaddress1  | varchar(255) | YES  |     | NULL    |                |
532
        | altcontactaddress1  | varchar(255) | YES  |     | NULL    |                |
533
		| altcontactaddress2  | varchar(255) | YES  |     | NULL    |                |
533
        | altcontactaddress2  | varchar(255) | YES  |     | NULL    |                |
534
		| altcontactaddress3  | varchar(255) | YES  |     | NULL    |                |
534
        | altcontactaddress3  | varchar(255) | YES  |     | NULL    |                |
535
		| altcontactstate     | mediumtext   | YES  |     | NULL    |                |
535
        | altcontactstate     | mediumtext   | YES  |     | NULL    |                |
536
		| altcontactzipcode   | varchar(50)  | YES  |     | NULL    |                |
536
        | altcontactzipcode   | varchar(50)  | YES  |     | NULL    |                |
537
		| altcontactcountry   | text         | YES  |     | NULL    |                |
537
        | altcontactcountry   | text         | YES  |     | NULL    |                |
538
		| altcontactphone     | varchar(50)  | YES  |     | NULL    |                |
538
        | altcontactphone     | varchar(50)  | YES  |     | NULL    |                |
539
		| smsalertnumber      | varchar(50)  | YES  |     | NULL    |                |
539
        | smsalertnumber      | varchar(50)  | YES  |     | NULL    |                |
540
		| privacy             | int(11)      | NO   |     | 1       |                |
540
        | privacy             | int(11)      | NO   |     | 1       |                |
541
		+---------------------+--------------+------+-----+---------+----------------+
541
        +---------------------+--------------+------+-----+---------+----------------+
542
		66 rows in set (0.00 sec)
542
        66 rows in set (0.00 sec)
543
		Where Null="NO", the field is required.
543
        Where Null="NO", the field is required.
544
544
545
=head1 KOHA_CONF and field mapping
545
=head1 KOHA_CONF and field mapping
546
546
Lines 678-688 sprintf() Link Here
678
# Using attrs instead of {asn}->attributes
678
# Using attrs instead of {asn}->attributes
679
# ========================================
679
# ========================================
680
#
680
#
681
# 	LDAP key: ->{             cn} = ARRAY w/ 3 members.
681
#     LDAP key: ->{             cn} = ARRAY w/ 3 members.
682
# 	LDAP key: ->{             cn}->{           sss} = sss
682
#     LDAP key: ->{             cn}->{           sss} = sss
683
# 	LDAP key: ->{             cn}->{   Steve Smith} = Steve Smith
683
#     LDAP key: ->{             cn}->{   Steve Smith} = Steve Smith
684
# 	LDAP key: ->{             cn}->{Steve S. Smith} = Steve S. Smith
684
#     LDAP key: ->{             cn}->{Steve S. Smith} = Steve S. Smith
685
#
685
#
686
# 	LDAP key: ->{      givenname} = ARRAY w/ 1 members.
686
#     LDAP key: ->{      givenname} = ARRAY w/ 1 members.
687
# 	LDAP key: ->{      givenname}->{Steve} = Steve
687
#     LDAP key: ->{      givenname}->{Steve} = Steve
688
#
688
#
(-)a/C4/AuthoritiesMarc.pm (-11 / +11 lines)
Lines 388-405 sub GuessAuthTypeCode { Link Here
388
            '185' => { authtypecode => 'FORM_SUBD' },
388
            '185' => { authtypecode => 'FORM_SUBD' },
389
        },
389
        },
390
390
391
        #200 Personal name	700, 701, 702 4-- with embedded 700, 701, 702 600
391
        #200 Personal name    700, 701, 702 4-- with embedded 700, 701, 702 600
392
        #                    604 with embedded 700, 701, 702
392
        #                    604 with embedded 700, 701, 702
393
        #210 Corporate or meeting name	710, 711, 712 4-- with embedded 710, 711, 712 601 604 with embedded 710, 711, 712
393
        #210 Corporate or meeting name    710, 711, 712 4-- with embedded 710, 711, 712 601 604 with embedded 710, 711, 712
394
        #215 Territorial or geographic name 	710, 711, 712 4-- with embedded 710, 711, 712 601, 607 604 with embedded 710, 711, 712
394
        #215 Territorial or geographic name     710, 711, 712 4-- with embedded 710, 711, 712 601, 607 604 with embedded 710, 711, 712
395
        #216 Trademark 	716 [Reserved for future use]
395
        #216 Trademark     716 [Reserved for future use]
396
        #220 Family name 	720, 721, 722 4-- with embedded 720, 721, 722 602 604 with embedded 720, 721, 722
396
        #220 Family name     720, 721, 722 4-- with embedded 720, 721, 722 602 604 with embedded 720, 721, 722
397
        #230 Title 	500 4-- with embedded 500 605
397
        #230 Title     500 4-- with embedded 500 605
398
        #240 Name and title (embedded 200, 210, 215, or 220 and 230) 	4-- with embedded 7-- and 500 7--  604 with embedded 7-- and 500 500
398
        #240 Name and title (embedded 200, 210, 215, or 220 and 230)     4-- with embedded 7-- and 500 7--  604 with embedded 7-- and 500 500
399
        #245 Name and collective title (embedded 200, 210, 215, or 220 and 235) 	4-- with embedded 7-- and 501 604 with embedded 7-- and 501 7-- 501
399
        #245 Name and collective title (embedded 200, 210, 215, or 220 and 235)     4-- with embedded 7-- and 501 604 with embedded 7-- and 501 7-- 501
400
        #250 Topical subject 	606
400
        #250 Topical subject     606
401
        #260 Place access 	620
401
        #260 Place access     620
402
        #280 Form, genre or physical characteristics 	608
402
        #280 Form, genre or physical characteristics     608
403
        #
403
        #
404
        #
404
        #
405
        # Could also be represented with :
405
        # Could also be represented with :
(-)a/C4/Barcodes.pm (-8 / +8 lines)
Lines 245-263 The default behavior here in Barcodes should be essentially a more flexible vers Link Here
245
245
246
To add a new barcode format, a developer should:
246
To add a new barcode format, a developer should:
247
247
248
	create a module in C4/Barcodes/, like C4/Barcodes/my_new_format.pm;
248
    create a module in C4/Barcodes/, like C4/Barcodes/my_new_format.pm;
249
	add to the $types hashref in this file; 
249
    add to the $types hashref in this file; 
250
	add tests under the "t" directory; and
250
    add tests under the "t" directory; and
251
	edit autoBarcode syspref to include new type.
251
    edit autoBarcode syspref to include new type.
252
252
253
=head2 Adding a new module
253
=head2 Adding a new module
254
254
255
Each new module that needs differing behavior must override these subs:
255
Each new module that needs differing behavior must override these subs:
256
256
257
	new_object
257
    new_object
258
	initial
258
    initial
259
	db_max
259
    db_max
260
	parse
260
    parse
261
261
262
Or else the CLASS subs will be used.
262
Or else the CLASS subs will be used.
263
263
(-)a/C4/Budgets.pm (-1 / +1 lines)
Lines 620-626 sub DelBudgetPeriod { Link Here
620
    ## get information about the record that will be deleted
620
    ## get information about the record that will be deleted
621
    my $sth = $dbh->prepare(
621
    my $sth = $dbh->prepare(
622
        qq|
622
        qq|
623
		DELETE 
623
         DELETE
624
         FROM aqbudgetperiods
624
         FROM aqbudgetperiods
625
         WHERE budget_period_id=? |
625
         WHERE budget_period_id=? |
626
    );
626
    );
(-)a/C4/Charset.pm (-1 / +1 lines)
Lines 196-202 sub NormalizeString { Link Here
196
=head2 MarcToUTF8Record
196
=head2 MarcToUTF8Record
197
197
198
  ($marc_record, $converted_from, $errors_arrayref) = MarcToUTF8Record($marc_blob, 
198
  ($marc_record, $converted_from, $errors_arrayref) = MarcToUTF8Record($marc_blob, 
199
					$marc_flavour, [, $source_encoding]);
199
                    $marc_flavour, [, $source_encoding]);
200
200
201
Given a MARC blob or a C<MARC::Record>, the MARC flavour, and an 
201
Given a MARC blob or a C<MARC::Record>, the MARC flavour, and an 
202
optional source encoding, return a C<MARC::Record> that is 
202
optional source encoding, return a C<MARC::Record> that is 
(-)a/C4/Circulation.pm (-4 / +5 lines)
Lines 4181-4190 Missing POD for CheckValidBarcode. Link Here
4181
sub CheckValidBarcode {
4181
sub CheckValidBarcode {
4182
    my ($barcode) = @_;
4182
    my ($barcode) = @_;
4183
    my $dbh       = C4::Context->dbh;
4183
    my $dbh       = C4::Context->dbh;
4184
    my $query     = qq|SELECT count(*) 
4184
    my $query     = q|
4185
	     FROM items 
4185
        SELECT count(*)
4186
             WHERE barcode=?
4186
        FROM items
4187
	    |;
4187
        WHERE barcode=?
4188
    |;
4188
    my $sth = $dbh->prepare($query);
4189
    my $sth = $dbh->prepare($query);
4189
    $sth->execute($barcode);
4190
    $sth->execute($barcode);
4190
    my $exist = $sth->fetchrow;
4191
    my $exist = $sth->fetchrow;
(-)a/C4/External/BakerTaylor.pm (-1 / +1 lines)
Lines 46-52 sub _initialize { Link Here
46
        "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value=";
46
        "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value=";
47
    $agent = "Koha/$VERSION [en] (Linux)";
47
    $agent = "Koha/$VERSION [en] (Linux)";
48
48
49
    #"Mozilla/4.76 [en] (Win98; U)",	#  if for some reason you want to go stealth, you might prefer this
49
    #"Mozilla/4.76 [en] (Win98; U)",    #  if for some reason you want to go stealth, you might prefer this
50
}
50
}
51
51
52
sub image_url {
52
sub image_url {
(-)a/C4/Record.pm (-2 / +2 lines)
Lines 731-738 sub changeEncoding { Link Here
731
    if ( lc($format) =~ /^marc$/o ) {
731
    if ( lc($format) =~ /^marc$/o ) {
732
732
733
        # if we're converting encoding of an ISO2709 file, we need to roundtrip through XML
733
        # if we're converting encoding of an ISO2709 file, we need to roundtrip through XML
734
        # 	because MARC::Record doesn't directly provide us with an encoding method
734
        #     because MARC::Record doesn't directly provide us with an encoding method
735
        # 	It's definitely less than idea and should be fixed eventually - kados
735
        #     It's definitely less than idea and should be fixed eventually - kados
736
        my $marcxml;    # temporary storage of MARCXML scalar
736
        my $marcxml;    # temporary storage of MARCXML scalar
737
        ( $error, $marcxml ) = marc2marcxml( $record, $to_encoding, $flavour );
737
        ( $error, $marcxml ) = marc2marcxml( $record, $to_encoding, $flavour );
738
        unless ($error) {
738
        unless ($error) {
(-)a/C4/Serials.pm (-1 / +1 lines)
Lines 2241-2247 sub HasItems { Link Here
2241
    my $query            = q|
2241
    my $query            = q|
2242
            SELECT COUNT(serialitems.itemnumber)
2242
            SELECT COUNT(serialitems.itemnumber)
2243
            FROM   serial 
2243
            FROM   serial 
2244
			LEFT JOIN serialitems USING(serialid)
2244
            LEFT JOIN serialitems USING(serialid)
2245
            WHERE  subscriptionid=? AND serialitems.serialid IS NOT NULL
2245
            WHERE  subscriptionid=? AND serialitems.serialid IS NOT NULL
2246
        |;
2246
        |;
2247
    my $sth = $dbh->prepare($query);
2247
    my $sth = $dbh->prepare($query);
(-)a/C4/ShelfBrowser.pm (-6 / +6 lines)
Lines 63-74 to take into account. Link Here
63
63
64
  foreach (@items) {
64
  foreach (@items) {
65
      # These won't format well like this, but here are the fields
65
      # These won't format well like this, but here are the fields
66
  	  print $_->{title};
66
        print $_->{title};
67
  	  print $_->{biblionumber};
67
        print $_->{biblionumber};
68
  	  print $_->{itemnumber};
68
        print $_->{itemnumber};
69
  	  print $_->{browser_normalized_upc};
69
        print $_->{browser_normalized_upc};
70
  	  print $_->{browser_normalized_oclc};
70
        print $_->{browser_normalized_oclc};
71
  	  print $_->{browser_normalized_isbn};
71
        print $_->{browser_normalized_isbn};
72
      print $_->{browser_normalized_ean};
72
      print $_->{browser_normalized_ean};
73
  }
73
  }
74
74
(-)a/C4/Tags.pm (-48 / +48 lines)
Lines 87-94 sub get_filters { Link Here
87
    return $sth->fetchall_arrayref( {} );
87
    return $sth->fetchall_arrayref( {} );
88
}
88
}
89
89
90
# 	(SELECT count(*) FROM tags_all     ) as tags_all,
90
#     (SELECT count(*) FROM tags_all     ) as tags_all,
91
# 	(SELECT count(*) FROM tags_index   ) as tags_index,
91
#     (SELECT count(*) FROM tags_index   ) as tags_index,
92
92
93
=head2 approval_counts
93
=head2 approval_counts
94
94
Lines 98-107 Missing POD for approval_counts. Link Here
98
98
99
sub approval_counts {
99
sub approval_counts {
100
    my $query = "SELECT
100
    my $query = "SELECT
101
		(SELECT count(*) FROM tags_approval WHERE approved= 1) as approved_count,
101
        (SELECT count(*) FROM tags_approval WHERE approved= 1) as approved_count,
102
		(SELECT count(*) FROM tags_approval WHERE approved=-1) as rejected_count,
102
        (SELECT count(*) FROM tags_approval WHERE approved=-1) as rejected_count,
103
		(SELECT count(*) FROM tags_approval WHERE approved= 0) as unapproved_count
103
        (SELECT count(*) FROM tags_approval WHERE approved= 0) as unapproved_count
104
	";
104
    ";
105
    my $sth = C4::Context->dbh->prepare($query);
105
    my $sth = C4::Context->dbh->prepare($query);
106
    $sth->execute;
106
    $sth->execute;
107
    my $result = $sth->fetchrow_hashref();
107
    my $result = $sth->fetchrow_hashref();
Lines 261-271 sub get_tags { # i.e., from tags_index Link Here
261
        }
261
        }
262
    }
262
    }
263
    my $query = "
263
    my $query = "
264
	SELECT    tags_index.term as term,biblionumber,weight,weight_total
264
    SELECT    tags_index.term as term,biblionumber,weight,weight_total
265
	FROM      tags_index
265
    FROM      tags_index
266
	LEFT JOIN tags_approval 
266
    LEFT JOIN tags_approval 
267
	ON        tags_index.term = tags_approval.term
267
    ON        tags_index.term = tags_approval.term
268
	" . ( $wheres || '' ) . $order . $limit;
268
    " . ( $wheres || '' ) . $order . $limit;
269
    my $sth = C4::Context->dbh->prepare($query);
269
    my $sth = C4::Context->dbh->prepare($query);
270
    if (@exe_args) {
270
    if (@exe_args) {
271
        $sth->execute(@exe_args);
271
        $sth->execute(@exe_args);
Lines 332-346 sub get_approval_rows { # i.e., from tags_approval Link Here
332
        }
332
        }
333
    }
333
    }
334
    my $query = "
334
    my $query = "
335
	SELECT 	tags_approval.term          AS term,
335
    SELECT     tags_approval.term          AS term,
336
			tags_approval.approved      AS approved,
336
            tags_approval.approved      AS approved,
337
			tags_approval.date_approved AS date_approved,
337
            tags_approval.date_approved AS date_approved,
338
			tags_approval.approved_by   AS approved_by,
338
            tags_approval.approved_by   AS approved_by,
339
			tags_approval.weight_total  AS weight_total,
339
            tags_approval.weight_total  AS weight_total,
340
			CONCAT(borrowers.surname, ', ', borrowers.firstname) AS approved_by_name
340
            CONCAT(borrowers.surname, ', ', borrowers.firstname) AS approved_by_name
341
	FROM 	tags_approval
341
    FROM     tags_approval
342
	LEFT JOIN borrowers
342
    LEFT JOIN borrowers
343
	ON      tags_approval.approved_by = borrowers.borrowernumber ";
343
    ON      tags_approval.approved_by = borrowers.borrowernumber ";
344
    $query .= ( $wheres || '' ) . $order . $limit;
344
    $query .= ( $wheres || '' ) . $order . $limit;
345
    my $sth = C4::Context->dbh->prepare($query);
345
    my $sth = C4::Context->dbh->prepare($query);
346
    if (@exe_args) {
346
    if (@exe_args) {
Lines 599-619 sub decrement_weight { Link Here
599
599
600
sub _set_weight_total {
600
sub _set_weight_total {
601
    my $sth = C4::Context->dbh->prepare( "
601
    my $sth = C4::Context->dbh->prepare( "
602
	UPDATE tags_approval
602
    UPDATE tags_approval
603
	SET    weight_total=" . (shift) . "
603
    SET    weight_total=" . (shift) . "
604
	WHERE  term=?
604
    WHERE  term=?
605
	" );    # note: CANNOT use "?" for weight_total (see the args above).
605
    " );    # note: CANNOT use "?" for weight_total (see the args above).
606
    $sth->execute(shift);    # just the term
606
    $sth->execute(shift);    # just the term
607
}
607
}
608
608
609
sub _set_weight {
609
sub _set_weight {
610
    my $dbh = C4::Context->dbh;
610
    my $dbh = C4::Context->dbh;
611
    my $sth = $dbh->prepare( "
611
    my $sth = $dbh->prepare( "
612
	UPDATE tags_index
612
    UPDATE tags_index
613
	SET    weight=" . (shift) . "
613
    SET    weight=" . (shift) . "
614
	WHERE  term=?
614
    WHERE  term=?
615
	AND    biblionumber=?
615
    AND    biblionumber=?
616
	" );
616
    " );
617
    $sth->execute(@_);
617
    $sth->execute(@_);
618
}
618
}
619
619
Lines 627-634 sub add_tag { # biblionumber,term,[borrowernumber,approvernumber] Link Here
627
    my $rows =
627
    my $rows =
628
        get_tag_rows( { biblionumber => $biblionumber, borrowernumber => $borrowernumber, term => $term, limit => 1 } );
628
        get_tag_rows( { biblionumber => $biblionumber, borrowernumber => $borrowernumber, term => $term, limit => 1 } );
629
    my $query = "INSERT INTO tags_all
629
    my $query = "INSERT INTO tags_all
630
	(borrowernumber,biblionumber,term,date_created)
630
    (borrowernumber,biblionumber,term,date_created)
631
	VALUES (?,?,?,NOW())";
631
    VALUES (?,?,?,NOW())";
632
632
633
    if ( scalar @$rows ) {
633
    if ( scalar @$rows ) {
634
        return;
634
        return;
Lines 726-735 instructions. Link Here
726
=head2 Table Structure
726
=head2 Table Structure
727
727
728
The tables used by tags are:
728
The tables used by tags are:
729
	tags_all
729
    tags_all
730
	tags_index
730
    tags_index
731
	tags_approval
731
    tags_approval
732
	tags_blacklist
732
    tags_blacklist
733
733
734
Your first thought may be that this looks a little complicated.  It is, but only because
734
Your first thought may be that this looks a little complicated.  It is, but only because
735
it has to be.  I'll try to explain.
735
it has to be.  I'll try to explain.
Lines 737-757 it has to be. I'll try to explain. Link Here
737
tags_all - This table would be all we really need if we didn't care about moderation or
737
tags_all - This table would be all we really need if we didn't care about moderation or
738
performance or tags disappearing when borrowers are removed.  Too bad, we do.  Otherwise
738
performance or tags disappearing when borrowers are removed.  Too bad, we do.  Otherwise
739
though, it contains all the relevant info about a given tag:
739
though, it contains all the relevant info about a given tag:
740
	tag_id         - unique id number for it
740
    tag_id         - unique id number for it
741
	borrowernumber - user that entered it
741
    borrowernumber - user that entered it
742
	biblionumber   - book record it is attached to
742
    biblionumber   - book record it is attached to
743
	term           - tag "term" itself
743
    term           - tag "term" itself
744
	language       - perhaps used later to influence weighting
744
    language       - perhaps used later to influence weighting
745
	date_created   - date and time it was created
745
    date_created   - date and time it was created
746
746
747
tags_approval - Since we need to provide moderation, this table is used to track it.  If no
747
tags_approval - Since we need to provide moderation, this table is used to track it.  If no
748
external dictionary is used, this table is the sole reference for approval and rejection.
748
external dictionary is used, this table is the sole reference for approval and rejection.
749
With an external dictionary, it tracks pending terms and past whitelist/blacklist actions.
749
With an external dictionary, it tracks pending terms and past whitelist/blacklist actions.
750
This could be called an "approved terms" table.  See above regarding the External Dictionary.
750
This could be called an "approved terms" table.  See above regarding the External Dictionary.
751
	term           - tag "term" itself 
751
    term           - tag "term" itself 
752
	approved       - Negative, 0 or positive if tag is rejected, pending or approved.
752
    approved       - Negative, 0 or positive if tag is rejected, pending or approved.
753
	date_approved  - date of last action
753
    date_approved  - date of last action
754
	approved_by    - staffer performing the last action
754
    approved_by    - staffer performing the last action
755
    weight_total   - total occurrence of term in any biblio by any users
755
    weight_total   - total occurrence of term in any biblio by any users
756
756
757
tags_index - This table is for performance, because by far the most common operation will 
757
tags_index - This table is for performance, because by far the most common operation will 
Lines 759-767 be fetching tags for a list of search results. We will have a set of biblios, a Link Here
759
want ONLY their approved tags and overall weighting.  While we could implement a query that
759
want ONLY their approved tags and overall weighting.  While we could implement a query that
760
would traverse tags_all filtered against tags_approval, the performance implications of
760
would traverse tags_all filtered against tags_approval, the performance implications of
761
trying to calculate that and the "weight" (number of times a tag appears) on the fly are drastic.
761
trying to calculate that and the "weight" (number of times a tag appears) on the fly are drastic.
762
	term           - approved term as it appears in tags_approval
762
    term           - approved term as it appears in tags_approval
763
	biblionumber   - book record it is attached to
763
    biblionumber   - book record it is attached to
764
	weight         - number of times tag applied by any user
764
    weight         - number of times tag applied by any user
765
765
766
tags_blacklist - A set of regular expression filters.  Unsurprisingly, these should be perl-
766
tags_blacklist - A set of regular expression filters.  Unsurprisingly, these should be perl-
767
compatible (PCRE) for your version of perl.  Since this is a blacklist, a term will be
767
compatible (PCRE) for your version of perl.  Since this is a blacklist, a term will be
(-)a/Makefile.PL (-1 / +1 lines)
Lines 71-77 Makefile.PL - Koha packager and installer Link Here
71
71
72
=head2 CLEANING UP
72
=head2 CLEANING UP
73
73
74
	make clean
74
    make clean
75
75
76
=head2 CLI PARAMETERS
76
=head2 CLI PARAMETERS
77
77
(-)a/admin/aqbudgetperiods.pl (-7 / +7 lines)
Lines 26-42 script to administer the budget periods table Link Here
26
 ALGO :
26
 ALGO :
27
 this script use an $op to know what to do.
27
 this script use an $op to know what to do.
28
 if $op is empty or none of the above values,
28
 if $op is empty or none of the above values,
29
	- the default screen is build (with all records, or filtered datas).
29
    - the default screen is build (with all records, or filtered datas).
30
	- the   user can clic on add, modify or delete record.
30
    - the   user can clic on add, modify or delete record.
31
 if $op=add_form
31
 if $op=add_form
32
	- if primkey exists, this is a modification,so we read the $primkey record
32
    - if primkey exists, this is a modification,so we read the $primkey record
33
	- builds the add/modify form
33
    - builds the add/modify form
34
 if $op=add_validate
34
 if $op=add_validate
35
	- the user has just send datas, so we create/modify the record
35
    - the user has just send datas, so we create/modify the record
36
 if $op=delete_confirm
36
 if $op=delete_confirm
37
	- we show the record having primkey=$primkey and ask for deletion validation form
37
    - we show the record having primkey=$primkey and ask for deletion validation form
38
 if $op=delete_confirmed
38
 if $op=delete_confirmed
39
	- we delete the record having primkey=$primkey
39
    - we delete the record having primkey=$primkey
40
 if $op=duplicate_form
40
 if $op=duplicate_form
41
  - displays the duplication of budget period form (allowing specification of dates)
41
  - displays the duplication of budget period form (allowing specification of dates)
42
 if $op=duplicate_budget
42
 if $op=duplicate_budget
(-)a/authorities/detail-biblio-search.pl (-2 lines)
Lines 84-90 foreach my $field (@fields) { Link Here
84
    # if tag <10, there's no subfield, use the "@" trick
84
    # if tag <10, there's no subfield, use the "@" trick
85
    if ( $field->tag() < 10 ) {
85
    if ( $field->tag() < 10 ) {
86
86
87
        # 			next if ($tagslib->{$field->tag()}->{'@'}->{tab}  ne $tabloop);
88
        next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
87
        next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
89
        my %subfield_data;
88
        my %subfield_data;
90
        $subfield_data{marc_lib}      = $tagslib->{ $field->tag() }->{'@'}->{lib};
89
        $subfield_data{marc_lib}      = $tagslib->{ $field->tag() }->{'@'}->{lib};
Lines 99-105 foreach my $field (@fields) { Link Here
99
        for my $i ( 0 .. $#subf ) {
98
        for my $i ( 0 .. $#subf ) {
100
            $subf[$i][0] = "@" unless defined $subf[$i][0];
99
            $subf[$i][0] = "@" unless defined $subf[$i][0];
101
100
102
            # 				next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab}  ne $tabloop);
103
            next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
101
            next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
104
            my %subfield_data;
102
            my %subfield_data;
105
            $subfield_data{marc_lib} = $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
103
            $subfield_data{marc_lib} = $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
(-)a/cataloguing/addbooks.pl (-2 lines)
Lines 19-26 Link Here
19
19
20
=head1 cataloguing:addbooks.pl
20
=head1 cataloguing:addbooks.pl
21
21
22
	TODO
23
24
=cut
22
=cut
25
23
26
use Modern::Perl;
24
use Modern::Perl;
(-)a/circ/transferstoreceive.pl (-1 / +1 lines)
Lines 120-126 while ( my $library = $libraries->next ) { Link Here
120
            push( @transferloop, \%getransf );
120
            push( @transferloop, \%getransf );
121
        }
121
        }
122
122
123
        # 		If we have a return of reservloop we put it in the branchloop sequence
123
        # If we have a return of reservloop we put it in the branchloop sequence
124
        $branchloop{'reserve'} = \@transferloop;
124
        $branchloop{'reserve'} = \@transferloop;
125
    }
125
    }
126
    push( @branchesloop, \%branchloop ) if %branchloop;
126
    push( @branchesloop, \%branchloop ) if %branchloop;
(-)a/circ/waitingreserves.pl (-1 / +1 lines)
Lines 164-170 sub cancel { Link Here
164
164
165
    my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $itemnumber, $borrowernumber );
165
    my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $itemnumber, $borrowernumber );
166
166
167
    # 	if the document is not in his homebranch location and there is not reservation after, we transfer it
167
    # if the document is not in his homebranch location and there is not reservation after, we transfer it
168
    if ( $transfer && !$nextreservinfo && !$item->itemlost ) {
168
    if ( $transfer && !$nextreservinfo && !$item->itemlost ) {
169
        ModItemTransfer( $itemnumber, $fbr, $tbr, 'CancelReserve' );
169
        ModItemTransfer( $itemnumber, $fbr, $tbr, 'CancelReserve' );
170
    }
170
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-4 / +5 lines)
Lines 164-173 Link Here
164
                                    </li>
164
                                    </li>
165
                                [% END %]
165
                                [% END %]
166
                                <!--  // Removing freight input until shipping can be proplerly handled .
166
                                <!--  // Removing freight input until shipping can be proplerly handled .
167
	  <li>
167
                                <li>
168
            <label for="freight">Shipping:</label>
168
                                    <label for="freight">Shipping:</label>
169
            <input type="text" size="20" id="freight" name="freight" />
169
                                    <input type="text" size="20" id="freight" name="freight" />
170
        </li> -->
170
                                </li>
171
                                -->
171
                                <li>
172
                                <li>
172
                                    <label for="shipmentdate">Shipment date: </label>
173
                                    <label for="shipmentdate">Shipment date: </label>
173
                                    <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | html %]" class="flatpickr" />
174
                                    <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today | html %]" class="flatpickr" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-4 / +5 lines)
Lines 341-350 Link Here
341
                        <fieldset class="action">
341
                        <fieldset class="action">
342
                            [% IF op != 'cud-saveitem' %]
342
                            [% IF op != 'cud-saveitem' %]
343
                                <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
343
                                <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
344
                                <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
344
                                <!-- Note:
345
		when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
345
                                    We use here a false submit button because we have several submit buttons and we do not want the user to believe they validated the adding of multiple items
346
		It is a bit tricky, but necessary in the sake of UI correctness.
346
                                    when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
347
    -->
347
                                    It is a bit tricky, but necessary in the sake of UI correctness.
348
                                -->
348
                                <span id="addsingle">
349
                                <span id="addsingle">
349
                                    <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
350
                                    <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
350
                                    <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
351
                                    <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt (-4 / +6 lines)
Lines 175-184 Link Here
175
                            <option value="15">15</option>
175
                            <option value="15">15</option>
176
                            <option value="20">20</option>
176
                            <option value="20">20</option>
177
                            <option value="">No limit</option>
177
                            <option value="">No limit</option>
178
                            <!--					<option value ="25">25</option>
178
                            <!--
179
						<option value ="40">40</option>
179
                            <option value ="25">25</option>
180
						<option value ="50">50</option>
180
                            <option value ="40">40</option>
181
						<option value ="100">100</option>-->
181
                            <option value ="50">50</option>
182
                            <option value ="100">100</option>
183
                            -->
182
                        </select></li
184
                        </select></li
183
                    >
185
                    >
184
                    <li
186
                    <li
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-4 / +4 lines)
Lines 213-222 Link Here
213
                    <label class="inline" for="basename">Named:</label>
213
                    <label class="inline" for="basename">Named:</label>
214
                    <input type="text" name="basename" id="basename" value="Export" />
214
                    <input type="text" name="basename" id="basename" value="Export" />
215
                    <!--
215
                    <!--
216
									<label for="MIME" class="inline">Into an application:</label>
216
                    <label for="MIME" class="inline">Into an application:</label>
217
									[% CGIextChoice | html %]
217
                    [% CGIextChoice | html %]
218
									[% CGIsepChoice | html %]
218
                    [% CGIsepChoice | html %]
219
								-->
219
                    -->
220
                    <input type="hidden" name="report_name" value="[% report_name | html %]" />
220
                    <input type="hidden" name="report_name" value="[% report_name | html %]" />
221
                </li>
221
                </li>
222
            </ol>
222
            </ol>
(-)a/misc/recreateIssueStatistics.pl (-3 / +3 lines)
Lines 77-83 if ( $issues == 1 ) { Link Here
77
                # Inserting missing issue
77
                # Inserting missing issue
78
                my $insert =
78
                my $insert =
79
                    "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
79
                    "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
80
					 VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
80
                     VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
81
                $substh = $dbh->prepare($insert);
81
                $substh = $dbh->prepare($insert);
82
                my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
82
                my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
83
                my $itemtype = $item->effective_itemtype;
83
                my $itemtype = $item->effective_itemtype;
Lines 119-125 if ( $issues == 1 ) { Link Here
119
                    # Inserting missing renewals
119
                    # Inserting missing renewals
120
                    my $insert =
120
                    my $insert =
121
                        "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
121
                        "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
122
					 VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
122
                     VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
123
                    $substh = $dbh->prepare($insert);
123
                    $substh = $dbh->prepare($insert);
124
                    my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
124
                    my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
125
                    my $itemtype = $item->effective_itemtype;
125
                    my $itemtype = $item->effective_itemtype;
Lines 164-170 if ( $returns == 1 ) { Link Here
164
            # Inserting missing issue
164
            # Inserting missing issue
165
            my $insert =
165
            my $insert =
166
                "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
166
                "INSERT INTO statistics (datetime, branch, value, type, other, itemnumber, itemtype, borrowernumber)
167
				     VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
167
                     VALUES(?, ?, ?, ?, ?, ?, ?, ?)";
168
            $substh = $dbh->prepare($insert);
168
            $substh = $dbh->prepare($insert);
169
            my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
169
            my $item     = Koha::Items->find( $hashref->{'itemnumber'} );
170
            my $itemtype = $item->effective_itemtype;
170
            my $itemtype = $item->effective_itemtype;
(-)a/misc/translator/TmplTokenizer.pm (-3 / +3 lines)
Lines 47-61 sub SYNTAXERROR_P () { 'syntaxerror-p' } Link Here
47
47
48
sub FILENAME () { 'input' }
48
sub FILENAME () { 'input' }
49
49
50
#sub HANDLE		() {'handle'}
50
#sub HANDLE () {'handle'}
51
51
52
#sub READAHEAD		() {'readahead'}
52
#sub READAHEAD () {'readahead'}
53
sub LINENUM_START () { 'lc_0' }
53
sub LINENUM_START () { 'lc_0' }
54
sub LINENUM ()       { 'lc' }
54
sub LINENUM ()       { 'lc' }
55
sub CDATA_MODE_P ()  { 'cdata-mode-p' }
55
sub CDATA_MODE_P ()  { 'cdata-mode-p' }
56
sub CDATA_CLOSE ()   { 'cdata-close' }
56
sub CDATA_CLOSE ()   { 'cdata-close' }
57
57
58
#sub PCDATA_MODE_P	() {'pcdata-mode-p'}	# additional submode for CDATA
58
#sub PCDATA_MODE_P () {'pcdata-mode-p'}    # additional submode for CDATA
59
sub JS_MODE_P () { 'js-mode-p' }    # cdata-mode-p must also be true
59
sub JS_MODE_P () { 'js-mode-p' }    # cdata-mode-p must also be true
60
60
61
sub ALLOW_CFORMAT_P () { 'allow-cformat-p' }
61
sub ALLOW_CFORMAT_P () { 'allow-cformat-p' }
(-)a/misc/translator/xgettext.pl (-2 / +2 lines)
Lines 204-210 EOF Link Here
204
                $fmt =~ s/^%/%$n\$/;
204
                $fmt =~ s/^%/%$n\$/;
205
                if ( $type == C4::TmplTokenType::DIRECTIVE ) {
205
                if ( $type == C4::TmplTokenType::DIRECTIVE ) {
206
206
207
                    #		    $type = "Template::Toolkit Directive";
207
                    # $type = "Template::Toolkit Directive";
208
                    $type = $param->string =~ /\[%(.*?)%\]/is ? $1 : 'ERROR';
208
                    $type = $param->string =~ /\[%(.*?)%\]/is ? $1 : 'ERROR';
209
                    my $name = $param->string =~ /\bname=(["']?)([^\s"']+)\1/is ? $2 : undef;
209
                    my $name = $param->string =~ /\bname=(["']?)([^\s"']+)\1/is ? $2 : undef;
210
                    printf $OUTPUT "#. %s: %s\n", $fmt,
210
                    printf $OUTPUT "#. %s: %s\n", $fmt,
Lines 473-479 The JavaScript must actually define a _ function Link Here
473
so that the code remains correct JavaScript.
473
so that the code remains correct JavaScript.
474
A suitable definition of such a function can be
474
A suitable definition of such a function can be
475
475
476
	function _(s) { return s } // dummy function for gettext
476
    function _(s) { return s } // dummy function for gettext
477
477
478
=head1 SEE ALSO
478
=head1 SEE ALSO
479
479
(-)a/opac/ilsdi.pl (-17 / +17 lines)
Lines 45-68 my $cgi = CGI->new; Link Here
45
my @services = (
45
my @services = (
46
    'Describe',    # Not part of ILS-DI, online API doc
46
    'Describe',    # Not part of ILS-DI, online API doc
47
47
48
    #	Level 1: Basic Discovery Interfaces
48
    #    Level 1: Basic Discovery Interfaces
49
    #	'HarvestBibliographicRecords',       # OAI-PMH
49
    #    'HarvestBibliographicRecords',       # OAI-PMH
50
    #	'HarvestExpandedRecords',            # OAI-PMH
50
    #    'HarvestExpandedRecords',            # OAI-PMH
51
    'GetAvailability',    # FIXME Add bibliographic level
51
    'GetAvailability',    # FIXME Add bibliographic level
52
52
53
    #	'GoToBibliographicRequestPage'       # I don't understant this one
53
    #    'GoToBibliographicRequestPage'       # I don't understant this one
54
    #	Level 2: Elementary OPAC supplement
54
    #    Level 2: Elementary OPAC supplement
55
    #	'HarvestAuthorityRecords',           # OAI-PMH
55
    #    'HarvestAuthorityRecords',           # OAI-PMH
56
    #	'HarvestHoldingsRecords',            # OAI-PMH
56
    #    'HarvestHoldingsRecords',            # OAI-PMH
57
    'GetRecords',    # Note that we can use OAI-PMH for this too
57
    'GetRecords',    # Note that we can use OAI-PMH for this too
58
58
59
    #	'Search',                            # TODO
59
    #    'Search',                            # TODO
60
    #	'Scan',	                             # TODO
60
    #    'Scan',                                 # TODO
61
    'GetAuthorityRecords',
61
    'GetAuthorityRecords',
62
62
63
    #	'OutputRewritablePage',              # I don't understant this one
63
    #    'OutputRewritablePage',              # I don't understant this one
64
    #	'OutputIntermediateFormat',          # I don't understant this one
64
    #    'OutputIntermediateFormat',          # I don't understant this one
65
    #	Level 3: Elementary OPAC alternative
65
    #    Level 3: Elementary OPAC alternative
66
    'LookupPatron',
66
    'LookupPatron',
67
    'AuthenticatePatron',
67
    'AuthenticatePatron',
68
    'GetPatronInfo',
68
    'GetPatronInfo',
Lines 73-83 my @services = ( Link Here
73
    'HoldItem',       # FIXME Add dates support
73
    'HoldItem',       # FIXME Add dates support
74
    'CancelHold',
74
    'CancelHold',
75
75
76
    #	'RecallItem',                        # Not supported by Koha
76
    #    'RecallItem',                        # Not supported by Koha
77
    #	'CancelRecall',                      # Not supported by Koha
77
    #    'CancelRecall',                      # Not supported by Koha
78
    #	Level 4: Robust/domain specific discovery platforms
78
    #    Level 4: Robust/domain specific discovery platforms
79
    #	'SearchCourseReserves',              # TODO
79
    #    'SearchCourseReserves',              # TODO
80
    #	'Explain'                            # TODO
80
    #    'Explain'                            # TODO
81
);
81
);
82
82
83
# List of required arguments
83
# List of required arguments
(-)a/opac/opac-tags.pl (-12 / +12 lines)
Lines 358-372 __END__ Link Here
358
358
359
=head1 EXAMPLE AJAX POST PARAMETERS
359
=head1 EXAMPLE AJAX POST PARAMETERS
360
360
361
CGISESSID	7c6288263107beb320f70f78fd767f56
361
CGISESSID    7c6288263107beb320f70f78fd767f56
362
newtag396	fire,+<a+href="foobar.html">foobar</a>,+<img+src="foo.jpg"+/>
362
newtag396    fire,+<a+href="foobar.html">foobar</a>,+<img+src="foo.jpg"+/>
363
363
364
So this request is trying to add 3 tags to biblio #396.  The CGISESSID is the same as that the browser would
364
So this request is trying to add 3 tags to biblio #396.  The CGISESSID is the same as that the browser would
365
typically communicate using cookies.  If it is valid, the server will split the value of "newtag396" and 
365
typically communicate using cookies.  If it is valid, the server will split the value of "newtag396" and 
366
process the components for addition.  In this case the intended tags are:
366
process the components for addition.  In this case the intended tags are:
367
	fire
367
    fire
368
	<a+href="foobar.html">foobar</a>
368
    <a+href="foobar.html">foobar</a>
369
	<img src="foo.jpg" />
369
    <img src="foo.jpg" />
370
370
371
The first tag is acceptable.  The second will be scrubbed of markup, resulting in the tag "foobar".  
371
The first tag is acceptable.  The second will be scrubbed of markup, resulting in the tag "foobar".  
372
The third tag is all markup, and will be rejected.  
372
The third tag is all markup, and will be rejected.  
Lines 374-386 The third tag is all markup, and will be rejected. Link Here
374
=head1 EXAMPLE AJAX JSON response
374
=head1 EXAMPLE AJAX JSON response
375
375
376
response = {
376
response = {
377
	added: 2,
377
    added: 2,
378
	deleted: 0,
378
    deleted: 0,
379
	errors: 2,
379
    errors: 2,
380
	alerts: [
380
    alerts: [
381
		 KOHA.Tags.tag_message.scrubbed("foobar"),
381
         KOHA.Tags.tag_message.scrubbed("foobar"),
382
 		 KOHA.Tags.tag_message.scrubbed_all_bad("1"),
382
          KOHA.Tags.tag_message.scrubbed_all_bad("1"),
383
 	],
383
     ],
384
};
384
};
385
385
386
=cut
386
=cut
(-)a/reports/bor_issues_top.pl (-4 / +4 lines)
Lines 282-291 sub calculate { Link Here
282
    my %patrons = ();
282
    my %patrons = ();
283
283
284
    # DATA STRUCTURE is going to look like this:
284
    # DATA STRUCTURE is going to look like this:
285
    # 	(2253=> {name=>"John Doe",
285
    #     (2253=> {name=>"John Doe",
286
    # 				allcols=>{MAIN=>12, MEDIA_LIB=>3}
286
    #                 allcols=>{MAIN=>12, MEDIA_LIB=>3}
287
    # 			},
287
    #             },
288
    # 	)
288
    #     )
289
    while ( my @data = $dbcalc->fetchrow ) {
289
    while ( my @data = $dbcalc->fetchrow ) {
290
        my ( $row, $rank, $id, $col ) = @data;
290
        my ( $row, $rank, $id, $col ) = @data;
291
        $col = "zzEMPTY" if ( !defined($col) );
291
        $col = "zzEMPTY" if ( !defined($col) );
(-)a/reports/borrowers_out.pl (-10 / +10 lines)
Lines 164-170 sub calculate { Link Here
164
        my @colfilter;
164
        my @colfilter;
165
        $colfilter[0] = @$filters[0] if ( $column =~ /category/ );
165
        $colfilter[0] = @$filters[0] if ( $column =~ /category/ );
166
166
167
        # 	$colfilter[0] = @$filters[11] if ($column =~ /sort2/ ) ;
167
        #     $colfilter[0] = @$filters[11] if ($column =~ /sort2/ ) ;
168
        #warn "filtre col ".$colfilter[0]." ".$colfilter[1];
168
        #warn "filtre col ".$colfilter[0]." ".$colfilter[1];
169
169
170
        # loop cols.
170
        # loop cols.
Lines 189-213 sub calculate { Link Here
189
        while ( my ($celvalue) = $sth2->fetchrow ) {
189
        while ( my ($celvalue) = $sth2->fetchrow ) {
190
            my %cell;
190
            my %cell;
191
191
192
            #		my %ft;
192
            #        my %ft;
193
            #		warn "coltitle :".$celvalue;
193
            #        warn "coltitle :".$celvalue;
194
            $cell{coltitle} = $celvalue;
194
            $cell{coltitle} = $celvalue;
195
195
196
            #		$ft{totalcol} = 0;
196
            #        $ft{totalcol} = 0;
197
            push @loopcol, \%cell;
197
            push @loopcol, \%cell;
198
        }
198
        }
199
199
200
        #	warn "fin des titres colonnes";
200
        #    warn "fin des titres colonnes";
201
    }
201
    }
202
202
203
    my $i = 0;
203
    my $i = 0;
204
204
205
    #	my @totalcol;
205
    #    my @totalcol;
206
206
207
    #Initialization of cell values.....
207
    #Initialization of cell values.....
208
    my @table;
208
    my @table;
209
209
210
    #	warn "init table";
210
    #    warn "init table";
211
    if ($line) {
211
    if ($line) {
212
        for ( my $i = 1 ; $i <= $line ; $i++ ) {
212
        for ( my $i = 1 ; $i <= $line ; $i++ ) {
213
            foreach my $col (@loopcol) {
213
            foreach my $col (@loopcol) {
Lines 262-268 sub calculate { Link Here
262
    my $dbcalc = $dbh->prepare($strcalc);
262
    my $dbcalc = $dbh->prepare($strcalc);
263
    $dbcalc->execute(@query_args);
263
    $dbcalc->execute(@query_args);
264
264
265
    # 	warn "filling table";
265
    #     warn "filling table";
266
    my $previous_col;
266
    my $previous_col;
267
    $i = 1;
267
    $i = 1;
268
    while ( my @data = $dbcalc->fetchrow ) {
268
    while ( my @data = $dbcalc->fetchrow ) {
Lines 271-277 sub calculate { Link Here
271
        $i                 = 1         if ( ($previous_col) and not( $col eq $previous_col ) );
271
        $i                 = 1         if ( ($previous_col) and not( $col eq $previous_col ) );
272
        $table[$i]->{$col} = $row;
272
        $table[$i]->{$col} = $row;
273
273
274
        #		warn " $i $col $row";
274
        #        warn " $i $col $row";
275
        $i++;
275
        $i++;
276
        $previous_col = $col;
276
        $previous_col = $col;
277
    }
277
    }
Lines 311-317 sub calculate { Link Here
311
    $globalline{looprow} = \@looprow;
311
    $globalline{looprow} = \@looprow;
312
    $globalline{loopcol} = \@loopcol;
312
    $globalline{loopcol} = \@loopcol;
313
313
314
    # 	# the foot (totals by borrower type)
314
    #     # the foot (totals by borrower type)
315
    $globalline{loopfooter} = \@loopfooter;
315
    $globalline{loopfooter} = \@loopfooter;
316
    $globalline{total}      = $grantotal;
316
    $globalline{total}      = $grantotal;
317
    $globalline{line}       = $line;
317
    $globalline{line}       = $line;
(-)a/reports/borrowers_stats.pl (-5 / +5 lines)
Lines 322-328 sub calculate { Link Here
322
    #Initialization of cell values.....
322
    #Initialization of cell values.....
323
    my %table;
323
    my %table;
324
324
325
    #	warn "init table";
325
    #    warn "init table";
326
    foreach my $row (@loopline) {
326
    foreach my $row (@loopline) {
327
        foreach my $col (@loopcol) {
327
        foreach my $col (@loopcol) {
328
            my $rowtitle = $row->{rowtitle} // '';
328
            my $rowtitle = $row->{rowtitle} // '';
Lines 415-421 sub calculate { Link Here
415
    my $emptycol;
415
    my $emptycol;
416
    while ( my ( $row, $col, $value ) = $dbcalc->fetchrow ) {
416
    while ( my ( $row, $col, $value ) = $dbcalc->fetchrow ) {
417
417
418
        #		warn "filling table $row / $col / $value ";
418
        #        warn "filling table $row / $col / $value ";
419
        $emptycol = 1         if ( !defined($col) );
419
        $emptycol = 1         if ( !defined($col) );
420
        $col      = "zzEMPTY" if ( !defined($col) );
420
        $col      = "zzEMPTY" if ( !defined($col) );
421
        $row      = "zzEMPTY" if ( !defined($row) );
421
        $row      = "zzEMPTY" if ( !defined($row) );
Lines 456-465 sub calculate { Link Here
456
456
457
            $total += $table{$rowtitle}->{$coltitle} || 0;
457
            $total += $table{$rowtitle}->{$coltitle} || 0;
458
458
459
            #			warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
459
            #            warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
460
        }
460
        }
461
461
462
        #		warn "summ for column ".$col->{coltitle}."  = ".$total;
462
        #        warn "summ for column ".$col->{coltitle}."  = ".$total;
463
        push @loopfooter, { 'totalcol' => $total };
463
        push @loopfooter, { 'totalcol' => $total };
464
    }
464
    }
465
465
Lines 470-476 sub calculate { Link Here
470
    $globalline{looprow} = \@looprow;
470
    $globalline{looprow} = \@looprow;
471
    $globalline{loopcol} = \@loopcol;
471
    $globalline{loopcol} = \@loopcol;
472
472
473
    # 	# the foot (totals by borrower type)
473
    #     # the foot (totals by borrower type)
474
    $globalline{loopfooter} = \@loopfooter;
474
    $globalline{loopfooter} = \@loopfooter;
475
    $globalline{total}      = $grantotal;
475
    $globalline{total}      = $grantotal;
476
    $globalline{line}       = ($line_attribute_type)   ? $line_attribute_type   : $line;
476
    $globalline{line}       = ($line_attribute_type)   ? $line_attribute_type   : $line;
(-)a/reports/cat_issues_top.pl (-5 / +5 lines)
Lines 282-303 sub calculate { Link Here
282
            push @loopcol, \%cell;
282
            push @loopcol, \%cell;
283
        }
283
        }
284
284
285
        #	warn "fin des titres colonnes";
285
        #    warn "fin des titres colonnes";
286
    }
286
    }
287
287
288
    my $i = 0;
288
    my $i = 0;
289
289
290
    #	my @totalcol;
290
    #    my @totalcol;
291
    my $highlighted = -1;
291
    my $highlighted = -1;
292
292
293
    #Initialization of cell values.....
293
    #Initialization of cell values.....
294
    my @table;
294
    my @table;
295
295
296
    #	warn "init table";
296
    #    warn "init table";
297
    for ( my $i = 1 ; $i <= $line ; $i++ ) {
297
    for ( my $i = 1 ; $i <= $line ; $i++ ) {
298
        foreach my $col (@loopcol) {
298
        foreach my $col (@loopcol) {
299
299
300
            #			warn " init table : $row->{rowtitle} / $col->{coltitle} ";
300
            #            warn " init table : $row->{rowtitle} / $col->{coltitle} ";
301
            $table[$i]->{ ( $col->{coltitle} ) ? $col->{coltitle} : "total" }->{'name'} = 0;
301
            $table[$i]->{ ( $col->{coltitle} ) ? $col->{coltitle} : "total" }->{'name'} = 0;
302
        }
302
        }
303
    }
303
    }
Lines 421-427 sub calculate { Link Here
421
    $globalline{looprow} = \@looprow;
421
    $globalline{looprow} = \@looprow;
422
    $globalline{loopcol} = \@loopcol;
422
    $globalline{loopcol} = \@loopcol;
423
423
424
    # 	# the foot (totals by borrower type)
424
    #     # the foot (totals by borrower type)
425
    $globalline{total}  = $grantotal;
425
    $globalline{total}  = $grantotal;
426
    $globalline{line}   = $line;
426
    $globalline{line}   = $line;
427
    $globalline{column} = $column;
427
    $globalline{column} = $column;
(-)a/reports/catalogue_out.pl (-1 / +1 lines)
Lines 129-135 sub calculate { Link Here
129
        LEFT JOIN old_issues  USING (itemnumber)
129
        LEFT JOIN old_issues  USING (itemnumber)
130
          WHERE       issues.itemnumber IS NULL
130
          WHERE       issues.itemnumber IS NULL
131
           AND    old_issues.itemnumber IS NULL
131
           AND    old_issues.itemnumber IS NULL
132
	";
132
    ";
133
    if ( $filters->[0] ) {
133
    if ( $filters->[0] ) {
134
        $filters->[0] =~ s/\*/%/g;
134
        $filters->[0] =~ s/\*/%/g;
135
        push @exe_args, $filters->[0];
135
        push @exe_args, $filters->[0];
(-)a/reports/issues_avg_stats.pl (-17 / +17 lines)
Lines 207-216 sub calculate { Link Here
207
207
208
    my @linefilter;
208
    my @linefilter;
209
209
210
    #	warn "filtres ".@filters[0];
210
    #    warn "filtres ".@filters[0];
211
    #	warn "filtres ".@filters[1];
211
    #    warn "filtres ".@filters[1];
212
    #	warn "filtres ".@filters[2];
212
    #    warn "filtres ".@filters[2];
213
    #	warn "filtres ".@filters[3];
213
    #    warn "filtres ".@filters[3];
214
    $line = "old_issues." . $line if ( $line =~ /branchcode/ ) or ( $line =~ /timestamp/ );
214
    $line = "old_issues." . $line if ( $line =~ /branchcode/ ) or ( $line =~ /timestamp/ );
215
    if ( $line =~ /itemtype/ ) { $line = $itype; }
215
    if ( $line =~ /itemtype/ ) { $line = $itype; }
216
    $linefilter[0] = @$filters[0]  if ( $line =~ /timestamp/ );
216
    $linefilter[0] = @$filters[0]  if ( $line =~ /timestamp/ );
Lines 378-390 sub calculate { Link Here
378
        my %cell;
378
        my %cell;
379
        my %ft;
379
        my %ft;
380
380
381
        #		warn "coltitle :".$celvalue;
381
        #        warn "coltitle :".$celvalue;
382
        $cell{coltitle} = $celvalue;
382
        $cell{coltitle} = $celvalue;
383
        $ft{totalcol}   = 0;
383
        $ft{totalcol}   = 0;
384
        push @loopcol, \%cell;
384
        push @loopcol, \%cell;
385
    }
385
    }
386
386
387
    #	warn "fin des titres colonnes";
387
    #    warn "fin des titres colonnes";
388
388
389
    my $i           = 0;
389
    my $i           = 0;
390
    my $highlighted = -1;
390
    my $highlighted = -1;
Lines 394-404 sub calculate { Link Here
394
    my %wgttable;
394
    my %wgttable;
395
    my %cnttable;
395
    my %cnttable;
396
396
397
    #	warn "init table";
397
    #    warn "init table";
398
    foreach my $row (@loopline) {
398
    foreach my $row (@loopline) {
399
        foreach my $col (@loopcol) {
399
        foreach my $col (@loopcol) {
400
400
401
            #			warn " init table : $row->{rowtitle} / $col->{coltitle} ";
401
            #            warn " init table : $row->{rowtitle} / $col->{coltitle} ";
402
            $table{ $row->{rowtitle} }->{ $col->{coltitle} } = 0;
402
            $table{ $row->{rowtitle} }->{ $col->{coltitle} } = 0;
403
        }
403
        }
404
        $table{ $row->{rowtitle} }->{totalrow} = 0;
404
        $table{ $row->{rowtitle} }->{totalrow} = 0;
Lines 440-446 sub calculate { Link Here
440
    my $dbcalc = $dbh->prepare($strcalc);
440
    my $dbcalc = $dbh->prepare($strcalc);
441
    $dbcalc->execute;
441
    $dbcalc->execute;
442
442
443
    # 	warn "filling table";
443
    #     warn "filling table";
444
    my $issues_count = 0;
444
    my $issues_count = 0;
445
    my $loanlength;
445
    my $loanlength;
446
    my $emptycol;
446
    my $emptycol;
Lines 448-454 sub calculate { Link Here
448
    while ( my @data = $dbcalc->fetchrow ) {
448
    while ( my @data = $dbcalc->fetchrow ) {
449
        my ( $row, $col, $issuedate, $returndate, $weight ) = @data;
449
        my ( $row, $col, $issuedate, $returndate, $weight ) = @data;
450
450
451
        #		warn "filling table $row / $col / $issuedate / $returndate /$weight";
451
        #        warn "filling table $row / $col / $issuedate / $returndate /$weight";
452
        $emptycol = 1         if ( !defined($col) );
452
        $emptycol = 1         if ( !defined($col) );
453
        $col      = "zzEMPTY" if ( !defined($col) );
453
        $col      = "zzEMPTY" if ( !defined($col) );
454
        $row      = "zzEMPTY" if ( !defined($row) );
454
        $row      = "zzEMPTY" if ( !defined($row) );
Lines 457-467 sub calculate { Link Here
457
        #  and seconds between the two
457
        #  and seconds between the two
458
        $loanlength = Delta_Days( split( /-/, $issuedate ), split( /-/, $returndate ) );
458
        $loanlength = Delta_Days( split( /-/, $issuedate ), split( /-/, $returndate ) );
459
459
460
        #		warn "512 Same row and col DateCalc returns :$loanlength with return ". $returndate ."issue ". $issuedate ."weight : ". $weight;
460
        #        warn "512 Same row and col DateCalc returns :$loanlength with return ". $returndate ."issue ". $issuedate ."weight : ". $weight;
461
        #		warn "513 row :".$row." column :".$col;
461
        #        warn "513 row :".$row." column :".$col;
462
        $table{$row}->{$col} += $weight * $loanlength;
462
        $table{$row}->{$col} += $weight * $loanlength;
463
463
464
        #		$table{$row}->{totalrow}+=$weight*$loanlength;
464
        #        $table{$row}->{totalrow}+=$weight*$loanlength;
465
        $cnttable{$row}->{$col} = 1;
465
        $cnttable{$row}->{$col} = 1;
466
        $wgttable{$row}->{$col} += $weight;
466
        $wgttable{$row}->{$col} += $weight;
467
    }
467
    }
Lines 523-529 sub calculate { Link Here
523
        $highlighted = -$highlighted;
523
        $highlighted = -$highlighted;
524
    }
524
    }
525
    #
525
    #
526
    # #	warn "footer processing";
526
    # #    warn "footer processing";
527
    foreach my $col (@loopcol) {
527
    foreach my $col (@loopcol) {
528
        my $total = 0;
528
        my $total = 0;
529
        my $nbrow = 0;
529
        my $nbrow = 0;
Lines 536-545 sub calculate { Link Here
536
            $nbrow += $cnttable{ ( $row->{rowtitle} eq "NULL" ) ? "zzEMPTY" : $row->{rowtitle} }
536
            $nbrow += $cnttable{ ( $row->{rowtitle} eq "NULL" ) ? "zzEMPTY" : $row->{rowtitle} }
537
                ->{ ( $col->{coltitle} eq "NULL" ) ? "zzEMPTY" : $col->{coltitle} };
537
                ->{ ( $col->{coltitle} eq "NULL" ) ? "zzEMPTY" : $col->{coltitle} };
538
538
539
            #			warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
539
            #            warn "value added ".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
540
        }
540
        }
541
541
542
        #		warn "summ for column ".$col->{coltitle}."  = ".$total;
542
        #        warn "summ for column ".$col->{coltitle}."  = ".$total;
543
        $total = $total / $nbrow if ($nbrow);
543
        $total = $total / $nbrow if ($nbrow);
544
        push @loopfooter, { 'totalcol' => ($total) ? sprintf( "%.2f", $total ) : 0 };
544
        push @loopfooter, { 'totalcol' => ($total) ? sprintf( "%.2f", $total ) : 0 };
545
545
Lines 552-558 sub calculate { Link Here
552
    $globalline{looprow} = \@looprow;
552
    $globalline{looprow} = \@looprow;
553
    $globalline{loopcol} = \@loopcol;
553
    $globalline{loopcol} = \@loopcol;
554
554
555
    # 	# the foot (totals by borrower type)
555
    #     # the foot (totals by borrower type)
556
    $globalline{loopfooter} = \@loopfooter;
556
    $globalline{loopfooter} = \@loopfooter;
557
    $globalline{total}      = $grantotal;
557
    $globalline{total}      = $grantotal;
558
    $globalline{line}       = $line;
558
    $globalline{line}       = $line;
(-)a/reports/reserves_stats.pl (-3 / +3 lines)
Lines 217-223 sub calculate { Link Here
217
    $strcalc .= "
217
    $strcalc .= "
218
        FROM (select * from reserves union select * from old_reserves) reserves
218
        FROM (select * from reserves union select * from old_reserves) reserves
219
        LEFT JOIN borrowers USING (borrowernumber)
219
        LEFT JOIN borrowers USING (borrowernumber)
220
	";
220
    ";
221
    $strcalc .= "LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber "
221
    $strcalc .= "LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber "
222
        if ( $linefield =~ /^biblio\./ or $colfield =~ /^biblio\./ or any { $_ =~ /biblio/ } keys %$filters_hashref );
222
        if ( $linefield =~ /^biblio\./ or $colfield =~ /^biblio\./ or any { $_ =~ /biblio/ } keys %$filters_hashref );
223
    $strcalc .= "LEFT JOIN items ON reserves.itemnumber=items.itemnumber "
223
    $strcalc .= "LEFT JOIN items ON reserves.itemnumber=items.itemnumber "
Lines 279-285 sub calculate { Link Here
279
            push @loopcell, {
279
            push @loopcell, {
280
                value => ( $$data{$row}{$col}{calculation} or "" ),
280
                value => ( $$data{$row}{$col}{calculation} or "" ),
281
281
282
                #						url_complement=>($urlbase=~/&amp;$/?$urlbase."&amp;":$urlbase)."filter_$linefield=$row&amp;filter_$colfield=$col"
282
                # url_complement=>($urlbase=~/&amp;$/?$urlbase."&amp;":$urlbase)."filter_$linefield=$row&amp;filter_$colfield=$col"
283
            };
283
            };
284
        }
284
        }
285
        push @looprow, {
285
        push @looprow, {
Lines 308-314 sub calculate { Link Here
308
    $globalline{looprow} = \@looprow;
308
    $globalline{looprow} = \@looprow;
309
    $globalline{loopcol} = \@loopcol;
309
    $globalline{loopcol} = \@loopcol;
310
310
311
    # 	# the foot (totals by borrower type)
311
    # # the foot (totals by borrower type)
312
    $globalline{loopfooter} = \@loopfooter;
312
    $globalline{loopfooter} = \@loopfooter;
313
    $globalline{total}      = $grantotal;
313
    $globalline{total}      = $grantotal;
314
    $globalline{line}       = $linefield;
314
    $globalline{line}       = $linefield;
(-)a/reports/serials_stats.pl (-1 / +1 lines)
Lines 143-149 if ($do_it) { Link Here
143
                                  LEFT JOIN aqbooksellers ON (subscription.aqbooksellerid=aqbooksellers.id ) 
143
                                  LEFT JOIN aqbooksellers ON (subscription.aqbooksellerid=aqbooksellers.id ) 
144
                                GROUP BY aqbooksellerid, aqbooksellers.name
144
                                GROUP BY aqbooksellerid, aqbooksellers.name
145
                                ORDER BY aqbooksellers.name ASC
145
                                ORDER BY aqbooksellers.name ASC
146
				"
146
        "
147
    );
147
    );
148
    $sth->execute();
148
    $sth->execute();
149
149
(-)a/rewrite-config.PL (-4 / +4 lines)
Lines 17-23 Link Here
17
#
17
#
18
# Current maintainer MJR http://mjr.towers.org.uk/
18
# Current maintainer MJR http://mjr.towers.org.uk/
19
#
19
#
20
# 2007/11/12	Added DB_PORT and changed other keywords to reflect multi-dbms support.	-fbcit
20
# 2007/11/12    Added DB_PORT and changed other keywords to reflect multi-dbms support.    -fbcit
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use Sys::Hostname;
23
use Sys::Hostname;
Lines 29-35 rewrite-config.PL - helper for the Koha packager and installer Link Here
29
29
30
=head1 SYNOPSIS
30
=head1 SYNOPSIS
31
31
32
	perl rewrite-config.PL configurationfile
32
    perl rewrite-config.PL configurationfile
33
33
34
=head1 DESCRIPTION
34
=head1 DESCRIPTION
35
35
Lines 52-59 WEBSERVER_HOST, WEBSERVER_IP, WEBSERVER_PORT, WEBSERVER_PORT_LIBRARIAN, ZEBRA_PA Link Here
52
52
53
To override the guessed hostname and email address, run:
53
To override the guessed hostname and email address, run:
54
54
55
	WEBSERVER_HOST=mysecrethostname.com.invalid \
55
    WEBSERVER_HOST=mysecrethostname.com.invalid \
56
	WEBMASTER_EMAIL=webmaster@publichost.com make install
56
    WEBMASTER_EMAIL=webmaster@publichost.com make install
57
57
58
Note that if WEBSERVER_HOST does not resolve to an IP address, you will
58
Note that if WEBSERVER_HOST does not resolve to an IP address, you will
59
also need to override WEBSERVER_IP.
59
also need to override WEBSERVER_IP.
(-)a/t/db_dependent/Record/Record.t (-4 / +4 lines)
Lines 98-105 ok( Link Here
98
ok( !$error, 'no errors in conversion' );
98
ok( !$error, 'no errors in conversion' );
99
99
100
#FIXME This test fails
100
#FIXME This test fails
101
#	$marcxml =~ s/\n//g;
101
#\t$marcxml =~ s/\n//g;
102
#	$marcxml =~ s/v\/ s/v\/s/g; # FIXME: bug in new_from_xml_record!!
102
#\t$marcxml =~ s/v\/ s/v\/s/g; # FIXME: bug in new_from_xml_record!!
103
#is ($marcxml,$marcxml_utf8, 'record matches antitype');
103
#is ($marcxml,$marcxml_utf8, 'record matches antitype');
104
104
105
ok(
105
ok(
Lines 109-116 ok( Link Here
109
ok( !$error, 'no errors in conversion' );
109
ok( !$error, 'no errors in conversion' );
110
110
111
#FIXME This test fails
111
#FIXME This test fails
112
#	$marcxml =~ s/\n//g;
112
#\t$marcxml =~ s/\n//g;
113
#	$marcxml =~ s/v\/ s/v\/s/g;
113
#\t$marcxml =~ s/v\/ s/v\/s/g;
114
#is ($marcxml,$marcxml_utf8, 'record matches antitype');
114
#is ($marcxml,$marcxml_utf8, 'record matches antitype');
115
115
116
print "\n2. checking binary MARC21 records with combining characters to MARCXML\n";
116
print "\n2. checking binary MARC21 records with combining characters to MARCXML\n";
(-)a/tools/letter.pl (-8 / +7 lines)
Lines 22-39 Link Here
22
 ALGO :
22
 ALGO :
23
 this script use an $op to know what to do.
23
 this script use an $op to know what to do.
24
 if $op is empty or none of the values listed below,
24
 if $op is empty or none of the values listed below,
25
	- the default screen is built (with all or filtered (if search string is set) records).
25
    - the default screen is built (with all or filtered (if search string is set) records).
26
	- the   user can click on add, modify or delete record.
26
    - the   user can click on add, modify or delete record.
27
    - filtering is done on the code field
27
    - filtering is done on the code field
28
 if $op=add_form
28
 if $op=add_form
29
	- if primary key (module + code) exists, this is a modification,so we read the required record
29
    - if primary key (module + code) exists, this is a modification,so we read the required record
30
	- builds the add/modify form
30
    - builds the add/modify form
31
 if $op=add_validate
31
 if $op=add_validate
32
	- the user has just send data, so we create/modify the record
32
    - the user has just send data, so we create/modify the record
33
 if $op=delete_form
33
 if $op=delete_form
34
	- we show the record selected and ask for confirmation
34
    - we show the record selected and ask for confirmation
35
 if $op=delete_confirm
35
 if $op=delete_confirm
36
	- we delete the designated record
36
    - we delete the designated record
37
37
38
=cut
38
=cut
39
39
40
- 

Return to bug 39834