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

SF.net SVN: ledger-smb:[3313] trunk/sql



Revision: 3313
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3313&view=rev
Author:   einhverfr
Date:     2011-06-22 13:33:55 +0000 (Wed, 22 Jun 2011)

Log Message:
-----------
Adding listing tax forms and reports to menu

Modified Paths:
--------------
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Roles.sql

Added Paths:
-----------
    trunk/sql/upgrade/3313-list_taxform_menu.sql
    trunk/sql/upgrade/3313-role-updates.sql

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2011-06-22 12:05:07 UTC (rev 3312)
+++ trunk/sql/Pg-database.sql	2011-06-22 13:33:55 UTC (rev 3313)
@@ -1875,11 +1875,12 @@
 -- Name: menu_node_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ledgersmb
 --
 
-SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('menu_node', 'id'), 224, true);
+SELECT pg_catalog.setval('menu_node_id_seq', 226, true);
 
 --
 -- Data for Name: menu_node; Type: TABLE DATA; Schema: public; Owner: ledgersmb
 --
+
 COPY menu_node (id, label, parent, "position") FROM stdin;
 205	Transaction Approval	0	5
 206	Batches	205	1
@@ -2094,9 +2095,10 @@
 220	Add User	219	1
 221	Search Users	219	2
 222	Sessions	219	3
+225	List Tax Forms	217	2
+226	Reports	217	3
 \.
 
-
 --
 -- Name: menu_node_parent_key; Type: CONSTRAINT; Schema: public; Owner: ledgersmb; Tablespace: 
 --
@@ -2123,10 +2125,11 @@
 
 
 CREATE TABLE menu_attribute (
-    node_id integer NOT NULL,
+    node_id integer NOT NULL references menu_node(id),
     attribute character varying NOT NULL,
     value character varying NOT NULL,
-    id serial NOT NULL
+    id serial NOT NULL,
+    primary key(node_id, attribute)
 );
 
 
@@ -2134,13 +2137,14 @@
 -- Name: menu_attribute_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ledgersmb
 --
 
-SELECT pg_catalog.setval(pg_catalog.pg_get_serial_sequence('menu_attribute', 'id'), 612, true);
+SELECT pg_catalog.setval('menu_attribute_id_seq', 615, true);
 
 
 --
 -- Data for Name: menu_attribute; Type: TABLE DATA; Schema: public; Owner: postgres
 --
 
+
 COPY menu_attribute (node_id, attribute, value, id) FROM stdin;
 26	outstanding	1	584
 205	menu	1	574
@@ -2706,8 +2710,12 @@
 49	l_id	1	614
 49	l_startdate	1	615
 49	l_enddate	1	616
+225	module	taxform.pl	613
+225	action	list_all	614
+226	module	taxform.pl	615
 \.
 
+
 --
 
 CREATE TABLE menu_acl (

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-06-22 12:05:07 UTC (rev 3312)
+++ trunk/sql/modules/Roles.sql	2011-06-22 13:33:55 UTC (rev 3313)
@@ -1138,6 +1138,9 @@
 INSERT INTO menu_acl (node_id, acl_type, role_name)
 values (218, 'allow', 'lsmb_<?lsmb dbname ?>__tax_form_save');
 
+INSERT INTO menu_acl (node_id, acl_type, role_name)
+SELECT id, 'allow', 'lsmb_<?lsmb dbname ?>__tax_form_save'
+  FROM menu_node WHERE parent_id = 217 and position in (2,3);
 --
 
 -- SYSTEM SETTINGS	

Added: trunk/sql/upgrade/3313-list_taxform_menu.sql
===================================================================
--- trunk/sql/upgrade/3313-list_taxform_menu.sql	                        (rev 0)
+++ trunk/sql/upgrade/3313-list_taxform_menu.sql	2011-06-22 13:33:55 UTC (rev 3313)
@@ -0,0 +1,11 @@
+SELECT menu_insert(217, 2, 'List Tax Forms');
+INSERT INTO menu_attribute(node_id, attribute, value)
+    VALUES (currval('menu_node_id_seq')::int, 'module', 'taxform.pl');
+INSERT INTO menu_attribute(node_id, attribute, value)
+    VALUES (currval('menu_node_id_seq')::int, 'action', 'list_all');
+
+SELECT menu_insert(217, 3, 'Reports');
+INSERT INTO menu_attribute(node_id, attribute, value)
+    VALUES (currval('menu_node_id_seq')::int, 'module', 'taxform.pl');
+
+

Added: trunk/sql/upgrade/3313-role-updates.sql
===================================================================
--- trunk/sql/upgrade/3313-role-updates.sql	                        (rev 0)
+++ trunk/sql/upgrade/3313-role-updates.sql	2011-06-22 13:33:55 UTC (rev 3313)
@@ -0,0 +1,4 @@
+
+INSERT INTO menu_acl (node_id, acl_type, role_name)
+SELECT id, 'allow', 'lsmb_<?lsmb dbname ?>__tax_form_save'
+  FROM menu_node WHERE parent_id = 217 and position in (2,3);


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