]> git.pld-linux.org Git - packages/lms.git/commitdiff
- applied upstream
authorSÅ‚awomir Paszkiewicz <paszczus@pld-linux.org>
Sat, 9 Apr 2011 10:04:37 +0000 (10:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lms-promotionlist.php.patch -> 1.2
    lms-quicksearch.php.patch -> 1.2

lms-promotionlist.php.patch [deleted file]
lms-quicksearch.php.patch [deleted file]

diff --git a/lms-promotionlist.php.patch b/lms-promotionlist.php.patch
deleted file mode 100644 (file)
index 15ef977..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
---- modules/promotionlist.php  2011/03/02 10:31:05     1.1
-+++ modules/promotionlist.php  2011/03/21 07:57:57     1.2
-@@ -21,14 +21,14 @@
-  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-  *  USA.
-  *
-- *  $Id$
-+ *  $Id$
-  */
- $layout['pagetitle'] = trans('Promotions List');
- $promolist = $DB->GetAll('SELECT p.id, p.name, p.description, disabled,
-                       (SELECT COUNT(*) FROM promotionschemas
--                              WHERE p.id = promotionid) AS schemas,
-+                              WHERE p.id = promotionid) AS scs,
-                       (SELECT COUNT(DISTINCT a.tariffid)
-                           FROM promotionassignments a
-                               JOIN promotionschemas s ON (s.id = a.promotionschemaid)
diff --git a/lms-quicksearch.php.patch b/lms-quicksearch.php.patch
deleted file mode 100644 (file)
index c234ef1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-diff -ur lms/modules/quicksearch.php lms.new//modules/quicksearch.php
---- lms/modules/quicksearch.php        2011-03-18 09:59:24.000000000 +0100
-+++ lms.new//modules/quicksearch.php   2011-03-29 20:41:29.772258200 +0200
-@@ -1,7 +1,7 @@
- <?php
- /*
-- * LMS version 1.11.12 Aris
-+ * LMS version 1.11-cvs
-  *
-  *  (C) Copyright 2001-2011 LMS Developers
-  *
-@@ -21,7 +21,7 @@
-  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-  *  USA.
-  *
-- *  $Id$
-+ *  $Id$
-  */
- function macformat($mac)
-@@ -75,12 +75,13 @@
-       case 'customer':
-               if(isset($_GET['ajax'])) // support for AutoSuggest
-               {
--                      $candidates = $DB->GetAll('SELECT id, email, address, post_address, deleted,
-+                      $candidates = $DB->GetAll('SELECT id, email, address, post_name, post_address, deleted,
-                           '.$DB->Concat('UPPER(lastname)',"' '",'name').' AS username
-                               FROM customersview
-                               WHERE '.(preg_match('/^[0-9]+$/', $search) ? 'id = '.intval($search).' OR ' : '').'
-                                       LOWER('.$DB->Concat('lastname',"' '",'name').') ?LIKE? LOWER(\'%'.$search.'%\')
-                                       OR LOWER(address) ?LIKE? LOWER(\'%'.$search.'%\')
-+                                      OR LOWER(post_name) ?LIKE? LOWER(\'%'.$search.'%\')
-                                       OR LOWER(post_address) ?LIKE? LOWER(\'%'.$search.'%\')
-                                       OR LOWER(email) ?LIKE? LOWER(\'%'.$search.'%\')
-                               ORDER by deleted, username, email, address
-@@ -105,6 +106,10 @@
-                                   $descriptions[$row['id']] = escape_js(trans('Address:').' '.$row['address']);
-                                   continue;
-                               }
-+                              else if (preg_match("~$search~i",$row['post_name'])) {
-+                                  $descriptions[$row['id']] = escape_js(trans('Name:').' '.$row['post_name']);
-+                                  continue;
-+                              }
-                               else if (preg_match("~$search~i",$row['post_address'])) {
-                                   $descriptions[$row['id']] = escape_js(trans('Address:').' '.$row['post_address']);
-                                   continue;
-@@ -156,20 +161,37 @@
-       case 'node':
-               if(isset($_GET['ajax'])) // support for AutoSuggest
-               {
--                      $candidates = $DB->GetAll('SELECT n.id, n.name, INET_NTOA(ipaddr) as ip,
--                          INET_NTOA(ipaddr_pub) AS ip_pub, mac
--                              FROM vnodes n
--                              WHERE ('.(preg_match('/^[0-9]+$/',$search) ? 'n.id = '.intval($search).' OR ' : '').' 
--                                      LOWER(n.name) ?LIKE? LOWER(\'%'.$search.'%\')
--                                      OR INET_NTOA(ipaddr) ?LIKE? \'%'.$search.'%\'
--                                      OR INET_NTOA(ipaddr_pub) ?LIKE? \'%'.$search.'%\'
--                                      OR LOWER(mac) ?LIKE? LOWER(\'%'.macformat($search).'%\')
--                                      )
--                                      AND NOT EXISTS (
--                        SELECT 1 FROM customerassignments a
--                                  JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
--                                          WHERE e.userid = lms_current_user() AND a.customerid = n.ownerid)
--                              ORDER BY n.name LIMIT 15');
-+                  // Build different query for each database engine,
-+                  // MySQL is slow here when vnodes view is used
-+                  if ($CONFIG['database']['type'] == 'postgres')
-+                          $sql_query = 'SELECT n.id, n.name, INET_NTOA(ipaddr) as ip,
-+                              INET_NTOA(ipaddr_pub) AS ip_pub, mac
-+                                  FROM vnodes n
-+                                  WHERE %where
-+                              ORDER BY n.name LIMIT 15';
-+            else
-+                          $sql_query = 'SELECT n.id, n.name, INET_NTOA(ipaddr) as ip,
-+                              INET_NTOA(ipaddr_pub) AS ip_pub, mac
-+                                  FROM nodes n
-+                                  JOIN (
-+                        SELECT nodeid, GROUP_CONCAT(mac SEPARATOR \',\') AS mac
-+                        FROM macs
-+                        GROUP BY nodeid
-+                    ) m ON (n.id = m.nodeid)
-+                                  WHERE %where
-+                              ORDER BY n.name LIMIT 15';
-+
-+            $sql_where = '('.(preg_match('/^[0-9]+$/',$search) ? 'n.id = '.intval($search).' OR ' : '').'
-+                              LOWER(n.name) ?LIKE? LOWER(\'%'.$search.'%\')
-+                              OR INET_NTOA(ipaddr) ?LIKE? \'%'.$search.'%\'
-+                              OR INET_NTOA(ipaddr_pub) ?LIKE? \'%'.$search.'%\'
-+                              OR LOWER(mac) ?LIKE? LOWER(\'%'.macformat($search).'%\'))
-+                          AND NOT EXISTS (
-+                    SELECT 1 FROM customerassignments a
-+                    JOIN excludedgroups e ON (a.customergroupid = e.customergroupid)
-+                              WHERE e.userid = lms_current_user() AND a.customerid = n.ownerid)';
-+
-+                      $candidates = $DB->GetAll(str_replace('%where', $sql_where,     $sql_query));
-                       $eglible=array(); $actions=array(); $descriptions=array();
-                       if ($candidates)
This page took 0.058407 seconds and 4 git commands to generate.