koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha acqui/neworderempty.pl acqui/orderreceive.... [rel_3_0]


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha acqui/neworderempty.pl acqui/orderreceive.... [rel_3_0]
Date: Thu, 11 Jan 2007 15:30:53 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Henri-Damien LAURENT <hdl>      07/01/11 15:30:52

Modified files:
        acqui          : neworderempty.pl orderreceive.pl 
        C4             : Auth.pm Branch.pm Serials.pm 
        koha-tmpl/intranet-tmpl/prog/en/includes: menu-serials.inc 
        koha-tmpl/intranet-tmpl/prog/en/serials: serials-collection.tmpl 
                                                 serials-home.tmpl 
                                                 subscription-add.tmpl 
                                                 subscription-detail.tmpl 
        serials        : subscription-add.pl subscription-detail.pl 

Log message:
        Modifying GetBranches.
        It accepts a boolean parameter that changes the behavoir to select ONLY 
the branch of the user
        Using this facility in Acquisition module to manage Independant 
Branches.
        Modifying Serials to display branchcode in subscription
        + Modifying subscription add and detail in order to have the same 
behavoir as anywhere else in Koha : i.e. :
        Modifying a subscription is recorded in subscription add.pl AND THEN 
redirects to subscription-detail.pl
        Modifying some menus to get more homogenuous menus ( Capital Letters to 
each words in Menu.)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/neworderempty.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.7&r2=1.1.2.8
http://cvs.savannah.gnu.org/viewcvs/koha/acqui/orderreceive.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.3&r2=1.2.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Auth.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.54.2.22&r2=1.54.2.23
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Branch.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.21&r2=1.5.2.22
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menu-serials.inc?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.5&r2=1.3.2.6
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/serials-collection.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.6&r2=1.1.2.7
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5.2.4&r2=1.5.2.5
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.7&r2=1.3.2.8
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.9&r2=1.3.2.10
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-add.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.10&r2=1.6.2.11
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-detail.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.8&r2=1.3.2.9

Patches:
Index: acqui/neworderempty.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui/neworderempty.pl,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -b -r1.1.2.7 -r1.1.2.8
--- acqui/neworderempty.pl      9 Jan 2007 09:43:27 -0000       1.1.2.7
+++ acqui/neworderempty.pl      11 Jan 2007 15:30:52 -0000      1.1.2.8
@@ -174,7 +174,11 @@
 );
 
 # build branches list
-my $branches = GetBranches;
+my $onlymine=C4::Context->preference('IndependantBranches') && 
+             C4::Context->userenv && 
+             C4::Context->userenv->{flags}!=1 && 
+             C4::Context->userenv->{branch};
+my $branches = GetBranches($onlymine);
 my @branchloop;
 foreach my $thisbranch ( sort keys %$branches ) {
      my %row = (

Index: acqui/orderreceive.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui/Attic/orderreceive.pl,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -b -r1.2.2.3 -r1.2.2.4
--- acqui/orderreceive.pl       9 Jan 2007 08:30:38 -0000       1.2.2.3
+++ acqui/orderreceive.pl       11 Jan 2007 15:30:52 -0000      1.2.2.4
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: orderreceive.pl,v 1.2.2.3 2007/01/09 08:30:38 toins Exp $
+# $Id: orderreceive.pl,v 1.2.2.4 2007/01/11 15:30:52 hdl Exp $
 
 #script to recieve orders
 #written by address@hidden 24/2/2000
@@ -130,7 +130,11 @@
         );
         $template->param( CGIlocation => $CGIlocation );
     }
-    my $branches = GetBranches;
+    my $onlymine=C4::Context->preference('IndependantBranches') && 
+                C4::Context->userenv && 
+                C4::Context->userenv->{flags} !=1  && 
+                C4::Context->userenv->{branch};
+    my $branches = GetBranches($onlymine);
     my @branchloop;
     foreach my $thisbranch ( sort keys %$branches ) {
         my %row = (

Index: C4/Auth.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Auth.pm,v
retrieving revision 1.54.2.22
retrieving revision 1.54.2.23
diff -u -b -r1.54.2.22 -r1.54.2.23
--- C4/Auth.pm  11 Jan 2007 14:35:39 -0000      1.54.2.22
+++ C4/Auth.pm  11 Jan 2007 15:30:52 -0000      1.54.2.23
@@ -37,7 +37,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.54.2.22 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.54.2.23 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -138,7 +138,7 @@
         # We are going to use the $flags returned by checkauth
         # to create the template's parameters that will indicate
         # which menus the user can access.
-        if (( $flags && $flags->{superlibrarian} == 1) or $insecure == 1) {
+        if (( $flags && $flags->{superlibrarian}==1) or $insecure==1) {
             $template->param( CAN_user_circulate        => 1 );
             $template->param( CAN_user_catalogue        => 1 );
             $template->param( CAN_user_parameters       => 1 );
@@ -700,16 +700,16 @@
             return 1, $userid;
         }
     }
-    if (   $userid eq C4::Context->config('user')
-        && $password eq C4::Context->config('pass') )
+    if (   $userid && $userid eq C4::Context->config('user')
+        && "$password" eq C4::Context->config('pass') )
     {
 
 # Koha superuser account
 #              
C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1);
         return 2;
     }
-    if (   $userid eq 'demo'
-        && $password eq 'demo'
+    if (   $userid && $userid eq 'demo'
+        && "$password" eq 'demo'
         && C4::Context->config('demo') )
     {
 

Index: C4/Branch.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Attic/Branch.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- C4/Branch.pm        4 Jan 2007 13:57:46 -0000       1.1.2.2
+++ C4/Branch.pm        11 Jan 2007 15:30:52 -0000      1.1.2.3
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Branch.pm,v 1.1.2.2 2007/01/04 13:57:46 btoumi Exp $
+# $Id: Branch.pm,v 1.1.2.3 2007/01/11 15:30:52 hdl Exp $
 
 use strict;
 require Exporter;
@@ -25,7 +25,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.1.2.2 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.1.2.3 $' =~ /\d+/g; shift(@v).".".join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -91,11 +91,17 @@
 
 sub GetBranches {
 
+    my address@hidden;
     # returns a reference to a hash of references to ALL branches...
     my %branches;
     my $dbh = C4::Context->dbh;
     my $sth;
-    $sth = $dbh->prepare("Select * from branches order by branchname");
+    my $query="SELECT * from branches";
+    if ($onlymine && C4::Context->userenv && C4::Context->userenv->{branch}){
+      $query .= " WHERE branchcode 
=".$dbh->quote(C4::Context->userenv->{branch});
+    }
+    $query.=" order by branchname";
+    $sth = $dbh->prepare($query);
     $sth->execute;
     while ( my $branch = $sth->fetchrow_hashref ) {
         my $nsth =

Index: C4/Serials.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Serials.pm,v
retrieving revision 1.5.2.21
retrieving revision 1.5.2.22
diff -u -b -r1.5.2.21 -r1.5.2.22
--- C4/Serials.pm       10 Jan 2007 16:46:28 -0000      1.5.2.21
+++ C4/Serials.pm       11 Jan 2007 15:30:52 -0000      1.5.2.22
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Serials.pm,v 1.5.2.21 2007/01/10 16:46:28 toins Exp $
+# $Id: Serials.pm,v 1.5.2.22 2007/01/11 15:30:52 hdl Exp $
 
 use strict;
 use C4::Date;
@@ -35,7 +35,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.5.2.21 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.5.2.22 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -363,6 +363,11 @@
        LEFT JOIN biblio ON biblio.biblionumber=subscription.biblionumber
        WHERE subscription.subscriptionid = ?
     );
+    if (C4::Context->preference('IndependantBranches') && 
+        C4::Context->userenv && 
+        C4::Context->userenv->{'flags'} != 1){
+      $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."',\"''\")";
+    }
     my $sth = $dbh->prepare($query);
     $sth->execute($subscriptionid);
     my $subs = $sth->fetchrow_hashref;
@@ -398,6 +403,11 @@
        LEFT JOIN branches ON branches.branchcode=subscription.branchcode
        WHERE subscription.biblionumber = ?
     );
+    if (C4::Context->preference('IndependantBranches') && 
+        C4::Context->userenv && 
+        C4::Context->userenv->{'flags'} != 1){
+      $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."','')";
+    }
     my $sth = $dbh->prepare($query);
     $sth->execute($biblionumber);
     my @res;
@@ -529,51 +539,73 @@
     my $sth;
     if ($biblionumber) {
         my $query = qq(
-            SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber
+            SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,subscription.branchcode,biblio.biblionumber
             FROM   subscription,biblio,biblioitems
             WHERE   biblio.biblionumber = biblioitems.biblionumber
                 AND biblio.biblionumber = subscription.biblionumber
                 AND biblio.biblionumber=?
-            ORDER BY title
         );
+        if (C4::Context->preference('IndependantBranches') && 
+            C4::Context->userenv && 
+            C4::Context->userenv->{'flags'} != 1){
+          $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."',\"''\")";
+        }
+        $query.=" ORDER BY title";
+        warn "query :$query";
         $sth = $dbh->prepare($query);
         $sth->execute($biblionumber);
     }
     else {
         if ( $ISSN and $title ) {
             my $query = qq|
-                SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber
+                SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,subscription.branchcode,biblio.biblionumber
                 FROM   subscription,biblio,biblioitems
                 WHERE  biblio.biblionumber = biblioitems.biblionumber
                     AND biblio.biblionumber= subscription.biblionumber
                     AND (biblio.title LIKE ? or biblioitems.issn = ?)
-                ORDER BY title
             |;
+            if (C4::Context->preference('IndependantBranches') && 
+                C4::Context->userenv && 
+                C4::Context->userenv->{'flags'} != 1){
+              $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."',\"''\")";
+            }
+            $query.=" ORDER BY title";
             $sth = $dbh->prepare($query);
             $sth->execute( "%$title%", $ISSN );
         }
         else {
             if ($ISSN) {
                 my $query = qq(
-                    SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber
+                    SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,subscription.branchcode,biblio.biblionumber
                     FROM   subscription,biblio,biblioitems
                     WHERE  biblio.biblionumber = biblioitems.biblionumber
                         AND biblio.biblionumber=subscription.biblionumber
                         AND biblioitems.issn LIKE ?
-                    ORDER BY title
                 );
+                if (C4::Context->preference('IndependantBranches') && 
+                    C4::Context->userenv && 
+                    C4::Context->userenv->{'flags'} != 1){
+                  $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."',\"''\")";
+                }
+                $query.=" ORDER BY title";
+        warn "query :$query";
                 $sth = $dbh->prepare($query);
                 $sth->execute( "%" . $ISSN . "%" );
             }
             else {
                 my $query = qq(
-                    SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,biblio.biblionumber
+                    SELECT 
subscription.subscriptionid,biblio.title,biblioitems.issn,subscription.notes,subscription.branchcode,biblio.biblionumber
                     FROM   subscription,biblio,biblioitems
                     WHERE  biblio.biblionumber = biblioitems.biblionumber
                         AND biblio.biblionumber=subscription.biblionumber
                         AND biblio.title LIKE ?
-                    ORDER BY title
                 );
+                if (C4::Context->preference('IndependantBranches') && 
+                    C4::Context->userenv && 
+                    C4::Context->userenv->{'flags'} != 1){
+                  $query.=" AND subscription.branchcode IN 
('".C4::Context->userenv->{'branch'}."',\"''\")";
+                }
+                $query.=" ORDER BY title";
                 $sth = $dbh->prepare($query);
                 $sth->execute( "%" . $title . "%" );
             }
@@ -1130,6 +1162,7 @@
                         
add3=?,every3=?,whenmorethan3=?,setto3=?,lastvalue3=?,innerloop3=?,
                         numberingmethod=?, status=?, biblionumber=?, 
callnumber=?, notes=?, letter=?, hemisphere=?,manualhistory=?
                     WHERE subscriptionid = ?";
+    warn "query :".$query;
     my $sth = $dbh->prepare($query);
     $sth->execute(
         $auser,           $branchcode,   $aqbooksellerid, $cost,
@@ -1141,13 +1174,15 @@
         $lastvalue2,      $innerloop2,   $add3,           $every3,
         $whenmorethan3,   $setto3,       $lastvalue3,     $innerloop3,
         $numberingmethod, $status,       $biblionumber,   $callnumber,
-        $notes,           $letter,       $hemisphere,     $manualhistory,
+        $notes,           $letter,       $hemisphere,     
($manualhistory?$manualhistory:0),
         $subscriptionid
     );
+    my $rows=$sth->rows;
     $sth->finish;
     
     
&logaction(C4::Context->userenv->{'number'},"SUBSCRIPTION","MODIFY",$subscriptionid,"")
 
         if C4::Context->preference("SubscriptionLog");
+    return $rows;
 }
 
 =head2 NewSubscription

Index: koha-tmpl/intranet-tmpl/prog/en/includes/menu-serials.inc
===================================================================
RCS file: 
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menu-serials.inc,v
retrieving revision 1.3.2.5
retrieving revision 1.3.2.6
diff -u -b -r1.3.2.5 -r1.3.2.6
--- koha-tmpl/intranet-tmpl/prog/en/includes/menu-serials.inc   18 Dec 2006 
17:44:06 -0000      1.3.2.5
+++ koha-tmpl/intranet-tmpl/prog/en/includes/menu-serials.inc   11 Jan 2007 
15:30:52 -0000      1.3.2.6
@@ -1,9 +1,9 @@
 <div id="submenu">
-        <a href="/cgi-bin/koha/serials/serials-home.pl">home</a>
-        <a href="/cgi-bin/koha/serials/lateissues.pl">Late issue</a>
+        <a href="/cgi-bin/koha/serials/serials-home.pl">Home</a>
+        <a href="/cgi-bin/koha/serials/lateissues.pl">Late Issue</a>
         <a href="/cgi-bin/koha/serials/claims.pl">Claims</a>
-        <a href="/cgi-bin/koha/serials/subscription-add.pl">Add a 
subscription</a>
-        <a href="/cgi-bin/koha/serials/checkexpiration.pl">check expiration</a>
+        <a href="/cgi-bin/koha/serials/subscription-add.pl">Add 
Subscription</a>
+        <a href="/cgi-bin/koha/serials/checkexpiration.pl">Check Expiration</a>
 </div>
 
 <div id="main">

Index: koha-tmpl/intranet-tmpl/prog/en/serials/serials-collection.tmpl
===================================================================
RCS file: 
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/Attic/serials-collection.tmpl,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -b -r1.1.2.6 -r1.1.2.7
--- koha-tmpl/intranet-tmpl/prog/en/serials/serials-collection.tmpl     22 Dec 
2006 14:40:17 -0000      1.1.2.6
+++ koha-tmpl/intranet-tmpl/prog/en/serials/serials-collection.tmpl     11 Jan 
2007 15:30:52 -0000      1.1.2.7
@@ -37,20 +37,14 @@
 
 <!-- TMPL_UNLESS name="popup" -->
 
-       <h2>Subscription information for <em><!-- TMPL_VAR name="bibliotitle" 
--></em></h2>
+       <h1>Serial Collection information for<br/> <em><!-- TMPL_VAR 
name="bibliotitle" --></em></h1>
 <!-- /TMPL_UNLESS -->
 
-View Subscription information :
+<div id="action">
 <!--TMPL_LOOP Name="subscriptions"-->
-       <a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">#<!-- TMPL_VAR name="subscriptionid" --></a> 
+       <a href="subscription-detail.pl?subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">Subscription #<!-- TMPL_VAR name="subscriptionid" 
--></a> 
 <!--/TMPL_LOOP -->
-       
-Show branch :
- <a href="#" onclick="show(''); return false;">ALL</a>
-<!--TMPL_LOOP Name="subscriptions"-->
-    <a href="#" onclick="show(<!--TMPL_VAR Name="branchcode"-->); return 
false;" id="<!--TMPL_VAR Name="branchcode"-->"><!--TMPL_VAR 
Name="branchname"--></a>
-<!--/TMPL_LOOP -->
-       
+</div>
     <div class="tabsubs">
     <!-- TMPL_LOOP NAME="years" -->
         <!-- TMPL_IF NAME="year" -->

Index: koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl
===================================================================
RCS file: 
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -u -b -r1.5.2.4 -r1.5.2.5
--- koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl   21 Dec 2006 
14:59:48 -0000      1.5.2.4
+++ koha-tmpl/intranet-tmpl/prog/en/serials/serials-home.tmpl   11 Jan 2007 
15:30:52 -0000      1.5.2.5
@@ -17,6 +17,9 @@
             <th>
                 Note
             </th>
+            <th>
+                Branch
+            </th>
             <!-- TMPL_IF NAME="routing" -->
               <th colspan=3>&nbsp;</th>
             <!-- TMPL_ELSE -->
@@ -35,10 +38,10 @@
             <td>
                 <input type="text" size=40 maxlength=40 name="title_filter" 
value="<!-- TMPL_VAR name="title_filter" -->" title="type a title -complete or 
partial- to filter subscription" />
             </td>
-            <td>
+            <td colspan="2">
                 &nbsp;
             </td>
-            <td colspan=2>
+            <td colspan="2">
                 <input type="submit" value="filter" class="button serial" 
title="set a filter on ISSN / title">
             </td>
         </tr>
@@ -72,6 +75,13 @@
                 <!-- /TMPL_IF -->
                 <!-- TMPL_IF name="notes" -->(<!-- TMPL_VAR name="notes" 
-->)<!-- /TMPL_IF -->
                 </td>
+                <!-- TMPL_IF name="toggle" -->
+                    <td class="hilighted">
+                <!-- TMPL_ELSE -->
+                    <td>
+                <!-- /TMPL_IF -->
+                <!-- TMPL_IF name="branchcode" --><!-- TMPL_VAR 
name="branchcode" --><!-- /TMPL_IF -->
+                </td>
                 <!-- TMPL_IF NAME="routing" -->
                     <!-- TMPL_IF name="toggle" -->
                         <td class="hilighted">

Index: koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl
===================================================================
RCS file: 
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl,v
retrieving revision 1.3.2.7
retrieving revision 1.3.2.8
diff -u -b -r1.3.2.7 -r1.3.2.8
--- koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl       21 Dec 
2006 16:25:03 -0000      1.3.2.7
+++ koha-tmpl/intranet-tmpl/prog/en/serials/subscription-add.tmpl       11 Jan 
2007 15:30:52 -0000      1.3.2.8
@@ -634,7 +634,7 @@
 
 <!-- TMPL_IF name="mod" -->
     <h1>Modify a subscription</h1>
-    <form method="post" name="f" action="subscription-detail.pl">
+    <form method="post" name="f">
         <input type="hidden" name="op" value="modsubscription">
         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR 
name="subscriptionid" -->">
 <!-- TMPL_ELSE -->
@@ -697,10 +697,6 @@
             </td>
         </tr>
         <tr>
-            <td><label>Notes</label></td>
-            <td><textarea name="notes" cols="30" rows="2"><!-- TMPL_VAR 
name="notes" --></textarea></td>
-        </tr>
-        <tr>
             <td><b>Warning:</b></td>
             <td>
                 <ul>

Index: koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl
===================================================================
RCS file: 
/cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl,v
retrieving revision 1.3.2.9
retrieving revision 1.3.2.10
diff -u -b -r1.3.2.9 -r1.3.2.10
--- koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl    27 Nov 
2006 13:07:32 -0000      1.3.2.9
+++ koha-tmpl/intranet-tmpl/prog/en/serials/subscription-detail.tmpl    11 Jan 
2007 15:30:52 -0000      1.3.2.10
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Subscription edit<!--
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha_--_Subscription 
detail_#<!-- TMPL_VAR name="subscriptionid" --><!--
 TMPL_INCLUDE NAME="doc-head-close.inc" -->
 
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
@@ -137,16 +137,14 @@
     <h1>Subscription</h1>
     <div id="action">
         <a href="subscription-add.pl?op=mod&amp;subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">Edit</a>
-        <a href="subscription-add.pl?op=dup&amp;subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">Duplicate Subscription</a>
+        <a href="subscription-add.pl?op=dup&amp;subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">Duplicate </a>
         <a href="serials-edit.pl?subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->&amp;serstatus=1">Receive</a>
-        <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- 
TMPL_VAR name="biblionumber" -->">Biblio</a>
-        <a href="/cgi-bin/koha/serials/serials-collection.pl?biblionumber=<!-- 
TMPL_VAR name="biblionumber" -->">Serial issues</a>
+        <a href="/cgi-bin/koha/serials/serials-collection.pl?biblionumber=<!-- 
TMPL_VAR name="biblionumber" -->">Serial Collection</a>
         <!-- TMPL_IF NAME="routing" -->
         <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=<!-- TMPL_VAR 
NAME="subscriptionid" -->">Edit Routing List</a>
         <!-- TMPL_ELSE -->
         <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=<!-- TMPL_VAR 
NAME="subscriptionid" -->&op=new">Create Routing List</a>
         <!-- /TMPL_IF -->
-        <a href="subscription-copy.pl?subscriptionid=<!-- TMPL_VAR 
name="subscriptionid" -->">Copy</a>
         <!-- TMPL_UNLESS name="totalissues" -->
             <a href="javascript:confirm_deletion()">
                 delete

Index: serials/subscription-add.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/subscription-add.pl,v
retrieving revision 1.6.2.10
retrieving revision 1.6.2.11
diff -u -b -r1.6.2.10 -r1.6.2.11
--- serials/subscription-add.pl 14 Dec 2006 15:41:55 -0000      1.6.2.10
+++ serials/subscription-add.pl 11 Jan 2007 15:30:52 -0000      1.6.2.11
@@ -74,6 +74,35 @@
             'issues', 'weeks', 'months'
         ); 
 my @sub_type_data;
+
+my $letters = GetLetters('serial');
+my @letterloop;
+foreach my $thisletter (keys %$letters) {
+    my $selected = 1 if $thisletter eq $letter;
+    my %row =(value => $thisletter,
+                selected => $selected,
+                lettername => $letters->{$thisletter},
+            );
+    push @letterloop, \%row;
+}
+$template->param(letterloop => address@hidden);
+
+my $onlymine=C4::Context->preference('IndependantBranches') && 
+             C4::Context->userenv && 
+             C4::Context->userenv->{flags}!=1 && 
+             C4::Context->userenv->{branch};
+my $branches = GetBranches($onlymine);
+my @branchloop;
+foreach my $thisbranch (keys %$branches) {
+    my $selected = 1 if $thisbranch eq C4::Context->userenv->{'branch'};
+    my %row =(value => $thisbranch,
+                selected => $selected,
+                branchname => $branches->{$thisbranch}->{'branchname'},
+            );
+    push @branchloop, \%row;
+}
+$template->param(branchloop => address@hidden);
+
 if ($op eq 'mod'||$op eq 'dup') {
     my $subscriptionid = $query->param('subscriptionid');
 #     warn "irregularity :$irregularity numberpattern : $numberpattern, 
callnumber :$callnumber, firstacquidate :$firstacquidate";
@@ -119,30 +148,6 @@
                 );
 }
 
-my $letters = GetLetters('serial');
-my @letterloop;
-foreach my $thisletter (keys %$letters) {
-    my $selected = 1 if $thisletter eq $letter;
-    my %row =(value => $thisletter,
-                selected => $selected,
-                lettername => $letters->{$thisletter},
-            );
-    push @letterloop, \%row;
-}
-$template->param(letterloop => address@hidden);
-
-my $branches = GetBranches();
-my @branchloop;
-foreach my $thisbranch (keys %$branches) {
-    my $selected = 1 if $thisbranch eq C4::Context->userenv->{'branch'};
-    my %row =(value => $thisbranch,
-                selected => $selected,
-                branchname => $branches->{$thisbranch}->{'branchname'},
-            );
-    push @branchloop, \%row;
-}
-$template->param(branchloop => address@hidden);
-
 if ($op eq 'addsubscription') {
     my @irregular = $query->param('irregular');
     my $irregular_count = @irregular;
@@ -210,6 +215,83 @@
                                );
 
     print 
$query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
+} elsif ($op eq 'modsubscription') {
+    my $subscriptionid = $query->param('subscriptionid');
+    my @irregular = $query->param('irregular');
+    my $irregular_count = @irregular;
+    for(my $i =0;$i<$irregular_count;$i++){
+    $irregularity .=$irregular[$i]."|";
+    }
+    $irregularity =~ s/\|$//;
+
+    my $auser = $query->param('user');
+    my $librarian => $query->param('librarian'),
+    my $branchcode = $query->param('branchcode');
+    my $cost = $query->param('cost');
+    my $aqbooksellerid = $query->param('aqbooksellerid');
+    my $biblionumber = $query->param('biblionumber');
+    my $aqbudgetid = $query->param('aqbudgetid');
+    my $startdate = format_date_in_iso($query->param('startdate'));
+    my $firstacquidate = format_date_in_iso($query->param('firstacquidate'));  
  
+    my $periodicity = $query->param('periodicity');
+    my $dow = $query->param('dow');
+    my $sublength = $query->param('sublength');
+    my $subtype = $query->param('subtype');
+
+    if($subtype eq 'months'){
+        $monthlength = $sublength;
+    } elsif ($subtype eq 'weeks'){
+        $weeklength = $sublength;
+    } else {
+        $numberlength = $sublength;
+    }
+    my $numberpattern = $query->param('numbering_pattern');
+    my $add1 = $query->param('add1');
+    my $every1 = $query->param('every1');
+    my $whenmorethan1 = $query->param('whenmorethan1');
+    my $setto1 = $query->param('setto1');
+    my $lastvalue1 = $query->param('lastvalue1');
+    my $innerloop1 = $query->param('innerloop1');
+    my $add2 = $query->param('add2');
+    my $every2 = $query->param('every2');
+    my $whenmorethan2 = $query->param('whenmorethan2');
+    my $setto2 = $query->param('setto2');
+    my $lastvalue2 = $query->param('lastvalue2');
+    my $innerloop2 = $query->param('innerloop2');
+    my $add3 = $query->param('add3');
+    my $every3 = $query->param('every3');
+    my $whenmorethan3 = $query->param('whenmorethan3');
+    my $setto3 = $query->param('setto3');
+    my $lastvalue3 = $query->param('lastvalue3');
+    my $innerloop3 = $query->param('innerloop3');
+    my $numberingmethod = $query->param('numberingmethod');
+    my $status = 1;
+    my $callnumber = $query->param('callnumber');
+    my $notes = $query->param('notes');
+    my $hemisphere = $query->param('hemisphere');
+    my $letter = $query->param('letter');
+    my $manualhistory = $query->param('manualhist');
+    my $enddate = $query->param('enddate');
+    my $histstartdate = format_date_in_iso($query->param('histstartdate'));
+    my $recievedlist = $query->param('recievedlist');
+    my $missinglist = $query->param('missinglist');
+    my $opacnote = $query->param('opacnote');
+    my $librariannote = $query->param('librariannote');
+    &ModSubscription(
+        $auser,           $branchcode,   $aqbooksellerid, $cost,
+        $aqbudgetid,      $startdate,    $periodicity,    $firstacquidate,
+        $dow,             $irregularity, $numberpattern,  $numberlength,
+        $weeklength,      $monthlength,  $add1,           $every1,
+        $whenmorethan1,   $setto1,       $lastvalue1,     $innerloop1,
+        $add2,            $every2,       $whenmorethan2,  $setto2,
+        $lastvalue2,      $innerloop2,   $add3,           $every3,
+        $whenmorethan3,   $setto3,       $lastvalue3,     $innerloop3,
+        $numberingmethod, $status,       $biblionumber,   $callnumber,
+        $notes,           $letter,       $hemisphere,     $manualhistory,
+        $subscriptionid);
+
+    ModSubscriptionHistory 
($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
+    print 
$query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
 } else {
 
         while (@subscription_types) {

Index: serials/subscription-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/serials/subscription-detail.pl,v
retrieving revision 1.3.2.8
retrieving revision 1.3.2.9
diff -u -b -r1.3.2.8 -r1.3.2.9
--- serials/subscription-detail.pl      18 Dec 2006 17:44:07 -0000      1.3.2.8
+++ serials/subscription-detail.pl      11 Jan 2007 15:30:52 -0000      1.3.2.9
@@ -41,76 +41,6 @@
 
 $subscriptionid = $query->param('subscriptionid');
 
-if ($op eq 'modsubscription') {
-    my @irregular = $query->param('irregular');
-    my $irregular_count = @irregular;
-    for(my $i =0;$i<$irregular_count;$i++){
-    $irregularity .=$irregular[$i]."|";
-    }
-    $irregularity =~ s/\|$//;
-
-    $auser = $query->param('user');
-    $librarian => $query->param('librarian'),
-    $cost = $query->param('cost');
-    $aqbooksellerid = $query->param('aqbooksellerid');
-    $biblionumber = $query->param('biblionumber');
-    $aqbudgetid = $query->param('aqbudgetid');
-    $startdate = format_date_in_iso($query->param('startdate'));
-    $firstacquidate = format_date_in_iso($query->param('firstacquidate'));    
-    $periodicity = $query->param('periodicity');
-    $dow = $query->param('dow');
-    $sublength = $query->param('sublength');
-    $subtype = $query->param('subtype');
-
-    if($subtype eq 'months'){
-        $monthlength = $sublength;
-    } elsif ($subtype eq 'weeks'){
-        $weeklength = $sublength;
-    } else {
-        $numberlength = $sublength;
-    }
-    $numberpattern = $query->param('numbering_pattern');
-    $add1 = $query->param('add1');
-    $every1 = $query->param('every1');
-    $whenmorethan1 = $query->param('whenmorethan1');
-    $setto1 = $query->param('setto1');
-    $lastvalue1 = $query->param('lastvalue1');
-    $innerloop1 = $query->param('innerloop1');
-    $add2 = $query->param('add2');
-    $every2 = $query->param('every2');
-    $whenmorethan2 = $query->param('whenmorethan2');
-    $setto2 = $query->param('setto2');
-    $lastvalue2 = $query->param('lastvalue2');
-    $innerloop2 = $query->param('innerloop2');
-    $add3 = $query->param('add3');
-    $every3 = $query->param('every3');
-    $whenmorethan3 = $query->param('whenmorethan3');
-    $setto3 = $query->param('setto3');
-    $lastvalue3 = $query->param('lastvalue3');
-    $innerloop3 = $query->param('innerloop3');
-    $numberingmethod = $query->param('numberingmethod');
-    $status = 1;
-    $callnumber = $query->param('callnumber');
-    $notes = $query->param('notes');
-    $hemisphere = $query->param('hemisphere');
-    $letter = $query->param('letter');
-    $manualhistory = $query->param('manualhist');
-    $enddate = $query->param('enddate');
-    $histstartdate = format_date_in_iso($query->param('histstartdate'));
-    $recievedlist = $query->param('recievedlist');
-    $missinglist = $query->param('missinglist');
-    $opacnote = $query->param('opacnote');
-    $librariannote = $query->param('librariannote');
-    
-    &ModSubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
-                    
$periodicity,$firstacquidate,$dow,$irregularity,$numberpattern,$numberlength,$weeklength,$monthlength,
-                    
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
-                    
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
-                    
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
-                    $numberingmethod, $status, $biblionumber, $callnumber, 
$notes, $letter, $hemisphere,$manualhistory,$subscriptionid);
-    ModSubscriptionHistory 
($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
-
-}
 
 if ($op eq 'del') {
     &DelSubscription($subscriptionid);
@@ -214,9 +144,9 @@
     hemisphere => $hemisphere,
     );
 $template->param(
-            "periodicity$subs->{periodicity}" => 1,
-            "arrival$subs->{dow}" => 1,
-                        "numberpattern$subs->{numberpattern}" => 1,
+            "periodicity".$subs->{periodicity} => 1,
+            "arrival".$subs->{dow} => 1,
+            "numberpattern".$subs->{numberpattern} => 1,
             intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
             intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"), 
             );




reply via email to

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