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

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



Revision: 3471
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3471&view=rev
Author:   einhverfr
Date:     2011-07-09 07:40:29 +0000 (Sat, 09 Jul 2011)

Log Message:
-----------
Account screen complete

Modified Paths:
--------------
    trunk/UI/accounts/edit.html
    trunk/scripts/account.pl

Added Paths:
-----------
    trunk/UI/accounts/edit.js

Modified: trunk/UI/accounts/edit.html
===================================================================
--- trunk/UI/accounts/edit.html	2011-07-09 06:35:07 UTC (rev 3470)
+++ trunk/UI/accounts/edit.html	2011-07-09 07:40:29 UTC (rev 3471)
@@ -1,12 +1,27 @@
 <?lsmb 
 INCLUDE 'ui-header.html' 
-    include_stylesheet =  [stylesheet, 'UI/accounts/edit.css']
-    include_script = ['UI/account/edit.js']
+    include_stylesheet =  ['UI/accounts/edit.css']
+    include_script = ['UI/accounts/edit.js']
 ?> 
 <?lsmb PROCESS elements.html ?> 
 <body onload="init()">
 <form method="post" action="<?lsmb form.script ?>">
 <div class="listtop"><?lsmb form.title ?></div>
+<div class="inputline" id="charttype-line">
+   <label class="line">&nbsp;</label>
+   <div class="inputgroup">
+    <?lsmb 
+     ctypes = [
+                { text = 'Account', value = 'A'}
+                { text = 'Heading', value = 'H'}
+              ];
+    INCLUDE select element_data = {
+                  name = 'charttype'
+               options = ctypes
+        default_values = [form.charttype]
+    };?>
+  </div>
+</div>
 <div class="inputline" id="accno-line">
   <label class="line"><?lsmb text('Account Number') ?></label>
   <div class="inputgroup">
@@ -51,7 +66,8 @@
     }; ?>
    </div>
 </div>
-<div class="inputline" id="charttype-line">
+<div id="accdetails">
+<div class="inputline" id="gifi-line">
    <label class="line"><?lsmb text('GIFI') ?></label>
    <div class="inputgroup">
        <?lsmb INCLUDE input element_data={
@@ -60,21 +76,6 @@
            value = form.gifi_accno} ?>
    </div>
 </div>
-<div class="inputline" id="charttype-line">
-   <label class="line">&nbsp;</label>
-   <div class="inputgroup">
-    <?lsmb 
-     ctypes = [
-                { text = 'Account', value = 'A'}
-                { text = 'Heading', value = 'H'}
-              ];
-    INCLUDE select element_data = {
-                  name = 'charttype'
-               options = ctypes
-        default_values = [form.charttype]
-    };?>
-  </div>
-</div>
 <div class="inputline" id="acctype-line">
    <label class="line"><?lsmb text('Account Type') ?></label>
    <div class="inputgroup">
@@ -154,6 +155,8 @@
       }; ?>    
    </div>
 </div>
+</div> <!-- account details div -->
+<div id="dropdowns">
 <div class="subsectionhead">
    <?lsmb text('Include in drop-down menus') ?>
 </div>
@@ -366,12 +369,14 @@
              value = 'asset_loss'} ?>
    </div>
 </div>
+</div> <!-- dropdown div -->
 <?lsmb FOREACH hidden IN hiddens.keys;
 	INCLUDE input element_data={
 		type = 'hidden',
 		name = hidden,
 		value = hiddens.item(hidden)
 		}; END ?>
+
 <hr size="3" noshade="noshade" />
 <?lsmb FOREACH button IN buttons; INCLUDE button element_data=button; END ?>
 </form>

Added: trunk/UI/accounts/edit.js
===================================================================
--- trunk/UI/accounts/edit.js	                        (rev 0)
+++ trunk/UI/accounts/edit.js	2011-07-09 07:40:29 UTC (rev 3471)
@@ -0,0 +1,26 @@
+
+function init(){
+    var typeselect = document.getElementById('charttype');
+    typeselect.addEventListener(
+              'blur', 
+              changetype,
+              true
+   );
+   changetype()
+}
+
+function changetype() {
+   var typeselect = document.getElementById('charttype');
+   var headingrow = document.getElementById('heading-line');
+   var accdetails = document.getElementById('accdetails');
+   var dropdowns = document.getElementById('dropdowns');
+   if (typeselect.value == 'A'){
+         headingrow.style.display = 'none';
+         accdetails.style.display = 'block';
+         dropdowns.style.display = 'block';
+   } else {
+         headingrow.style.display = 'block';
+         accdetails.style.display = 'none';
+         dropdowns.style.display = 'none';
+   }
+}

Modified: trunk/scripts/account.pl
===================================================================
--- trunk/scripts/account.pl	2011-07-09 06:35:07 UTC (rev 3470)
+++ trunk/scripts/account.pl	2011-07-09 07:40:29 UTC (rev 3471)
@@ -81,6 +81,9 @@
     my ($request) = @_;
     my $account = LedgerSMB::DBObject::Account->new(base => $request);
     $account->{$account->{summary}}=$account->{summary};
+    if ($account->{charttype} eq 'A'){
+            delete $account->{heading};
+    }
     $account->save;
     edit($request); 
 }


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