koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Labels.pm [dev_week]


From: Mason James
Subject: [Koha-cvs] koha/C4 Labels.pm [dev_week]
Date: Tue, 10 Jul 2007 05:24:56 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Mason James <sushi>     07/07/10 05:24:56

Modified files:
        C4             : Labels.pm 

Log message:
        adding get_active_layout() sub

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.23&r2=1.3.4.24

Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.23
retrieving revision 1.3.4.24
diff -u -b -r1.3.4.23 -r1.3.4.24
--- Labels.pm   10 Jul 2007 03:09:52 -0000      1.3.4.23
+++ Labels.pm   10 Jul 2007 05:24:56 -0000      1.3.4.24
@@ -61,7 +61,7 @@
   get_layout &save_layout
   &set_active_layout &by_order
   &build_text_dropbox
-  &delete_layout
+  &delete_layout &get_active_layout
 );
 
 =item get_label_options;
@@ -117,6 +117,23 @@
     return $data;
 }
 
+
+sub get_active_layout {
+    my ($layout_id) = @_;
+    my $dbh = C4::Context->dbh;
+    # get the actual items to be printed.
+    my $query = " Select * from labels_conf where active = 1";
+    my $sth   = $dbh->prepare($query);
+    $sth->execute();
+    my $data = $sth->fetchrow_hashref;
+    $sth->finish;
+    return $data;
+}
+
+
+
+
+
 sub delete_layout {
     my ($layout_id) = @_;
     my $dbh = C4::Context->dbh;
@@ -442,24 +459,6 @@
         $cols,        $rows,         $colgap,     $rowgap,
         $fontsize,    $units
     );
-
-    warn "ACTIVE = $active";
-
-    if ( $active eq '1' ) {
-
-  # get the tmpl_id of the newly created template, then call 
SetActiveTemplate()
-        my $query =
-          "SELECT tmpl_id from labels_templates order by tmpl_id desc limit 1";
-        my $sth = $dbh->prepare($query);
-        $sth->execute();
-
-        my $data    = $sth->fetchrow_hashref;
-        my $tmpl_id = $data->{'tmpl_id'};
-
-        SetActiveTemplate($tmpl_id);
-        $sth->finish;
-    }
-    return $tmpl_id;
 }
 
 sub GetAllLabelTemplates {




reply via email to

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