Bug 17189: Replace occurrences of 'use Koha::Cache'
[koha.git] / svc / bib_profile
index 41ea042..75a55c6 100755 (executable)
@@ -4,22 +4,24 @@
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 #
 
 use strict;
-use CGI;
+use warnings;
+
+use CGI qw ( -utf8 );
 use C4::Auth qw/check_api_auth/;
 use C4::Context;
 use C4::Koha;
@@ -27,7 +29,7 @@ use XML::Simple;
 
 my $query = new CGI;
 
-my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 1} );
+my ($status, $cookie, $sessionID) = check_api_auth($query, { editcatalogue => 'edit_catalogue'} );
 
 if ($status eq "ok") {
     print $query->header(-type => 'text/xml', cookie => $cookie);
@@ -70,6 +72,7 @@ sub _get_mandatory_subfields {
                                     FROM marc_subfield_structure 
                                     WHERE frameworkcode = '' 
                                     AND tagsubfield <> '\@' 
+                                    AND kohafield <> 'biblioitems.itemtype'
                                     AND mandatory = 1");
     $sth->execute();
     my @subfields = ();