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

SF.net SVN: ledger-smb:[2618] trunk



Revision: 2618
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2618&view=rev
Author:   einhverfr
Date:     2009-06-04 00:24:23 +0000 (Thu, 04 Jun 2009)

Log Message:
-----------
pre-changes to tax form structure

Modified Paths:
--------------
    trunk/LedgerSMB/TaxForm.pm
    trunk/sql/modules/Roles.sql

Modified: trunk/LedgerSMB/TaxForm.pm
===================================================================
--- trunk/LedgerSMB/TaxForm.pm	2009-06-03 16:53:32 UTC (rev 2617)
+++ trunk/LedgerSMB/TaxForm.pm	2009-06-04 00:24:23 UTC (rev 2618)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 
-package LedgerSMB::TaxForm;
+package LedgerSMB::DBObject::TaxForm;
 
 use base qw(LedgerSMB::DBObject);
 
@@ -10,16 +10,10 @@
 {
   
     my ($self) = shift @_;
-
-    my $dbh=$self->{dbh};
-    
-    my $query="insert into country_tax_form(country_id,form_name) values(?,?);";
-
-    my $sth=$dbh->prepare($query) or die "prepare problem";
-    
-    $sth->execute($self->{country_code},$self->{taxform_name}) or die "execute problem";
+    my ($ref) = $self->execute_method(funcname => 'tax_form__save');
+    $self->{taxform_id} = $ref->{'tax_form__save'};
   
-    $dbh->commit();
+    $self->{dbh}->commit();
 
     
 }

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2009-06-03 16:53:32 UTC (rev 2617)
+++ trunk/sql/modules/Roles.sql	2009-06-04 00:24:23 UTC (rev 2618)
@@ -1231,9 +1231,15 @@
 IN ROLE "lsmb_<?lsmb dbname ?>__create_sic",
 "lsmb_<?lsmb dbname ?>__edit_sic";
 
+CREATE ROLE "lsmb_<?lsmb dbname ?>__save_tax_form"
+WITH INHERIT NOLOGIN;
+
+GRANT ALL ON country_tax_form TO "lsmb_<?lsmb dbname ?>__save_tax_form";
+
 CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_template"
 WITH INHERIT NOLOGIN;
 
+
 -- TODO Add db permissions as templates get moved into db.
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
@@ -1315,7 +1321,8 @@
 "lsmb_<?lsmb dbname ?>__all_department",
 "lsmb_<?lsmb dbname ?>__all_business_type",
 "lsmb_<?lsmb dbname ?>__all_sic",
-"lsmb_<?lsmb dbname ?>__edit_template";
+"lsmb_<?lsmb dbname ?>__edit_template",
+"lsmb_<?lsmb dbname ?>__save_tax_form";
 
 -- Manual Translation
 CREATE ROLE "lsmb_<?lsmb dbname ?>__create_language"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.