Coping With Frameworks al allong MARC Editing.

BUG to be Fixed: Framework to save when editing a biblio.
This commit is contained in:
hdl 2005-05-24 20:29:39 +00:00
parent 1f16487cee
commit 5beaf5648f
5 changed files with 40 additions and 7 deletions

View File

@ -65,7 +65,7 @@ my $dbh=C4::Context->dbh;
my $biblionumber=$query->param('bib');
my $bibid = $query->param('bibid');
my $itemtype = $query->param('fwk');
my $itemtype = $query->param('frameworkcode');
my $popup = $query->param('popup'); # if set to 1, then don't insert links, it's just to show the biblio
$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber) unless $bibid;

View File

@ -340,13 +340,15 @@ my $op = $input->param('op');
my $frameworkcode = $input->param('frameworkcode');
my $dbh = C4::Context->dbh;
my $bibid;
if ($oldbiblionumber) {
$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$oldbiblionumber);
# find framework type
$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if $bibid;
$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if ($bibid and not ($frameworkcode));
}else {
$bibid = $input->param('bibid');
$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if $bibid;
$frameworkcode = &MARCfind_frameworkcode($dbh,$bibid) if ($bibid and not ($frameworkcode));
}
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui.simple/addbiblio.tmpl",
@ -357,6 +359,29 @@ my ($template, $loggedinuser, $cookie)
debug => 1,
});
#Getting the list of all frameworks
my $queryfwk =$dbh->prepare("select frameworktext, frameworkcode from biblio_framework");
$queryfwk->execute;
my %select_fwk;
my @select_fwk;
my $curfwk;
push @select_fwk,"";
$select_fwk{""} = "Default";
while (my ($description, $fwk) =$queryfwk->fetchrow) {
push @select_fwk, $fwk;
$select_fwk{$fwk} = $description;
}
$curfwk=$frameworkcode;
my $framework=CGI::scrolling_list( -name => 'Frameworks',
-id => 'Frameworks',
-default => $curfwk,
-OnChange => 'Changefwk(this);',
-values => \@select_fwk,
-labels => \%select_fwk,
-size => 1,
-multiple => 0 );
$template->param( framework => $framework);
$tagslib = &MARCgettagslib($dbh,1,$frameworkcode);
my $record=-1;
my $encoding="";

View File

@ -514,6 +514,10 @@ function PopupZ3950() {
}
newin=window.open("../z3950/search.pl?bibid=<!-- TMPL_VAR NAME="bibid" -->"+strQuery,"z3950search",'width=800,height=400,toolbar=false,scrollbars=yes');
}
function Changefwk(FwkList) {
var fwk = FwkList.options[FwkList.selectedIndex].value;
window.location = "addbiblio.pl?oldbiblionumber=<!--TMPL_VAR Name="oldbiblionumber"-->&frameworkcode="+fwk;
}
function AddField(field) {
document.forms[0].op.value = "addfield";

View File

@ -4,10 +4,10 @@
<!-- TMPL_UNLESS name="popup" -->
<div class="tabbed">
<h1 class="catalogue">Biblionumber : <!-- TMPL_VAR NAME="biblionumber" --> </h1>
<a href="acqui.simple/addbiblio.pl?oldbiblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" class="button catalogue">
<a href="javascript:Addbiblio('')" class="button catalogue">
Edit biblio
</a>
<a href="acqui.simple/addbiblio.pl?oldbiblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&op=duplicate" class="button catalogue">
<a href="javascript:Addbiblio('duplicate')" class="button catalogue">
Duplicate
</a>
<a href="acqui.simple/additem.pl?bibid=<!-- TMPL_VAR name="bibid"-->" class="button catalogue">
@ -402,7 +402,11 @@ function Dopop(link) {
}
function Changefwk(FwkList) {
var fwk = FwkList.options[FwkList.selectedIndex].value;
window.location = "MARCdetail.pl?bib=<!--TMPL_VAR Name="biblionumber"-->&amp;fwk="+fwk;
window.location = "MARCdetail.pl?bib=<!--TMPL_VAR Name="biblionumber"-->&frameworkcode="+fwk;
}
function Addbiblio(op) {
var fwk = window.document.fwks.Frameworks.options[window.document.fwks.Frameworks.selectedIndex].value;
window.location = "acqui.simple/addbiblio.pl?oldbiblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&frameworkcode="+fwk+"&op="+op;
}
</script>
</body>

View File

@ -69,7 +69,7 @@ a.catalogue:hover {
<!-- /TMPL_IF -->
</td>
<td align="right">
<b>Framework :<!--TMPL_VAR Name="framework" --></b>
<b><Form Name="fwks">Framework :<!--TMPL_VAR Name="framework" --></Form></b>
</td>
</tr>
</table>