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

SF.net SVN: ledger-smb:[3917] addons/1.3/budgetting/trunk



Revision: 3917
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3917&view=rev
Author:   einhverfr
Date:     2011-10-24 05:00:14 +0000 (Mon, 24 Oct 2011)
Log Message:
-----------
Notes now work for budgets, ready for 1.0 release for this addon

Modified Paths:
--------------
    addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm
    addons/1.3/budgetting/trunk/UI/budgetting/budget_entry.html
    addons/1.3/budgetting/trunk/scripts/budgets.pl
    addons/1.3/budgetting/trunk/sql/modules/Budgetting.sql
    addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql

Modified: addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm
===================================================================
--- addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm	2011-10-24 04:58:59 UTC (rev 3916)
+++ addons/1.3/budgetting/trunk/LedgerSMB/DBObject/Budget.pm	2011-10-24 05:00:14 UTC (rev 3917)
@@ -266,8 +266,8 @@
 sub save_note {
    my ($self, $subject, $note) = @_;
    my ($info) = $self->call_procedure(
-          {procname => 'budget__save_note', 
-           args => [$self->{id}, $subject, $note]}
+          procname => 'budget__save_note', 
+           args => [$self->{id}, $subject, $note]
    );
 }
 

Modified: addons/1.3/budgetting/trunk/UI/budgetting/budget_entry.html
===================================================================
--- addons/1.3/budgetting/trunk/UI/budgetting/budget_entry.html	2011-10-24 04:58:59 UTC (rev 3916)
+++ addons/1.3/budgetting/trunk/UI/budgetting/budget_entry.html	2011-10-24 05:00:14 UTC (rev 3917)
@@ -192,5 +192,56 @@
 
 <?lsmb FOREACH button IN buttons; PROCESS button element_data=button; END ?>
 </form>
+<?lsmb IF id ?>
+<form name="note" action="<?lsmb script ?>" method="POST">
+<?lsmb PROCESS input element_data = {
+       name = "id"
+      value = id
+       type = "hidden"
+} ?>
+<div class="inputrow">
+<div class="inputgroup">
+<?lsmb PROCESS input element_data = {
+        type = "text"
+        name = "subject"
+        size = "64"
+       label = text('Subject')
+}
+?>
+</div></div>
+<div class="inputrow">
+<div class="inputgroup">
+<?lsmb PROCESS textarea element_data = {
+        name = "note"
+        cols = '64'
+        rows = '5'
+       label = text('Content')
+}
+?>
+</div></div>
+<div class="inputrow">
+<div class="inputgroup">
+<?lsmb PROCESS button element_data = {
+        name = "action"
+       value = 'add_note'
+        type = "submit"
+       class = "submit"
+        text = text('Add Note') #'
+}
+?>
+</div></div>
+</form>
+<?lsmb END # IF id ?>
+<?lsmb FOREACH note IN notes ?>
+<div class="note">
+<div class="note_subject"><label><?lsmb text('Subject') ?>:</label>
+<?lsmb note.subject ?></div>
+<div class="note_entry_info"><label>&nbsp;:</label>
+<?lsmb note.created_by ?>:<?lsmb note.created ?>
+</div>
+<div class="note_content"><label><?lsmb text('Content') ?>:</label>
+<?lsmb note.note ?>
+</div>
+<?lsmb END # FOREACH Note ?>
 </body>
 </html>

Modified: addons/1.3/budgetting/trunk/scripts/budgets.pl
===================================================================
--- addons/1.3/budgetting/trunk/scripts/budgets.pl	2011-10-24 04:58:59 UTC (rev 3916)
+++ addons/1.3/budgetting/trunk/scripts/budgets.pl	2011-10-24 05:00:14 UTC (rev 3917)
@@ -321,6 +321,9 @@
 
 sub add_note {
     my ($request) = @_;
+    my $budget = LedgerSMB::DBObject::Budget->new({base => $request});
+    $budget->save_note($request->{subject}, $request->{note});
+    view_budget($request);
 } 
 
 =item begin_search

Modified: addons/1.3/budgetting/trunk/sql/modules/Budgetting.sql
===================================================================
--- addons/1.3/budgetting/trunk/sql/modules/Budgetting.sql	2011-10-24 04:58:59 UTC (rev 3916)
+++ addons/1.3/budgetting/trunk/sql/modules/Budgetting.sql	2011-10-24 05:00:14 UTC (rev 3917)
@@ -248,8 +248,8 @@
 (in_id int, in_subject text, in_note text)
 RETURNS budget_note AS
 $$
-INSERT INTO budget_note (note_class, subject, note, ref_key) 
-     values (5, $2, $3, $1);
+INSERT INTO budget_note (subject, note, ref_key) 
+     values ($2, $3, $1);
 
 SELECT * FROM budget_note WHERE id = currval('note_id_seq'::regclass);
 $$ language sql;

Modified: addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql
===================================================================
--- addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql	2011-10-24 04:58:59 UTC (rev 3916)
+++ addons/1.3/budgetting/trunk/sql/modules/budgetting-tables.sql	2011-10-24 05:00:14 UTC (rev 3917)
@@ -41,3 +41,4 @@
     check (note_class = 6),
     foreign key(ref_key) references budget_info(id)
 ) INHERITS (note);
+ALTER TABLE budget_note ALTER COLUMN note_class SET DEFAULT 6;

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