[Koha-cvs] koha/cataloguing addbiblio.pl

Henri-Damien LAURENT laurenthdl at alinto.com
Mon Jul 16 17:49:53 CEST 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Changes by:	Henri-Damien LAURENT <hdl>	07/07/16 15:49:53

Modified files:
	cataloguing    : addbiblio.pl 

Log message:
	Adding a biblio can be executed in a popup now.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/addbiblio.pl?cvsroot=koha&r1=1.28&r2=1.29

Patches:
Index: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/cataloguing/addbiblio.pl,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- addbiblio.pl	25 Jun 2007 15:01:46 -0000	1.28
+++ addbiblio.pl	16 Jul 2007 15:49:53 -0000	1.29
@@ -1,6 +1,6 @@
 #!/usr/bin/perl 
 
-# $Id: addbiblio.pl,v 1.28 2007/06/25 15:01:46 tipaul Exp $
+# $Id: addbiblio.pl,v 1.29 2007/07/16 15:49:53 hdl Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -463,6 +463,7 @@
 my $breedingid = $input->param('breedingid');
 my $z3950 = $input->param('z3950');
 my $op = $input->param('op');
+my $mode = $input->param('mode');
 my $frameworkcode = $input->param('frameworkcode');
 my $dbh = C4::Context->dbh;
 
@@ -541,7 +542,7 @@
 #         die;
     }
     # check for a duplicate
-    my ($duplicatebiblionumber,$duplicatebiblionumber,$duplicatetitle) = FindDuplicate($record) if ($op eq "addbiblio") && (!$is_a_modif);
+    my ($duplicatebiblionumber,$duplicatetitle) = FindDuplicate($record) if (!$is_a_modif);
     my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
     # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
     if (!$duplicatebiblionumber or $confirm_not_duplicate) {
@@ -556,9 +557,25 @@
             ($biblionumber,$oldbibitemnum) = AddBiblio($record,$frameworkcode);
         }
     # now, redirect to additem page
+        if ($mode ne "popup"){
         print $input->redirect("/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode");
         exit;
     } else {
+          $template->param(
+            biblionumber => $biblionumber,
+            done         =>1,
+            popup        =>1
+          );
+          $template->param( title => $record->subfield('200',"a") ) if ($record ne "-1" && C4::Context->preference('marcflavour') =~/unimarc/i);
+          $template->param( title => $record->title() ) if ($record ne "-1" && C4::Context->preference('marcflavour') eq "usmarc");
+          $template->param(
+                  popup => $mode,
+                  itemtype => $frameworkcode, # HINT: if the library has itemtype = framework, itemtype is auto filled !
+                  );
+          output_html_with_http_headers $input, $cookie, $template->output;
+          exit;     
+        }        
+    } else {
     # it may be a duplicate, warn the user and do nothing
         build_tabs ($template, $record, $dbh,$encoding);
         build_hidden_data;
@@ -652,6 +669,7 @@
 }
 $template->param( title => $record->title() ) if ($record ne "-1");
 $template->param(
+        popup => $mode,
         frameworkcode => $frameworkcode,
         itemtype => $frameworkcode, # HINT: if the library has itemtype = framework, itemtype is auto filled !
         hide_marc => C4::Context->preference('hide_marc'),





More information about the Koha-cvs mailing list