aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Gilfillan <ian@greenman.co.za>2016-07-11 22:24:20 +0000
committerIan Gilfillan <ian@greenman.co.za>2016-07-11 22:24:20 +0000
commitc30141e10fb9eb9ff4be8fa87d49d3a86abe1a3d (patch)
treed9a92d7b2730b9373125d83697c5c639636d99b8
parent55505848eaf681e378e0a34af204da10566254e9 (diff)
Sort each hardware category by compatibility
-rw-r--r--h-source/Application/Controllers/AcquisitioncardsController.php4
-rw-r--r--h-source/Application/Controllers/BluetoothController.php4
-rw-r--r--h-source/Application/Controllers/EthernetcardsController.php4
-rw-r--r--h-source/Application/Controllers/FingerprintreadersController.php4
-rw-r--r--h-source/Application/Controllers/GenericController.php80
-rw-r--r--h-source/Application/Controllers/HostcontrollersController.php4
-rw-r--r--h-source/Application/Controllers/ModemsController.php4
-rw-r--r--h-source/Application/Controllers/NotebooksController.php4
-rw-r--r--h-source/Application/Controllers/PrintersController.php4
-rw-r--r--h-source/Application/Controllers/RaidadaptersController.php4
-rw-r--r--h-source/Application/Controllers/ScannersController.php4
-rw-r--r--h-source/Application/Controllers/SdcardreadersController.php4
-rw-r--r--h-source/Application/Controllers/SoundcardsController.php4
-rw-r--r--h-source/Application/Controllers/ThreegcardsController.php4
-rw-r--r--h-source/Application/Controllers/VideocardsController.php4
-rw-r--r--h-source/Application/Controllers/WebcamsController.php4
-rw-r--r--h-source/Application/Controllers/WifiController.php4
-rw-r--r--h-source/Application/Include/myFunctions.php28
18 files changed, 138 insertions, 34 deletions
diff --git a/h-source/Application/Controllers/AcquisitioncardsController.php b/h-source/Application/Controllers/AcquisitioncardsController.php
index 035b81f..e373682 100644
--- a/h-source/Application/Controllers/AcquisitioncardsController.php
+++ b/h-source/Application/Controllers/AcquisitioncardsController.php
@@ -54,7 +54,7 @@ class AcquisitioncardsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'compatibility:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility-desc',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class AcquisitioncardsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/BluetoothController.php b/h-source/Application/Controllers/BluetoothController.php
index 006399d..eae4b74 100644
--- a/h-source/Application/Controllers/BluetoothController.php
+++ b/h-source/Application/Controllers/BluetoothController.php
@@ -54,7 +54,7 @@ class BluetoothController extends GenericController
'comm_year:sanitizeString' => 'undef',
'bluetooth_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'bluetooth-works',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class BluetoothController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/EthernetcardsController.php b/h-source/Application/Controllers/EthernetcardsController.php
index 897e0ea..0425122 100644
--- a/h-source/Application/Controllers/EthernetcardsController.php
+++ b/h-source/Application/Controllers/EthernetcardsController.php
@@ -54,7 +54,7 @@ class EthernetcardsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'ethernet_card_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'ethernet-works',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class EthernetcardsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/FingerprintreadersController.php b/h-source/Application/Controllers/FingerprintreadersController.php
index 9c56c70..c3de0d7 100644
--- a/h-source/Application/Controllers/FingerprintreadersController.php
+++ b/h-source/Application/Controllers/FingerprintreadersController.php
@@ -54,7 +54,7 @@ class FingerprintreadersController extends GenericController
'comm_year:sanitizeString' => 'undef',
'fingerprint_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'fingerprint-works',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class FingerprintreadersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php
index 7de26e0..00848c3 100644
--- a/h-source/Application/Controllers/GenericController.php
+++ b/h-source/Application/Controllers/GenericController.php
@@ -55,6 +55,84 @@ class GenericController extends BaseController
$popup->itemsName = $popNames;
$popup->itemsValue = $popValues;
break;
+ case 'wifi':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('wifi works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','wifi-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'videocards':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('video card works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','video-card-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'threegcards':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('wifi works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','wifi-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'soundcards':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('sound card works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','sound-card-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'webcams':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('webcam works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','webcam-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'bluetooth':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('bluetooth works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','bluetooth-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'acquisitioncards':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('compatibility desc'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','compatibility-desc');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'fingerprintreaders':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('fingerprint works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','fingerprint-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'ethernetcards':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('ethernet works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','ethernet-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'sdcardreaders':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('sdcard works'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','sdcard-works');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'modems':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('compatibility desc'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','compatibility-desc');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'raidadapters':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('compatibility desc'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','compatibility-desc');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
+ case 'hostcontrollers':
+ $popNames = array(gtext('last inserted'),gtext('alphabetically'),gtext('alphabetically desc'),gtext('compatibility desc'));
+ $popValues = array('last-inserted','alphabetically','alphabetically-desc','compatibility-desc');
+ $popup->itemsName = $popNames;
+ $popup->itemsValue = $popValues;
+ break;
default:
array_pop($popNames);
array_pop($popValues);
@@ -920,4 +998,4 @@ class GenericController extends BaseController
}
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/HostcontrollersController.php b/h-source/Application/Controllers/HostcontrollersController.php
index b1c9404..3655aa1 100644
--- a/h-source/Application/Controllers/HostcontrollersController.php
+++ b/h-source/Application/Controllers/HostcontrollersController.php
@@ -58,7 +58,7 @@ class HostcontrollersController extends GenericController
'comm_year:sanitizeString' => 'undef',
'compatibility:sanitizeString' => 'undef',
'subtype:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility-desc',
'search_string:sanitizeString' => 'undef'
);
@@ -134,4 +134,4 @@ class HostcontrollersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/ModemsController.php b/h-source/Application/Controllers/ModemsController.php
index d0a97a3..2b308b6 100644
--- a/h-source/Application/Controllers/ModemsController.php
+++ b/h-source/Application/Controllers/ModemsController.php
@@ -54,7 +54,7 @@ class ModemsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'compatibility:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility-desc',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class ModemsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/NotebooksController.php b/h-source/Application/Controllers/NotebooksController.php
index 02ffbea..1daf894 100644
--- a/h-source/Application/Controllers/NotebooksController.php
+++ b/h-source/Application/Controllers/NotebooksController.php
@@ -81,7 +81,7 @@ class NotebooksController extends GenericController
'compatibility:sanitizeString' => 'undef',
'comm_year:sanitizeString' => 'undef',
'subtype:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility',
'bios:sanitizeString' => 'undef',
'architecture:sanitizeString' => 'undef',
'search_string:sanitizeString' => 'undef'
@@ -156,4 +156,4 @@ class NotebooksController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/PrintersController.php b/h-source/Application/Controllers/PrintersController.php
index fb78761..8610314 100644
--- a/h-source/Application/Controllers/PrintersController.php
+++ b/h-source/Application/Controllers/PrintersController.php
@@ -75,7 +75,7 @@ class PrintersController extends GenericController
'compatibility:sanitizeString' => 'undef',
'comm_year:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility',
'search_string:sanitizeString' => 'undef'
);
@@ -151,4 +151,4 @@ class PrintersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/RaidadaptersController.php b/h-source/Application/Controllers/RaidadaptersController.php
index 37bbad1..be248b4 100644
--- a/h-source/Application/Controllers/RaidadaptersController.php
+++ b/h-source/Application/Controllers/RaidadaptersController.php
@@ -54,7 +54,7 @@ class RaidadaptersController extends GenericController
'comm_year:sanitizeString' => 'undef',
'compatibility:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility-desc',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class RaidadaptersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/ScannersController.php b/h-source/Application/Controllers/ScannersController.php
index ab52d9a..80dc229 100644
--- a/h-source/Application/Controllers/ScannersController.php
+++ b/h-source/Application/Controllers/ScannersController.php
@@ -50,7 +50,7 @@ class ScannersController extends GenericController
'compatibility:sanitizeString' => 'undef',
'comm_year:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'compatibility',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class ScannersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/SdcardreadersController.php b/h-source/Application/Controllers/SdcardreadersController.php
index 78ba530..9d156cf 100644
--- a/h-source/Application/Controllers/SdcardreadersController.php
+++ b/h-source/Application/Controllers/SdcardreadersController.php
@@ -54,7 +54,7 @@ class SdcardreadersController extends GenericController
'comm_year:sanitizeString' => 'undef',
'sd_card_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'sdcard-works',
'search_string:sanitizeString' => 'undef'
);
@@ -128,4 +128,4 @@ class SdcardreadersController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/SoundcardsController.php b/h-source/Application/Controllers/SoundcardsController.php
index e48a6fb..fff5e77 100644
--- a/h-source/Application/Controllers/SoundcardsController.php
+++ b/h-source/Application/Controllers/SoundcardsController.php
@@ -50,7 +50,7 @@ class SoundcardsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'sound_card_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'sound-card-works',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class SoundcardsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/ThreegcardsController.php b/h-source/Application/Controllers/ThreegcardsController.php
index 173466c..3824fe0 100644
--- a/h-source/Application/Controllers/ThreegcardsController.php
+++ b/h-source/Application/Controllers/ThreegcardsController.php
@@ -50,7 +50,7 @@ class ThreegcardsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'wifi_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'wifi-works',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class ThreegcardsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php
index 477e335..a27e723 100644
--- a/h-source/Application/Controllers/VideocardsController.php
+++ b/h-source/Application/Controllers/VideocardsController.php
@@ -50,7 +50,7 @@ class VideocardsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'video_card_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'video-card-works',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class VideocardsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/WebcamsController.php b/h-source/Application/Controllers/WebcamsController.php
index 08f9e1b..41807ed 100644
--- a/h-source/Application/Controllers/WebcamsController.php
+++ b/h-source/Application/Controllers/WebcamsController.php
@@ -50,7 +50,7 @@ class WebcamsController extends GenericController
'comm_year:sanitizeString' => 'undef',
'webcam_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'webcam-works',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class WebcamsController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php
index 5caaf30..8bf4c72 100644
--- a/h-source/Application/Controllers/WifiController.php
+++ b/h-source/Application/Controllers/WifiController.php
@@ -50,7 +50,7 @@ class WifiController extends GenericController
'comm_year:sanitizeString' => 'undef',
'wifi_works:sanitizeString' => 'undef',
'interface:sanitizeString' => 'undef',
- 'sort-by:sanitizeString' => 'undef',
+ 'sort-by:sanitizeString' => 'wifi-works',
'search_string:sanitizeString' => 'undef'
);
@@ -124,4 +124,4 @@ class WifiController extends GenericController
parent::talk($lang, $id_hard, $token);
}
-} \ No newline at end of file
+}
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index 903c013..c4a220b 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -124,13 +124,39 @@ function getOrderByClause($string)
case 'compatibility':
$orderBy = 'compatibility, hardware.id_hard desc';
break;
+ case 'compatibility-desc':
+ $orderBy = 'compatibility desc, hardware.id_hard desc';
+ break;
+ case 'wifi-works':
+ $orderBy = 'wifi_works desc, hardware.id_hard desc';
+ break;
+ case 'video-card-works':
+ $orderBy = 'video_card_works desc, hardware.id_hard desc';
+ break;
+ case 'sound-card-works':
+ $orderBy = 'sound_card_works desc, hardware.id_hard desc';
+ break;
+ case 'webcam-works':
+ $orderBy = 'webcam_works desc, hardware.id_hard desc';
+ break;
+ case 'bluetooth-works':
+ $orderBy = 'bluetooth_works desc, hardware.id_hard desc';
+ break;
+ case 'fingerprint-works':
+ $orderBy = 'fingerprint_works desc, hardware.id_hard desc';
+ break;
+ case 'ethernet-works':
+ $orderBy = 'ethernet_card_works desc, hardware.id_hard desc';
+ break;
+ case 'sdcard-works':
+ $orderBy = 'sd_card_works desc, hardware.id_hard desc';
+ break;
case 'undef':
$orderBy = 'compatibility, hardware.id_hard desc';
break;
default:
$orderBy = 'compatibility, hardware.id_hard desc';
}
-
return $orderBy;
}