Bugfix: Auftragssuche: Bei niedrigen vclimit muss nach projectNUMMER und nicht nach...
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 3 Sep 2009 14:30:15 +0000 (16:30 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 3 Sep 2009 14:30:15 +0000 (16:30 +0200)
Fix für Bug 1108

SL/OE.pm
templates/webpages/oe/search_de.html
templates/webpages/oe/search_master.html

index df634af..f5f439f 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -111,7 +111,18 @@ sub transactions {
       qq|AND ((globalproject_id = ?) OR EXISTS | .
       qq|  (SELECT * FROM orderitems oi | .
       qq|   WHERE oi.project_id = ? AND oi.trans_id = o.id))|;
-    push(@values, $form->{"project_id"}, $form->{"project_id"});
+    push(@values, conv_i($form->{"project_id"}), conv_i($form->{"project_id"}));
+  }
+
+  if ($form->{"projectnumber"}) {
+    $query .= <<SQL;
+      AND (pr.projectnumber ILIKE ?) OR EXISTS (
+        SELECT * FROM orderitems oi
+        LEFT JOIN project proi ON proi.id = oi.project_id
+        WHERE proi.projectnumber ILIKE ? AND oi.trans_id = o.id
+      )
+SQL
+    push @values, "%" . $form->{"projectnumber"} . "%", "%" . $form->{"projectnumber"} . "%" ;
   }
 
   if ($form->{"${vc}_id"}) {
index 946e678..0358b0b 100644 (file)
@@ -87,7 +87,7 @@
      <th align="right">Projektnummer</th>
      <td colspan="3">
             [%- INCLUDE 'generic/multibox.html'
-                 name          = 'project_id',
+                 name          =  vclimit < ALL_PROJECTS.size ? 'projectnumber' : 'project_id',
                  style         = "width: 250px",
                  DATA          =  ALL_PROJECTS,
                  id_key        = 'id',
index 705bf71..32d766f 100644 (file)
@@ -87,7 +87,7 @@
      <th align="right"><translate>Project Number</translate></th>
      <td colspan="3">
             [%- INCLUDE 'generic/multibox.html'
-                 name          = 'project_id',
+                 name          =  vclimit < ALL_PROJECTS.size ? 'projectnumber' : 'project_id',
                  style         = "width: 250px",
                  DATA          =  ALL_PROJECTS,
                  id_key        = 'id',