koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha bull/statecollection.pl C4/Biblio.pm C4/Bu... [rel_2_2]


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha bull/statecollection.pl C4/Biblio.pm C4/Bu... [rel_2_2]
Date: Tue, 07 Feb 2006 15:33:36 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Henri-Damien LAURENT <address@hidden>   06/02/07 15:33:35

Modified files:
        bull           : statecollection.pl 
        C4             : Biblio.pm Bull.pm Koha.pm 
        koha-tmpl/intranet-tmpl/default/en/bull: statecollection.tmpl 
        updater        : updatedatabase 

Log message:
        Adding a new system preference : serialsadditem
        
        Adding two functions in Biblio.pm : getitemlocation and getitemstatus 
(helpful to get location list and status list, status is supposed to be in 
relation with items.notforloan)
        
        Adding a new function in Bull.pm : serialsitemize which take serial id 
and item information and creates the item
        Modifying statecollection to add a new line (used for data input)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/bull/statecollection.pl.diff?only_with_tag=rel_2_2&tr1=1.3.2.10&tr2=1.3.2.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Biblio.pm.diff?only_with_tag=rel_2_2&tr1=1.115.2.28&tr2=1.115.2.29&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Bull.pm.diff?only_with_tag=rel_2_2&tr1=1.6.2.19&tr2=1.6.2.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Koha.pm.diff?only_with_tag=rel_2_2&tr1=1.22.2.3&tr2=1.22.2.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl.diff?only_with_tag=rel_2_2&tr1=1.4.2.6&tr2=1.4.2.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/updater/updatedatabase.diff?only_with_tag=rel_2_2&tr1=1.100.2.22&tr2=1.100.2.23&r1=text&r2=text

Patches:
Index: koha/C4/Biblio.pm
diff -u koha/C4/Biblio.pm:1.115.2.28 koha/C4/Biblio.pm:1.115.2.29
--- koha/C4/Biblio.pm:1.115.2.28        Mon Jan 30 16:06:26 2006
+++ koha/C4/Biblio.pm   Tue Feb  7 15:33:35 2006
@@ -72,6 +72,8 @@
   
   &FindDuplicate
   &DisplayISBN
+  &getitemstatus
+  &getitemlocation
 );
 
 #
@@ -2778,6 +2780,129 @@
        return "$seg1-$seg2-$seg3-$seg4";
 }
 
+=head2 getitemstatus
+
+  $itemstatushash = &getitemstatus($fwkcode);
+  returns information about status.
+  Can be MARC dependant.
+  fwkcode is optional.
+  But basically could be can be loan or not
+  Create a status selector with the following code
+  
+=head3 in PERL SCRIPT
+
+my $itemstatushash = getitemstatus;
+my @itemstatusloop;
+foreach my $thisstatus (keys %$itemstatushash) {
+       my %row =(value => $thisstatus,
+                               statusname => 
$itemstatushash->{$thisstatus}->{'statusname'},
+                       );
+       push @itemstatusloop, \%row;
+}
+$template->param(statusloop=>address@hidden);
+
+
+=head3 in TEMPLATE  
+                       <select name="statusloop">
+                               <option value="">Default</option>
+                       <!-- TMPL_LOOP name="statusloop" -->
+                               <option value="<!-- TMPL_VAR name="value" -->" 
<!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR 
name="statusname" --></option>
+                       <!-- /TMPL_LOOP -->
+                       </select>
+
+=cut
+sub getitemstatus {
+# returns a reference to a hash of references to status...
+       my ($fwk)address@hidden;
+       my %itemstatus;
+       my $dbh = C4::Context->dbh;
+       my $sth;
+       $fwk='' unless ($fwk);
+       my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.notforloan",$fwk);
+       if ($tag and $subfield){
+               my $sth = $dbh->prepare("select authorised_value from 
marc_subfield_structure where tagfield=? and tagsubfield=? and 
frameworkcode=?");
+               $sth->execute($tag,$subfield,$fwk);
+               if (my ($authorisedvaluecat)=$sth->fetchrow){
+                       my $authvalsth=$dbh->prepare("select authorised_value, 
lib from authorised_values where category=? order by lib");
+                       $authvalsth->execute($authorisedvaluecat);
+                       while (my ($authorisedvalue, 
$lib)=$authvalsth->fetchrow){
+                               $itemstatus{$authorisedvalue}=$lib;
+                       }
+                       $authvalsth->finish;
+                       return \%itemstatus;
+                       exit 1;
+               } else{
+                       #No authvalue list
+                       # build default
+               }
+               $sth->finish;
+       }
+       #No authvalue list
+       #build default
+       $itemstatus{"1"}="Not For Loan";
+       return \%itemstatus;
+}
+=head2 getitemlocation
+
+  $itemlochash = &getitemlocation($fwk);
+  returns informations about location.
+  where fwk stands for an optional framework code.
+  Create a location selector with the following code
+  
+=head3 in PERL SCRIPT
+
+my $itemlochash = getitemlocation;
+my @itemlocloop;
+foreach my $thisloc (keys %$itemlochash) {
+       my $selected = 1 if $thisbranch eq $branch;
+       my %row =(locval => $thisloc,
+                               selected => $selected,
+                               locname => $itemlochash->{$thisloc},
+                       );
+       push @itemlocloop, \%row;
+}
+$template->param(itemlocationloop => address@hidden);
+
+=head3 in TEMPLATE  
+                       <select name="location">
+                               <option value="">Default</option>
+                       <!-- TMPL_LOOP name="itemlocationloop" -->
+                               <option value="<!-- TMPL_VAR name="locval" -->" 
<!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR 
name="locname" --></option>
+                       <!-- /TMPL_LOOP -->
+                       </select>
+
+=cut
+sub getitemlocation {
+# returns a reference to a hash of references to location...
+       my ($fwk)address@hidden;
+       my %itemlocation;
+       my $dbh = C4::Context->dbh;
+       my $sth;
+       $fwk='' unless ($fwk);
+       my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.location",$fwk);
+       if ($tag and $subfield){
+               my $sth = $dbh->prepare("select authorised_value from 
marc_subfield_structure where tagfield=? and tagsubfield=? and 
frameworkcode=?");
+               $sth->execute($tag,$subfield,$fwk);
+               if (my ($authorisedvaluecat)=$sth->fetchrow){
+                       my $authvalsth=$dbh->prepare("select authorised_value, 
lib from authorised_values where category=? order by lib");
+                       $authvalsth->execute($authorisedvaluecat);
+                       while (my ($authorisedvalue, 
$lib)=$authvalsth->fetchrow){
+                               $itemlocation{$authorisedvalue}=$lib;
+                       }
+                       $authvalsth->finish;
+                       return \%itemlocation;
+                       exit 1;
+               } else{
+                       #No authvalue list
+                       # build default
+               }
+               $sth->finish;
+       }
+       #No authvalue list
+       #build default
+       $itemlocation{"1"}="Not For Loan";
+       return \%itemlocation;
+}
 
 END { }    # module clean-up code here (global destructor)
 
@@ -2791,8 +2916,16 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.115.2.28 2006/01/30 16:06:26 hdl Exp $
+# $Id: Biblio.pm,v 1.115.2.29 2006/02/07 15:33:35 hdl Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.115.2.29  2006/02/07 15:33:35  hdl
+# Adding a new system preference : serialsadditem
+#
+# Adding two functions in Biblio.pm : getitemlocation and getitemstatus 
(helpful to get location list and status list, status is supposed to be in 
relation with items.notforloan)
+#
+# Adding a new function in Bull.pm : serialsitemize which take serial id and 
item information and creates the item
+# Modifying statecollection to add a new line (used for data input)
+#
 # Revision 1.115.2.28  2006/01/30 16:06:26  hdl
 # BugFix : leader management was annoying for MARCadditem. Changing. Avoiding 
fields which tag is under 100. (Could be a simple different from 000) But in 
UNIMARC, fields under 100 donot have subfields.
 #
Index: koha/C4/Bull.pm
diff -u koha/C4/Bull.pm:1.6.2.19 koha/C4/Bull.pm:1.6.2.20
--- koha/C4/Bull.pm:1.6.2.19    Thu Dec  1 15:05:59 2005
+++ koha/C4/Bull.pm     Tue Feb  7 15:33:35 2006
@@ -22,6 +22,8 @@
 use C4::Date;
 use Date::Manip;
 use C4::Suggestions;
+use C4::Biblio;
+use C4::Search;
 require Exporter;
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@@ -47,7 +49,7 @@
 @EXPORT = qw(&newsubscription &modsubscription &delsubscription 
&getsubscriptions &getsubscription 
                        &getsubscriptionfrombiblionumber 
&get_subscription_list_from_biblionumber
                        &get_full_subscription_list_from_biblionumber 
-                       &modsubscriptionhistory &newissue
+                       &modsubscriptionhistory &newissue &serialsitemize
                        &getserials &getlatestserials &serialchangestatus
                        &Find_Next_Date, &Get_Next_Seq
                        &hassubscriptionexpired &subscriptionexpirationdate 
&subscriptionrenew
@@ -450,6 +452,100 @@
        $sth->execute($recievedlist,$missinglist,$subscriptionid);
 }
 
+=head2 serialsitemize
+
+  serialitemize($serialid, $info);
+  $info is a hashref containing  barcode branch, itemcallnumber, status, 
location
+  $serialid the serialid
+=cut
+sub serialsitemize {
+       my ($serialid, $info) address@hidden;
+
+       my $dbh= C4::Context->dbh;
+       my $sth=$dbh->prepare("SELECT * from serial WHERE serialid=?");
+       $sth->execute($serialid);
+       my $data=$sth->fetchrow_hashref;
+       my 
$bibid=MARCfind_MARCbibid_from_oldbiblionumber($dbh,$data->{biblionumber});
+       my $fwk=MARCfind_frameworkcode($dbh,$bibid);
+       if ($info->{barcode}){
+               my @errors;
+               my $exists = itemdata($info->{'barcode'});
+               push @errors,"barcode_not_unique" if($exists);
+               unless ($exists){
+                       my $marcrecord = MARC::Record->new();
+                       my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.barcode",$fwk);
+                       warn "items.barcode : $tag , $subfield";
+                       my $newField = MARC::Field->new(
+                               "$tag",'','',
+                               "$subfield" => $info->{barcode}
+                       );
+                       $marcrecord->insert_fields_ordered($newField);
+                       if ($info->{branch}){
+                               my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.homebranch",$fwk);
+                               warn "items.homebranch : $tag , $subfield";
+                               if ($marcrecord->field($tag)) {
+                                       
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{branch})
+                               }else {
+                                       my $newField = MARC::Field->new(
+                                               "$tag",'','',
+                                               "$subfield" => $info->{branch}
+                                       );
+                                       
$marcrecord->insert_fields_ordered($newField);
+                               }
+                               my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.holdingbranch",$fwk);
+                               if ($marcrecord->field($tag)) {
+                                       
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{branch})
+                               }else {
+                                       my $newField = MARC::Field->new(
+                                               "$tag",'','',
+                                               "$subfield" => $info->{branch}
+                                       );
+                                       
$marcrecord->insert_fields_ordered($newField);
+                               }
+                       }
+                       if ($info->{notes}){
+                               my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.itemnotes",$fwk);
+                               if ($marcrecord->field($tag)) {
+                                       
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{notes})
+                               }else {
+                                       my $newField = MARC::Field->new(
+                                               "$tag",'','',
+                                               "$subfield" => $info->{notes}
+                                       );
+                                       
$marcrecord->insert_fields_ordered($newField);
+                               }
+                       }
+                       if ($info->{location}){
+                               my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.location",$fwk);
+                               if ($marcrecord->field($tag)) {
+                                       
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{location})
+                               }else {
+                                       my $newField = MARC::Field->new(
+                                               "$tag",'','',
+                                               "$subfield" => $info->{location}
+                                       );
+                                       
$marcrecord->insert_fields_ordered($newField);
+                               }
+                       }
+                       if ($info->{status}){
+                               my 
($tag,$subfield)=MARCfind_marc_from_kohafield($dbh,"items.notforloan",$fwk);
+                               if ($marcrecord->field($tag)) {
+                                       
$marcrecord->field($tag)->add_subfields("$subfield" => $info->{status})
+                               }else {
+                                       my $newField = MARC::Field->new(
+                                               "$tag",'','',
+                                               "$subfield" => $info->{status}
+                                       );
+                                       
$marcrecord->insert_fields_ordered($newField);
+                               }
+                       }
+                       NEWnewitem($dbh,$marcrecord,$bibid);
+                       return 1;
+               }
+               return (0,@errors);
+       }
+}
+
 sub delissue {
        my ($serialseq,$subscriptionid) = @_;
        my $dbh = C4::Context->dbh;
@@ -457,6 +553,7 @@
        $sth->execute($serialseq,$subscriptionid);
 }
 
+
 sub Get_Next_Date(@) {
        my ($planneddate,$subscription) = @_;
        my $resultdate;
Index: koha/C4/Koha.pm
diff -u koha/C4/Koha.pm:1.22.2.3 koha/C4/Koha.pm:1.22.2.4
--- koha/C4/Koha.pm:1.22.2.3    Fri Dec 30 10:53:42 2005
+++ koha/C4/Koha.pm     Tue Feb  7 15:33:35 2006
@@ -61,7 +61,7 @@
                        &getframeworks &getframeworkinfo
                        &getauthtypes &getauthtype
                        &getallthemes &getalllanguages
-                       &getallbranches
+                       &getallbranches 
                        $DEBUG);
 
 use vars qw();
Index: koha/bull/statecollection.pl
diff -u koha/bull/statecollection.pl:1.3.2.10 
koha/bull/statecollection.pl:1.3.2.11
--- koha/bull/statecollection.pl:1.3.2.10       Sun Feb  5 21:59:21 2006
+++ koha/bull/statecollection.pl        Tue Feb  7 15:33:35 2006
@@ -4,6 +4,8 @@
 use CGI;
 use C4::Auth;
 use C4::Date;
+use C4::Biblio;
+use C4::Koha;
 use C4::Output;
 use C4::Interface::CGI::Output;
 use C4::Context;
@@ -26,8 +28,15 @@
 my @planneddates = $query->param('planneddate');
 my @status = $query->param('status');
 my @notes = $query->param('notes');
+my @barcodes = $query->param('barcode');
+my @itemcallnumbers = $query->param('itemcallnumber');
+my @locations = $query->param('location');
+my @itemstatus = $query->param('itemstatus');
+my @homebranches = $query->param('branch');
 my $hassubscriptionexpired = hassubscriptionexpired($subscriptionid);
 my $subscription=getsubscription($subscriptionid);
+
+
 if ($op eq 'modsubscriptionhistory') {
        
modsubscriptionhistory($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
 }
@@ -36,23 +45,39 @@
        my $sth = $dbh->prepare("select status from serial where serialid=?");
        for (my $i=0;$i<=$#serialids;$i++) {
                $sth->execute($serialids[$i]);
+               
                my ($oldstatus) = $sth->fetchrow;
                if ($serialids[$i]) {
                        
serialchangestatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),$status[$i],$notes[$i])
 unless ($hassubscriptionexpired && $oldstatus == 1);
+                       if (($status[$i]==2) && 
C4::Context->preference("serialsadditems")){
+                               my %info;
+                               $info{branch}=$homebranches[$i];
+                               $info{barcode}=$barcodes[$i];
+                               $info{itemcallnumber}=$itemcallnumbers[$i];
+                               $info{location}=$locations[$i];
+                               $info{status}=$itemstatus[$i];
+                               $info{notes}=$serialseqs[$i];
+                               my ($status, @errors)= 
serialsitemize($serialids[$i],\%info);
+                       }
                } else {
                        # add a special issue
                        if ($serialseqs[$i]) {
                                
newissue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i],
 format_date_in_iso($planneddates[$i]));
                        }
+                       if (($status[$i]==2) && 
C4::Context->preference("serialsadditems")){
+                               my %info;
+                               $info{branch}=$homebranches[$i];
+                               $info{barcode}=$barcodes[$i];
+                               $info{itemcallnumber}=$itemcallnumbers[$i];
+                               $info{location}=$locations[$i];
+                               $info{status}=$itemstatus[$i];
+                               $info{notes}=$serialseqs[$i];
+                               my ($status, @errors)= 
serialsitemize($serialids[$i],\%info);
+                       }
+
                }
        }
 }
-my $subs = &getsubscription($subscriptionid);
-my ($totalissues,@serialslist) = getserials($subscriptionid);
-
-my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid 
= ?");
-$sth->execute($subscriptionid);
-my $solhistory = $sth->fetchrow_hashref;
 my ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "bull/statecollection.tmpl",
                                query => $query,
@@ -62,7 +87,51 @@
                                debug => 1,
                                });
 
-       $template->param(
+my $subs = &getsubscription($subscriptionid);
+my ($totalissues,@serialslist) = getserials($subscriptionid);
+my $branches = getbranches;
+my @branchloop;
+foreach my $thisbranch (keys %$branches) {
+       my %row =(value => $thisbranch,
+                               branchname => 
$branches->{$thisbranch}->{'branchname'},
+                       );
+       push @branchloop, \%row;
+}
+
+my $itemstatushash = getitemstatus;
+my @itemstatusloop;
+foreach my $thisitemstatus (keys %$itemstatushash) {
+       my %row =(itemval => $thisitemstatus,
+                               itemlib => $itemstatushash->{$thisitemstatus},
+                       );
+       warn "".$row{'itemval'}.", ". $row{"itemlib"};
+       push @itemstatusloop, \%row;
+}
+
+my $itemlocationhash = getitemlocation;
+my @itemlocationloop;
+foreach my $thisitemlocation (keys %$itemlocationhash) {
+       my %row =(value => $thisitemlocation,
+                               itemlocationname => 
$itemlocationhash->{$thisitemlocation},
+                       );
+       push @itemlocationloop, \%row;
+}
+                               
+foreach my $data (@serialslist){
+       $data->{"itemstatusloop"address@hidden if 
((C4::Context->preference("serialsadditems")) && scalar(@itemstatusloop));
+       $data->{"itemlocationloop"address@hidden if 
((C4::Context->preference("serialsadditems")) && scalar(@itemlocationloop));
+       $data->{"branchloop"address@hidden;
+                               }
+my $sth=$dbh->prepare("select * from subscriptionhistory where subscriptionid 
= ?");
+$sth->execute($subscriptionid);
+my $solhistory = $sth->fetchrow_hashref;
+
+$template->param(serialadditems =>C4::Context->preference("serialsadditems"),
+                                       branchloop => address@hidden,
+                                       ) if 
(C4::Context->preference("serialsadditems"));
+$template->param(itemstatus=>1,itemstatusloop=>address@hidden) if 
((C4::Context->preference("serialsadditems")) && scalar(@itemstatusloop));
+$template->param(itemlocation=>1,itemlocationloop=>address@hidden) if 
((C4::Context->preference("serialsadditems")) && scalar(@itemlocationloop));
+$template->param(
                        serialslist => address@hidden,
                        biblionumber => $subscription->{biblionumber},
                        histstartdate => 
format_date($solhistory->{'histstartdate'}),
@@ -76,7 +145,7 @@
                        biblionumber => $subs->{biblionumber},
                        hassubscriptionexpired =>$hassubscriptionexpired,
                        intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
-               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
-               IntranetNav => C4::Context->preference("IntranetNav"),
+                       intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+                       IntranetNav => C4::Context->preference("IntranetNav"),
                );
 output_html_with_http_headers $query, $cookie, $template->output;
Index: koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl
diff -u 
koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl:1.4.2.6 
koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl:1.4.2.7
--- koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl:1.4.2.6   
Fri Sep 23 09:51:07 2005
+++ koha/koha-tmpl/intranet-tmpl/default/en/bull/statecollection.tmpl   Tue Feb 
 7 15:33:35 2006
@@ -32,7 +32,7 @@
        <!-- TMPL_LOOP name="serialslist" -->
                <tr>
                        <td>
-                               <input type="text" name="serialseq" value="<!-- 
TMPL_VAR name="serialseq" -->" size=50 maxlength=100>
+                               Issue <input type="text" name="serialseq" 
value="<!-- TMPL_VAR name="serialseq" -->" size=50 maxlength=100>
                        </td>
                        <td>
                                <input type="text" name="planneddate" 
value="<!-- TMPL_VAR name="planneddate" -->" size=10 maxlength=15>
@@ -74,6 +74,46 @@
                                <input type="text" name="notes" value="<!-- 
TMPL_VAR name="notes" -->" size=20 maxlength=255>
                        </td>
                </tr>
+               <!--TMPL_IF Name="serialadditems" -->
+               <tr>
+                       <td>
+                               Callnumber <input type="text" 
name="itemcallnumber" value="" size=10 maxlength=15>
+                               Barcode <input type="text" name="barcode" 
value="" size=20 maxlength=20>
+                       </td>
+                       <td>
+                               <select name="branch" size="1">
+                                               <option value="">Branch</option>
+                       <!-- TMPL_LOOP name="branchloop" -->
+                               <option value="<!-- TMPL_VAR name="value" -->" 
<!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR 
name="branchname" --></option>
+                       <!-- /TMPL_LOOP -->
+                               </select>
+                       </td>
+                       <td>
+                               <!--TMPL_IF Name="itemstatus"-->
+                                       <select name="status" size="1">
+                                               <option value="">Item 
Status</option>
+                                               <!-- TMPL_LOOP 
name="itemstatusloop" -->
+                                                       <option value="<!-- 
TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- 
/TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
+                                               <!-- /TMPL_LOOP -->
+                                       </select>
+                               <!-- TMPL_ELSE -->
+                               &nbsp;
+                               <!--/TMPL_IF-->
+                       </td>
+                       <td>
+                               <!--TMPL_IF Name="itemlocation"-->
+                                       <select name="location" size="1">
+                                               <option 
value="">Location</option>
+                                               <!-- TMPL_LOOP 
name="itemlocationloop" -->
+                                                       <option value="<!-- 
TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- 
/TMPL_IF -->><!-- TMPL_VAR name="itemlocationname" --></option>
+                                               <!-- /TMPL_LOOP -->
+                                       </select>
+                               <!-- TMPL_ELSE -->
+                               &nbsp;
+                               <!--/TMPL_IF-->
+                       </td>
+               </tr>
+               <!--/TMPL_IF-->
        <!-- /TMPL_LOOP -->
        <!-- TMPL_UNLESS name="hassubscriptionexpired" -->
                <tr>
@@ -92,6 +132,46 @@
                                </select>
                        </td>
                </tr>
+               <!--TMPL_IF Name="serialadditems" -->
+               <tr>
+                       <td>
+                               Callnumber <input type="text" 
name="itemcallnumber" value="" size=10 maxlength=15>
+                               Barcode <input type="text" name="barcode" 
value="" size=20 maxlength=20>
+                       </td>
+                       <td>
+                               <select name="branch" size="1">
+                                               <option value="">Branch</option>
+                       <!-- TMPL_LOOP name="branchloop" -->
+                               <option value="<!-- TMPL_VAR name="value" -->" 
<!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR 
name="branchname" --></option>
+                       <!-- /TMPL_LOOP -->
+                               </select>
+                       </td>
+                       <td>
+                               <!-- TMPL_IF Name="itemstatus"-->
+                                       <select name="status" size="1">
+                                               <option value="">Item 
Status</option>
+                                               <!-- TMPL_LOOP 
name="itemstatusloop" -->
+                                                       <option value="<!-- 
TMPL_VAR name="itemval" -->" <!-- TMPL_IF name="selected" -->selected<!-- 
/TMPL_IF -->><!-- TMPL_VAR name="itemlib" --></option>
+                                               <!-- /TMPL_LOOP -->
+                                       </select>
+                               <!-- TMPL_ELSE -->
+                               &nbsp;
+                               <!--/TMPL_IF -->
+                       </td>
+                       <td>
+                               <!-- TMPL_IF Name="itemlocation"-->
+                                       <select name="location" size="1">
+                                               <option 
value="">Location</option>
+                                               <!-- TMPL_LOOP 
name="itemlocationloop" -->
+                                                       <option value="<!-- 
TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- 
/TMPL_IF -->><!-- TMPL_VAR name="itemlocationname" --></option>
+                                               <!-- /TMPL_LOOP -->
+                                       </select>
+                               <!-- TMPL_ELSE -->
+                               &nbsp;
+                               <!--/TMPL_IF -->
+                       </td>
+               </tr>
+               <!--/TMPL_IF-->
        <!-- /TMPL_UNLESS -->
        </table>
        <input type="submit" value="Save changes" accesskey="w" class="button 
bull">
Index: koha/updater/updatedatabase
diff -u koha/updater/updatedatabase:1.100.2.22 
koha/updater/updatedatabase:1.100.2.23
--- koha/updater/updatedatabase:1.100.2.22      Sun Feb  5 21:53:54 2006
+++ koha/updater/updatedatabase Tue Feb  7 15:33:35 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: updatedatabase,v 1.100.2.22 2006/02/05 21:53:54 kados Exp $
+# $Id: updatedatabase,v 1.100.2.23 2006/02/07 15:33:35 hdl Exp $
 
 # Database Updater
 # This script checks for required updates to the database.
@@ -1023,6 +1023,15 @@
             explanation         => 'Put any HTML Credits at the bottom of the 
OPAC page',
             type                => 'free',
         },
+       {
+            uniquefieldrequired => 'variable',
+            variable            => 'serialsadditems',
+            value               => '1',
+            forceupdate         => { 'explanation' => 1,                       
                                      '
+                                        type' => 1},
+            explanation         => 'If set, a new item will be automatically 
added when receiving an issue',
+            type                => 'YesNo',
+        },
     ],
 
 );
@@ -1650,6 +1659,14 @@
 exit;
 
 # $Log: updatedatabase,v $
+# Revision 1.100.2.23  2006/02/07 15:33:35  hdl
+# Adding a new system preference : serialsadditem
+#
+# Adding two functions in Biblio.pm : getitemlocation and getitemstatus 
(helpful to get location list and status list, status is supposed to be in 
relation with items.notforloan)
+#
+# Adding a new function in Bull.pm : serialsitemize which take serial id and 
item information and creates the item
+# Modifying statecollection to add a new line (used for data input)
+#
 # Revision 1.100.2.22  2006/02/05 21:53:54  kados
 # Adds database support for IntranetNav systempref -- used to add HTML
 # tags to left-hand navigation menu on Intranet.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]