X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=cataloguing%2Faddbiblio.pl;h=5069af9233a154192226856c23d1b0b95f3872e5;hb=9c5e40e4923179bf0b2b630d3e09797dc4c1fdb0;hp=fdbacd4902ab0d0c6c8181bcd5715174fd3bc473;hpb=da6f7fbb2a176a7194c122a3eeb8d5844fabbc86;p=koha.git
diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index fdbacd4902..5069af9233 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -172,7 +172,7 @@ sub build_authorized_values_list {
#---- branch
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
#Use GetBranches($onlymine)
- my $onlymine=C4::Context->preference('IndependantBranches') &&
+ my $onlymine=C4::Context->preference('IndependentBranches') &&
C4::Context->userenv &&
C4::Context->userenv->{flags} % 2 == 0 &&
C4::Context->userenv->{branch};
@@ -391,8 +391,8 @@ sub create_input {
maxlength=\"".$subfield_data{maxlength}."\"".
($is_readonly ? "readonly=\"readonly\"" : "").
"\/>
- {$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\" title=\"Tag Editor\">
+ {$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\">Tag editor
";
# it's a plugin field
}
@@ -421,7 +421,7 @@ sub create_input {
size=\"67\"
maxlength=\"".$subfield_data{maxlength}."\"
onblur=\"Blur$function_name($index_tag); \" \/>
-
+ Tag editor
$javascript";
} else {
warn "Plugin Failed: $plugin";
@@ -724,6 +724,7 @@ my $op = $input->param('op');
my $mode = $input->param('mode');
my $frameworkcode = $input->param('frameworkcode');
my $redirect = $input->param('redirect');
+my $searchid = $input->param('searchid');
my $dbh = C4::Context->dbh;
my $hostbiblionumber = $input->param('hostbiblionumber');
my $hostitemnumber = $input->param('hostitemnumber');
@@ -739,6 +740,7 @@ if ($frameworkcode eq 'FA'){
$userflags = 'fast_cataloging';
}
+my $changed_framework = $input->param('changed_framework');
$frameworkcode = &GetFrameworkCode($biblionumber)
if ( $biblionumber and not($frameworkcode) and $op ne 'addbiblio' );
@@ -819,6 +821,7 @@ if ($hostbiblionumber) {
if ($parentbiblio) {
my $marcflavour = C4::Context->preference('marcflavour');
$record = MARC::Record->new();
+ SetMarcUnicodeFlag($record, $marcflavour);
my $hostfield = prepare_host_field($parentbiblio,$marcflavour);
if ($hostfield) {
$record->append_fields($hostfield);
@@ -863,7 +866,7 @@ if ( $op eq "addbiblio" ) {
my $oldbibnum;
my $oldbibitemnum;
if (C4::Context->preference("BiblioAddsAuthorities")){
- my ($countlinked,$countcreated)=BiblioAutoLink($record,$frameworkcode);
+ BiblioAutoLink( $record, $frameworkcode );
}
if ( $is_a_modif ) {
ModBiblioframework( $biblionumber, $frameworkcode );
@@ -888,7 +891,7 @@ if ( $op eq "addbiblio" ) {
}
else {
print $input->redirect(
- "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode"
+ "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid"
);
exit;
}
@@ -897,19 +900,20 @@ if ( $op eq "addbiblio" ) {
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
my $views = { C4::Search::enabled_staff_search_views };
if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
- print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber");
+ print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
} elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) {
- print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode");
+ print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid");
} elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
- print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber");
+ print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
} else {
- print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber");
+ print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
}
exit;
}
elsif ($redirect eq "just_save"){
- print $input->redirect("/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode");
+ my $tab = $input->param('current_tab');
+ print $input->redirect("/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode&tab=$tab&searchid=$searchid");
}
else {
$template->param(
@@ -962,7 +966,10 @@ elsif ( $op eq "delete" ) {
$biblionumber = "";
}
- if ( $record ne -1 ) {
+ if($changed_framework eq "changed"){
+ $record = TransformHtmlToMarc( $input );
+ }
+ elsif( $record ne -1 ) {
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
eval {
my $uxml = $record->as_xml;
@@ -990,7 +997,9 @@ $template->param(
popup => $mode,
frameworkcode => $frameworkcode,
itemtype => $frameworkcode,
- borrowernumber => $loggedinuser,
+ borrowernumber => $loggedinuser,
+ tab => $input->param('tab')
);
+$template->{'VARS'}->{'searchid'} = $searchid;
output_html_with_http_headers $input, $cookie, $template->output;