use Memoize because Memcache::Memoize is slow for me
[koha.git] / admin / koha2marclinks.pl
index 8e0e105..a89681d 100755 (executable)
@@ -13,9 +13,9 @@
 # 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, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -63,17 +63,20 @@ my $dbh = C4::Context->dbh;
 ################## ADD_FORM ##################################
 # called by default. Used to create form to add or  modify a record
 if ( $op eq 'add_form' ) {
-    my $sth = $dbh->prepare(
-"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where kohafield=?"
-    );
+    my $data;
+    my $sth =
+      $dbh->prepare(
+"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where kohafield=? AND frameworkcode=''"
+      );
     $sth->execute( $tablename . "." . $kohafield );
     my ( $defaulttagfield, $defaulttagsubfield, $defaultliblibrarian ) =
       $sth->fetchrow;
 
     for ( my $i = 0 ; $i <= 9 ; $i++ ) {
-        my $sth2 = $dbh->prepare(
-"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where tagfield like ?"
-        );
+        my $sth2 =
+          $dbh->prepare(
+"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where tagfield like ? AND frameworkcode=''"
+          );
         $sth2->execute("$i%");
         my @marcarray;
         push @marcarray, " ";