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

(-)a/C4/Auth.pm (+1 lines)
Lines 186-191 sub get_template_and_user { Link Here
186
        # to create the template's parameters that will indicate
186
        # to create the template's parameters that will indicate
187
        # which menus the user can access.
187
        # which menus the user can access.
188
        if ( $flags && $flags->{superlibrarian}==1 ) {
188
        if ( $flags && $flags->{superlibrarian}==1 ) {
189
            $template->param( CAN_user_superlibrarian   => 1 );
189
            $template->param( CAN_user_circulate        => 1 );
190
            $template->param( CAN_user_circulate        => 1 );
190
            $template->param( CAN_user_catalogue        => 1 );
191
            $template->param( CAN_user_catalogue        => 1 );
191
            $template->param( CAN_user_parameters       => 1 );
192
            $template->param( CAN_user_parameters       => 1 );
(-)a/C4/Biblio.pm (-6 / +15 lines)
Lines 2955-2966 sub _koha_add_biblio { Link Here
2955
            seriestitle = ?,
2955
            seriestitle = ?,
2956
            copyrightdate = ?,
2956
            copyrightdate = ?,
2957
            datecreated=NOW(),
2957
            datecreated=NOW(),
2958
            abstract = ?
2958
            abstract = ?,
2959
            branchcode = ?
2959
        ";
2960
        ";
2960
    my $sth = $dbh->prepare($query);
2961
    my $sth = $dbh->prepare($query);
2961
    $sth->execute(
2962
    $sth->execute(
2962
        $frameworkcode, $biblio->{'author'},      $biblio->{'title'},         $biblio->{'unititle'}, $biblio->{'notes'},
2963
        $frameworkcode,           $biblio->{'author'},
2963
        $biblio->{'serial'},        $biblio->{'seriestitle'}, $biblio->{'copyrightdate'}, $biblio->{'abstract'}
2964
        $biblio->{'title'},       $biblio->{'unititle'},
2965
        $biblio->{'notes'},       $biblio->{'serial'},
2966
        $biblio->{'seriestitle'}, $biblio->{'copyrightdate'},
2967
        $biblio->{'abstract'},    $biblio->{'branchcode'},
2964
    );
2968
    );
2965
2969
2966
    my $biblionumber = $dbh->{'mysql_insertid'};
2970
    my $biblionumber = $dbh->{'mysql_insertid'};
Lines 2997-3011 sub _koha_modify_biblio { Link Here
2997
               serial = ?,
3001
               serial = ?,
2998
               seriestitle = ?,
3002
               seriestitle = ?,
2999
               copyrightdate = ?,
3003
               copyrightdate = ?,
3000
               abstract = ?
3004
               abstract = ?,
3005
               branchcode = ?
3001
        WHERE  biblionumber = ?
3006
        WHERE  biblionumber = ?
3002
        "
3007
        "
3003
      ;
3008
      ;
3004
    my $sth = $dbh->prepare($query);
3009
    my $sth = $dbh->prepare($query);
3005
3010
3006
    $sth->execute(
3011
    $sth->execute(
3007
        $frameworkcode,      $biblio->{'author'},      $biblio->{'title'},         $biblio->{'unititle'}, $biblio->{'notes'},
3012
        $frameworkcode,           $biblio->{'author'},
3008
        $biblio->{'serial'}, $biblio->{'seriestitle'}, $biblio->{'copyrightdate'}, $biblio->{'abstract'}, $biblio->{'biblionumber'}
3013
        $biblio->{'title'},       $biblio->{'unititle'},
3014
        $biblio->{'notes'},       $biblio->{'serial'},
3015
        $biblio->{'seriestitle'}, $biblio->{'copyrightdate'},
3016
        $biblio->{'abstract'},    $biblio->{'branchcode'},
3017
        $biblio->{'biblionumber'}
3009
    ) if $biblio->{'biblionumber'};
3018
    ) if $biblio->{'biblionumber'};
3010
3019
3011
    if ( $dbh->errstr || !$biblio->{'biblionumber'} ) {
3020
    if ( $dbh->errstr || !$biblio->{'biblionumber'} ) {
(-)a/catalogue/detail.pl (+2 lines)
Lines 61-66 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
61
my $biblionumber = $query->param('biblionumber');
61
my $biblionumber = $query->param('biblionumber');
62
my $record       = GetMarcBiblio($biblionumber);
62
my $record       = GetMarcBiblio($biblionumber);
63
63
64
$template->param( biblio => GetBiblio( $biblionumber ) );
65
64
if ( not defined $record ) {
66
if ( not defined $record ) {
65
    # biblionumber invalid -> report and exit
67
    # biblionumber invalid -> report and exit
66
    $template->param( unknownbiblionumber => 1,
68
    $template->param( unknownbiblionumber => 1,
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 126-131 CREATE TABLE `biblio` ( -- table that stores bibliographic information Link Here
126
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
126
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
127
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
127
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
128
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
128
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
129
  `branchcode` VARCHAR( 10 ) NULL DEFAULT NULL, -- branchcode for the opationl 'owner' of this record.
129
  PRIMARY KEY  (`biblionumber`),
130
  PRIMARY KEY  (`biblionumber`),
130
  KEY `blbnoidx` (`biblionumber`)
131
  KEY `blbnoidx` (`biblionumber`)
131
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
132
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Lines 612-617 CREATE TABLE `deletedbiblio` ( -- stores information about bibliographic records Link Here
612
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
613
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
613
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
614
  `datecreated` DATE NOT NULL, -- the date this record was added to Koha
614
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
615
  `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21)
616
  `branchcode` VARCHAR( 10 ) NULL DEFAULT NULL, -- branchcode for the opationl 'owner' of this record.
615
  PRIMARY KEY  (`biblionumber`),
617
  PRIMARY KEY  (`biblionumber`),
616
  KEY `blbnoidx` (`biblionumber`)
618
  KEY `blbnoidx` (`biblionumber`)
617
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
619
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 6818-6823 if ( CheckVersion($DBversion) ) { Link Here
6818
            'YesNo'
6818
            'YesNo'
6819
        )
6819
        )
6820
    });
6820
    });
6821
6822
    $dbh->do(q{
6823
        INSERT INTO systempreferences (
6824
            variable,
6825
            value,
6826
            options,
6827
            explanation,
6828
            type
6829
        ) VALUES (
6830
            'IndependentBranchesMarcEditing',
6831
            '0',
6832
            '',
6833
            "If on, this preference disallows the editing of a bibliographic record unless the logged in library's branchcode matchs the branchcode stored in biblio.branchcode.",
6834
            'YesNo'
6835
        )
6836
    });
6837
6838
    $dbh->do(q{
6839
        ALTER TABLE biblio ADD branchcode VARCHAR( 10 ) NULL DEFAULT NULL
6840
    });
6841
6842
    $dbh->do(q{
6843
        ALTER TABLE deletedbiblio ADD branchcode VARCHAR( 10 ) NULL DEFAULT NULL
6844
    });
6845
6821
    SetVersion ($DBversion);
6846
    SetVersion ($DBversion);
6822
}
6847
}
6823
6848
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-5 / +16 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
2
1
	<script type="text/javascript">
3
	<script type="text/javascript">
2
	//<![CDATA[
4
	//<![CDATA[
3
	[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
5
	[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
Lines 137-143 CAN_user_serials_create_subscription ) %] Link Here
137
    <div class="btn-group">
139
    <div class="btn-group">
138
    <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button>
140
    <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button>
139
        <ul class="dropdown-menu">
141
        <ul class="dropdown-menu">
140
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
142
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) && ( !biblio.branchcode || CAN_user_superlibrarian || ( !Koha.Preference( 'IndependentBranchesMarcEditing' ) || ( Koha.Preference( 'IndependentBranchesMarcEditing' ) && LoginBranchcode == biblio.branchcode ) ) ) %]
141
            <li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=">Edit record</a></li>
143
            <li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=">Edit record</a></li>
142
            [% END %]
144
            [% END %]
143
145
Lines 155-165 CAN_user_serials_create_subscription ) %] Link Here
155
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image">Upload image</a>[% END %][% END %]
157
            [% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]<li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&amp;filetype=image">Upload image</a>[% END %][% END %]
156
158
157
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
159
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
158
            <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
160
                <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% current_framework %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
159
            <li><a href="#" id="z3950copy">Replace record via Z39.50</a></li>
161
                <li><a href="#" id="z3950copy">Replace record via Z39.50</a></li>
162
163
164
                [% IF ( !biblio.branchcode || CAN_user_superlibrarian || ( !Koha.Preference( 'IndependentBranchesMarcEditing' ) || ( Koha.Preference( 'IndependentBranchesMarcEditing' ) && LoginBranchcode == biblio.branchcode ) ) ) %]
165
                    [% IF ( count ) %]
166
                        <li class="disabled">
167
                    [% ELSE %]
168
                        <li>
169
                    [% END %]
160
170
161
            [% IF ( count ) %]<li class="disabled">[% ELSE %]<li>[% END %]
171
                        <a id="deletebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=[% biblionumber %]">Delete record</a>
162
            <a id="deletebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&amp;biblionumber=[% biblionumber %]">Delete record</a></li>
172
                    </li>
173
                [% END %]
163
            [% END %]
174
            [% END %]
164
175
165
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
176
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +7 lines)
Lines 84-89 Administration: Link Here
84
                  yes: Prevent
84
                  yes: Prevent
85
                  no: "Don't prevent"
85
                  no: "Don't prevent"
86
            - OPAC search results from containing records that do not have item's owned by the library defined by the OPAC's branch via the URL.
86
            - OPAC search results from containing records that do not have item's owned by the library defined by the OPAC's branch via the URL.
87
        -
88
            - pref: IndependentBranchesMarcEditing
89
              default: 0
90
              choices:
91
                  yes: Prevent
92
                  no: "Don't prevent"
93
            - the logged in library from editing bibliographic records of other libraries. The owning library is defined by the branchcode in biblio.branchcode which should be mapped to a MARC field ( 951$o ).
87
    CAS Authentication:
94
    CAS Authentication:
88
        -
95
        -
89
            - pref: casAuthentication
96
            - pref: casAuthentication
90
- 

Return to bug 10200