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

SF.net SVN: ledger-smb:[5055] addons/1.3/nested_partsgroups/trunk/patches/ nested_partsgroups.patch



Revision: 5055
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5055&view=rev
Author:   einhverfr
Date:     2012-07-28 13:11:57 +0000 (Sat, 28 Jul 2012)
Log Message:
-----------
Adding nested partsgroup patch

Added Paths:
-----------
    addons/1.3/nested_partsgroups/trunk/patches/nested_partsgroups.patch

Added: addons/1.3/nested_partsgroups/trunk/patches/nested_partsgroups.patch
===================================================================
--- addons/1.3/nested_partsgroups/trunk/patches/nested_partsgroups.patch	                        (rev 0)
+++ addons/1.3/nested_partsgroups/trunk/patches/nested_partsgroups.patch	2012-07-28 13:11:57 UTC (rev 5055)
@@ -0,0 +1,56 @@
+Index: LedgerSMB/PE.pm
+===================================================================
+--- LedgerSMB/PE.pm	(revision 4922)
++++ LedgerSMB/PE.pm	(revision 4923)
+@@ -387,8 +387,9 @@
+     }
+     else {
+         $query = qq|
+-			INSERT INTO partsgroup (partsgroup)
+-			     VALUES (?)|;
++			INSERT INTO partsgroup (partsgroup, parent)
++			     VALUES (?, ?)|;
++        push @group, $form->{parent};
+     }
+     $dbh->do($query, undef, @group) || $form->dberror($query);
+ 
+Index: bin/pe.pl
+===================================================================
+--- bin/pe.pl	(revision 4922)
++++ bin/pe.pl	(revision 4923)
+@@ -224,8 +224,6 @@
+ }
+ 
+ 
+-}
+-
+ sub save {
+ 
+     if ( $form->{translation} ) {
+@@ -405,6 +403,7 @@
+     # $locale->text('Edit Group')
+ 
+     $form->{partsgroup} = $form->quote( $form->{partsgroup} );
++    PE->partsgroups(\%myconfig, $form);
+ 
+     $form->header;
+ 
+@@ -425,7 +424,17 @@
+     <td>
+       <table width=100%>
+ 	<tr>
+-	  <th align=right>| . $locale->text('Group') . qq|</th>
++          <th align="right">| . $locale->text('Parent') . qq|</th>
++          <td><select name='parent'>|;
++              for my $pg (@{$form->{item_list}}){
++                  my $selected = '';
++                  $selected = 'SELECTED="SELECTED"'
++                         if $form->{parent} == $pg->{id};
++                  print qq|<option value='$pg->{id}' $selected>
++                                  $pg->{partsgroup} </option>|;
++              }
++	  print qq|</select>
++          <th align="right">| . $locale->text('Group') . qq|</th>
+ 
+           <td><input name=partsgroup size=30 value="$form->{partsgroup}"></td>
+ 	</tr>

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