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

SF.net SVN: ledger-smb:[4532] branches/1.3



Revision: 4532
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4532&view=rev
Author:   einhverfr
Date:     2012-03-23 08:44:40 +0000 (Fri, 23 Mar 2012)
Log Message:
-----------
A few bugs fixed with dynatable and the parts search routine

Modified Paths:
--------------
    branches/1.3/LedgerSMB/DBObject/Pricelist.pm
    branches/1.3/LedgerSMB/ScriptLib/Common_Search/Part.pm
    branches/1.3/LedgerSMB/ScriptLib/Company.pm
    branches/1.3/UI/lib/dynatable.html
    branches/1.3/sql/modules/Parts.sql

Modified: branches/1.3/LedgerSMB/DBObject/Pricelist.pm
===================================================================
--- branches/1.3/LedgerSMB/DBObject/Pricelist.pm	2012-03-23 00:09:48 UTC (rev 4531)
+++ branches/1.3/LedgerSMB/DBObject/Pricelist.pm	2012-03-23 08:44:40 UTC (rev 4532)
@@ -54,7 +54,7 @@
         $line->merge($ref);
         $line->exec_method({funcname => 'pricelist__add'});
     }
-    $dbh->commit;
+    $self->{dbh}->commit;
 }
 
 =back

Modified: branches/1.3/LedgerSMB/ScriptLib/Common_Search/Part.pm
===================================================================
--- branches/1.3/LedgerSMB/ScriptLib/Common_Search/Part.pm	2012-03-23 00:09:48 UTC (rev 4531)
+++ branches/1.3/LedgerSMB/ScriptLib/Common_Search/Part.pm	2012-03-23 08:44:40 UTC (rev 4532)
@@ -70,7 +70,7 @@
 =cut
 
 sub new {
-    my ($request) = @_;
+    my ($self, $request) = @_;
     my $self = {};
     bless $self, __PACKAGE__;
     $self->{_part} = LedgerSMB::DBObject::Part->new({base => $request});
@@ -90,7 +90,7 @@
     my ($self, $args) = @_;
     my @results = $self->{_part}->search_lite($args);
     $self->{_results} = ..hidden..;
-    return $self->{_results};
+    return @{$self->{_results}};
 }
 
 =back

Modified: branches/1.3/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- branches/1.3/LedgerSMB/ScriptLib/Company.pm	2012-03-23 00:09:48 UTC (rev 4531)
+++ branches/1.3/LedgerSMB/ScriptLib/Company.pm	2012-03-23 08:44:40 UTC (rev 4532)
@@ -1039,9 +1039,10 @@
 sub save_pricelist {
     my ($request) = @_;
     use LedgerSMB::ScriptLib::Common_Search::Part;
+    use LedgerSMB::DBObject::Pricelist;
 
-    my $count = $request->{rowcount};
-    my $pricelist = LedgerSMB::DBObject::Pricelist;
+    my $count = $request->{rowcount_pricematrix};
+    my $pricelist = LedgerSMB::DBObject::Pricelist->new({base => $request});
     my @lines;
     my $redirect_to_selection = 0;
 
@@ -1051,6 +1052,7 @@
                    { partnumber => $request->{"int_partnumber_tfoot_$count"},
                     description => $request->{"description_tfoot_$count"}, }
     );
+
     if (scalar @parts == 0) {
         $request->error($request->{_locale}->text('Part not found'));
     } elsif (scalar @parts > 1){

Modified: branches/1.3/UI/lib/dynatable.html
===================================================================
--- branches/1.3/UI/lib/dynatable.html	2012-03-23 00:09:48 UTC (rev 4531)
+++ branches/1.3/UI/lib/dynatable.html	2012-03-23 08:44:40 UTC (rev 4532)
@@ -12,17 +12,17 @@
 </thead>
 <?lsmb- END -?>
 <tbody>
-   <?lsmb- ROWCOUNT = 1;
+   <?lsmb- ROWCOUNT = 0;
    PFX = attributes.input_prefix;
    FOREACH ROW IN tbody.rows;
    ROWCOUNT = ROWCOUNT + 1 -?>
    <tr class="<?lsmb ROW.html_class ?>">
-      <input type="hidden" name="row_<?lsmb loop.count ?>" 
+      <input type="hidden" name="row_ROWCOUNT" 
              value="<?lsmb row_id ?>" />
       <?lsmb- FOREACH COL IN columns -?>
       <td class="<?lsmb COL.col_id _ ' ' _ COL.class _ ' ' _ COL.type ?>">
           <?lsmb- IF COL.type == 'input_text' -?>
-          <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+          <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="text"
               class="<?lsmb COL.class ?>"
                name="<?lsmb PFX _ COL.col_id _ '_' _ ROW.row_id ?>"
@@ -35,14 +35,14 @@
                       CHECKED = '';
                    END;
                    ?> 
-         <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+         <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="checkbox"
-               name="<?lsmb PFX _ COL.col_id ?>_<?lsmb loop.count ?>"
+               name="<?lsmb PFX _ COL.col_id _ '_' _ ROWCOUNT ?>"
               class="<?lsmb COL.class ?>"
               value="<?lsmb ROW.row_id ?>"
                <?lsmb CHECKED ?> />
          <?lsmb- ELSIF COL.type == 'radio' ?> 
-         <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+         <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="radio"
                name="<?lsmb PFX _ COL.col_id ?>"
               class="<?lsmb COL.class ?>"
@@ -66,7 +66,6 @@
             <?lsmb ROW.${COL.col_id} ?>
          <?lsmb- END -?>
       </td>
-      <?lsmb- COUNT = loop.count -?>
       <?lsmb- END -?>
    </tr>
    <?lsmb- END ?>
@@ -91,10 +90,10 @@
              TYPE = COL.type;
           END;
           IF TYPE == 'input_text' -?>
-          <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+          <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="text"
               class="<?lsmb COL.class ?>"
-               name="<?lsmb PFX _ COL.col_id _ 'tfoot_' _ loop.count ?>"
+               name="<?lsmb PFX _ COL.col_id _ '_tfoot_' _ ROWCOUNT ?>"
               value="<?lsmb ROW.${COL.col_id} ?>"
          />
          <?lsmb- ELSIF TYPE == 'checkbox';
@@ -104,14 +103,14 @@
                       CHECKED = '';
                    END;
                    ?> 
-         <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+          <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="checkbox"
-               name="<?lsmb PFX _ COL.col_id ?>_<?lsmb loop.count ?>"
+               name="<?lsmb PFX _ COL.col_id _ '_' _ ROWCOUNT ?>"
               class="<?lsmb COL.class ?>"
               value="<?lsmb ROW.row_id ?>"
                <?lsmb CHECKED ?> />
          <?lsmb- ELSIF TYPE == 'radio' ?> 
-         <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
+         <input id="<?lsmb COL.col_id _ '-' _ ROWCOUNT ?>"
                type="radio"
                name="<?lsmb PFX _ COL.col_id ?>"
               class="<?lsmb COL.class ?>"
@@ -126,7 +125,7 @@
                    END
           ?><a href="<?lsmb HREF ?>"><?lsmb ROW.${COL.col_id} ?></a>
          <?lsmb ELSIF TYPE == 'mirrored';
-         NAME = PFX _ ROW.${COL.col_id} _ '_' _ 'tfoot_' _ ROWCOUNT;
+         NAME = PFX _ ROW.${COL.col_id} _ '_' _ '_tfoot_' _ ROWCOUNT;
          ROW.${COL.col_id} ?>
          <input type="hidden" 
                name="<?lsmb NAME ?>" 

Modified: branches/1.3/sql/modules/Parts.sql
===================================================================
--- branches/1.3/sql/modules/Parts.sql	2012-03-23 00:09:48 UTC (rev 4531)
+++ branches/1.3/sql/modules/Parts.sql	2012-03-23 08:44:40 UTC (rev 4532)
@@ -10,7 +10,8 @@
        AND ($2 IS NULL 
             OR (to_tsvector(get_default_lang()::name, description) 
                 @@
-                plainto_tsquery(get_default_lang()::name, $2::tsvector)))
+                plainto_tsquery(get_default_lang()::name, $2)))
+       AND not obsolete
 ORDER BY partnumber;
 $$ LANGUAGE SQL;
 

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