From fef5c074223364eb32032a5787ea824fcbadc4fe Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 2 Oct 2011 17:35:41 +0000 Subject: added sd card readers --- .../Controllers/BluetoothController.php | 2 +- .../Application/Controllers/DownloadController.php | 10 ++ .../Controllers/SdcardreadersController.php | 129 +++++++++++++++++++++ h-source/Application/Include/hardware.php | 12 +- h-source/Application/Include/languages.php | 16 ++- h-source/Application/Models/SdcardreadersModel.php | 70 +++++++++++ h-source/Application/Views/Download/index.php | 4 + h-source/Application/Views/Hardware/left.php | 4 + .../Application/Views/Sdcardreaders/catalogue.php | 89 ++++++++++++++ h-source/Config/Route.php | 10 ++ h-source/Public/Img/H2O/media-flash-sd-mmc.png | Bin 0 -> 4272 bytes h-source/Public/Img/H2O/media-flash-sd-mmc_22.png | Bin 0 -> 1081 bytes h-source/tables.sql | 4 +- 13 files changed, 346 insertions(+), 4 deletions(-) create mode 100644 h-source/Application/Controllers/SdcardreadersController.php create mode 100644 h-source/Application/Models/SdcardreadersModel.php create mode 100644 h-source/Application/Views/Sdcardreaders/catalogue.php create mode 100755 h-source/Public/Img/H2O/media-flash-sd-mmc.png create mode 100755 h-source/Public/Img/H2O/media-flash-sd-mmc_22.png diff --git a/h-source/Application/Controllers/BluetoothController.php b/h-source/Application/Controllers/BluetoothController.php index bff2723..5d701e9 100644 --- a/h-source/Application/Controllers/BluetoothController.php +++ b/h-source/Application/Controllers/BluetoothController.php @@ -28,7 +28,7 @@ class BluetoothController extends GenericController $this->_topMenuClasses['hardware'] = " class='currentitem'"; - $worksOptions = Bluetooth::$select;; + $worksOptions = Bluetooth::$select; $worksField = 'bluetooth_works'; $interfaceOptions = Bluetooth::$interface; diff --git a/h-source/Application/Controllers/DownloadController.php b/h-source/Application/Controllers/DownloadController.php index d44d343..d58ba6c 100644 --- a/h-source/Application/Controllers/DownloadController.php +++ b/h-source/Application/Controllers/DownloadController.php @@ -145,6 +145,11 @@ class DownloadController extends BaseController $xml .= "\t\t".$row['hardware']['ethernet_card_works']."\n"; } + if ($type === 'sd-card-reader') + { + $xml .= "\t\t".$row['hardware']['sd_card_works']."\n"; + } + if ($type !== "notebook") { $xml .= "\t\t".$row['hardware']['driver']."\n"; @@ -240,4 +245,9 @@ class DownloadController extends BaseController { $this->printXml($lang, array('type'=>'ethernet-card','-deleted'=>'no')); } + + public function sdcardreaders($lang = 'en') + { + $this->printXml($lang, array('type'=>'sd-card-reader','-deleted'=>'no')); + } } \ No newline at end of file diff --git a/h-source/Application/Controllers/SdcardreadersController.php b/h-source/Application/Controllers/SdcardreadersController.php new file mode 100644 index 0000000..6d7b719 --- /dev/null +++ b/h-source/Application/Controllers/SdcardreadersController.php @@ -0,0 +1,129 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class SdcardreadersController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $this->_topMenuClasses['hardware'] = " class='currentitem'"; + + $worksOptions = Sdcardreaders::$select; + $worksField = 'sd_card_works'; + $interfaceOptions = Sdcardreaders::$interface; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('SdcardreadersModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['SdcardreadersModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'sd-card-reader'; + + $this->m['HardwareModel']->setConditions($worksOptions,$worksField,$interfaceOptions); + + $this->m['HardwareModel']->setFields('model,kernel,description,distribution,comm_year,sd_card_works,pci_id,interface,driver,other_names','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'sd_card_works:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef' + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'Bluetooth'; + + $data['intefaceOptions'] = $interfaceOptions; + $data['worksOptions'] = $worksOptions; + $data['worksField'] = $worksField; + $this->append($data); + } + + public function catalogue($lang = 'en') + { + $this->shift(1); + + $whereArray = array( + 'type' => $this->mod->type, + 'vendor' => $this->viewArgs['vendor'], + 'comm_year' => $this->viewArgs['comm_year'], + 'sd_card_works' => $this->viewArgs['sd_card_works'], + 'interface' => $this->viewArgs['interface'], + ); + + $this->mod->setWhereQueryClause($whereArray); + + parent::catalogue($lang); + } + + public function view($lang = 'en', $id = 0, $name = null) + { + parent::view($lang, $id, $name); + } + + public function history($lang = 'en', $id = 0) + { + parent::history($lang, $id); + } + + public function revision($lang = 'en', $id_rev = 0) + { + parent::revision($lang, $id_rev); + } + + public function insert($lang = 'en', $token = '') + { + parent::insert($lang, $token); + } + + public function update($lang = 'en', $token = '') + { + parent::update($lang, $token); + } + + public function differences($lang = 'en', $id_hard = 0, $id_rev = 0) + { + parent::differences($lang, $id_hard, $id_rev); + } + + public function climb($lang = 'en', $id_rev = 0, $token = '') + { + parent::climb($lang, $id_rev, $token); + } + + public function talk($lang = 'en', $id_hard = 0, $token = '') + { + parent::talk($lang, $id_hard, $token); + } + +} \ No newline at end of file diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index 2e5cb0e..e919326 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -42,7 +42,7 @@ class Hardware return $string; } - public static $controllers = array('notebooks','wifi','videocards','printers','scanners','threegcards','soundcards','webcams','bluetooth','acquisitioncards','fingerprintreaders','ethernetcards'); //used by UsersController::login() + public static $controllers = array('notebooks','wifi','videocards','printers','scanners','threegcards','soundcards','webcams','bluetooth','acquisitioncards','fingerprintreaders','ethernetcards','sdcardreaders'); //used by UsersController::login() //classId => controller public static $deviceClasses = array( @@ -68,6 +68,7 @@ class Hardware 'acquisition-card' => 'Crystal/cam_mount-22.png', 'fingerprint-reader' => 'fingerprint_icon-22.png', 'ethernet-card' => 'H2O/network-wired_22.png', + 'sd-card-reader' => 'H2O/media-flash-sd-mmc_22.png', ); public static $typeToController = array( @@ -83,6 +84,7 @@ class Hardware 'acquisition-card' => 'acquisitioncards', 'fingerprint-reader' => 'fingerprintreaders', 'ethernet-card' => 'ethernetcards', + 'sd-card-reader' => 'sdcardreaders', ); public static function getTypes() @@ -410,6 +412,14 @@ class Ethernetcards extends Hardware public static $select = 'yes,no'; + public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card,Firewire,Parallel,Serial"; +} + +class Sdcardreaders extends Hardware +{ + + public static $select = 'yes,no'; + public static $interface = "not-specified,USB,PCI,PCI-E,mini-PCI,mini-PCI-E,ExpressCard,PC-Card,Firewire,Parallel,Serial"; } \ No newline at end of file diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 635f361..406fad0 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -296,6 +296,9 @@ class Lang /*0248*/"Edit" => "Modifica", /*0249*/"Talk page" => "Pagina di discussione", /*0250*/"Download the xml file of all the ethernet cards in the database" => "Scarica il file xml di tutte le schede ethernet presenti nel database", + /*0251*/"No sd card readers found" => "Non è stato trovato alcun lettore di schede sd", + /*0252*/"Sd card readers" => "Lettori di schede sd", + /*0253*/"Download the xml file of all the sd card readers in the database" => "Scarica il file xml di tutti i lettori di schede sd presenti nel database", ), 'es' => array ( @@ -1012,6 +1015,7 @@ class Lang 'acquisitioncards' => 'acquisition card', 'fingerprintreaders' => 'fingerprint reader', 'ethernetcards' => 'ethernet card', + 'sdcardreaders' => 'sd card reader', ), 'it' => array( 'notebooks' => 'notebook', @@ -1026,6 +1030,7 @@ class Lang 'acquisitioncards' => 'scheda di acquisizione', 'fingerprintreaders' => 'lettore di impronte digitali', 'ethernetcards' => 'scheda ethernet', + 'sdcardreaders' => 'lettore di schede sd', ), 'es' => array( 'notebooks' => 'portátil', @@ -1040,6 +1045,7 @@ class Lang 'acquisitioncards' => 'tarjeta de adquisición', 'fingerprintreaders' => 'lector de huella digital', 'ethernetcards' => 'tarjeta de ethernet', + 'sdcardreaders' => 'sd card reader', ), 'fr' => array( 'notebooks' => 'notebook', @@ -1054,6 +1060,7 @@ class Lang 'acquisitioncards' => 'carte d\'acquisition', 'fingerprintreaders' => 'lecteur d\'empreintes digitales', 'ethernetcards' => 'carte ethernet', + 'sdcardreaders' => 'sd card reader', ), 'de' => array( 'notebooks' => 'notebook', @@ -1068,6 +1075,7 @@ class Lang 'acquisitioncards' => 'acquisition card', 'fingerprintreaders' => 'fingerprint reader', 'ethernetcards' => 'ethernet card', + 'sdcardreaders' => 'sd card reader', ), ); @@ -1085,6 +1093,7 @@ class Lang 'acquisitioncards' => 'acquisition cards', 'fingerprintreaders' => 'fingerprint readers', 'ethernetcards' => 'ethernet cards', + 'sdcardreaders' => 'sd card readers', ), 'it' => array( 'notebooks' => 'notebook', @@ -1099,6 +1108,7 @@ class Lang 'acquisitioncards' => 'schede di acquisizione', 'fingerprintreaders' => 'lettori di impronte digitali', 'ethernetcards' => 'schede ethernet', + 'sdcardreaders' => 'lettori di schede sd', ), 'es' => array( 'notebooks' => 'portátiles', @@ -1113,6 +1123,7 @@ class Lang 'acquisitioncards' => 'tarjetas de adquisición', 'fingerprintreaders' => 'lectores de huella digital', 'ethernetcards' => 'tarjetas de ethernet', + 'sdcardreaders' => 'sd card readers', ), 'fr' => array( 'notebooks' => 'notebooks', @@ -1126,7 +1137,8 @@ class Lang 'bluetooth' => 'périphériques bluetooth', 'acquisitioncards' => 'cartes d\'acquisition', 'fingerprintreaders' => 'lecteurs d\'empreintes digitales ', - 'ethernetcards' => 'cartes ethernet', + 'ethernetcards' => 'cartes ethernet', + 'sdcardreaders' => 'sd card readers', ), 'de' => array( 'notebooks' => 'notebooks', @@ -1141,6 +1153,7 @@ class Lang 'acquisitioncards' => 'acquisition cards', 'fingerprintreaders' => 'fingerprint readers', 'ethernetcards' => 'ethernet cards', + 'sdcardreaders' => 'sd card readers', ), ); @@ -1194,6 +1207,7 @@ class MyStrings 'acquisition-card' => 'acquisitioncards', 'fingerprint-reader' => 'fingerprintreaders', 'ethernet-card' => 'ethernetcards', + 'sd-card-reader' => 'sdcardreaders', ); public static function getTypes() diff --git a/h-source/Application/Models/SdcardreadersModel.php b/h-source/Application/Models/SdcardreadersModel.php new file mode 100644 index 0000000..f580d87 --- /dev/null +++ b/h-source/Application/Models/SdcardreadersModel.php @@ -0,0 +1,70 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class SdcardreadersModel extends GenericModel +{ + + public $type = 'sd-card-reader'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'comm_year' => 'comm_year', + 'sd_card_works' => 'sd_card_works', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'comm_year' => gtext("year"), + 'sd_card_works' => gtext("does it work?"), + 'interface' => gtext("interface"), + ); + + $this->_popupFunctions = array( + 'vendor' => 'betterVendor', + ); + + $this->createPopupWhere('vendor,sd_card_works,comm_year,interface'); + + $this->diffFields = array( + 'vendor' => gtext("vendor"), + 'model' => gtext('model name'), + 'other_names' => gtext('possible other names of the device'), + 'pci_id' => gtext("VendorID:ProductID code of the device"), + 'comm_year' => gtext('year of commercialization'), + 'interface' => gtext("interface"), + 'distribution' => gtext('GNU/Linux distribution used for the test'), + 'kernel' => gtext('tested with the following kernel libre'), + 'sd_card_works' => gtext("does it work with free software?"), + 'driver' => gtext("free driver used"), + 'description' => gtext('Description'), + ); + + $this->fieldsWithBreaks = array(gtext('Description'),gtext('possible other names of the device')); + + parent::__construct(); + } + +} \ No newline at end of file diff --git a/h-source/Application/Views/Download/index.php b/h-source/Application/Views/Download/index.php index de4d434..2ffeae0 100644 --- a/h-source/Application/Views/Download/index.php +++ b/h-source/Application/Views/Download/index.php @@ -89,6 +89,10 @@ ethernet cards in the database");?> "> + + sd card readers in the database");?> + "> + diff --git a/h-source/Application/Views/Hardware/left.php b/h-source/Application/Views/Hardware/left.php index 5390303..d6ea435 100644 --- a/h-source/Application/Views/Hardware/left.php +++ b/h-source/Application/Views/Hardware/left.php @@ -73,4 +73,8 @@
+ +
+ +
\ No newline at end of file diff --git a/h-source/Application/Views/Sdcardreaders/catalogue.php b/h-source/Application/Views/Sdcardreaders/catalogue.php new file mode 100644 index 0000000..be0a14c --- /dev/null +++ b/h-source/Application/Views/Sdcardreaders/catalogue.php @@ -0,0 +1,89 @@ + + +. +?> + +
+
+ +
+
+
viewArgs['vendor'])?>
+
viewArgs['comm_year']?>
+
viewArgs['sd_card_works']?>
+
viewArgs['interface']?>
+
viewArgs['sort-by']?>
+
+
+ + + +
+ .. +
+ + + + +
+ +
+ : +
+ + +
+
:
+
+
+ + +
+
:
+
+
+ +
+
:
+
+
+ +
+
:
+
+
+ +
+
+
+
+ + + +
+ + + +
+ : +
+ \ No newline at end of file diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index fb345a2..be8daba 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -122,6 +122,7 @@ class Route 'download,acquisitioncards', 'download,fingerprintreaders', 'download,ethernetcards', + 'download,sdcardreaders', 'history,hide', 'history,show', 'history,block', @@ -221,6 +222,15 @@ class Route 'ethernetcards,differences', 'ethernetcards,climb', 'ethernetcards,talk', + 'sdcardreaders,catalogue', + 'sdcardreaders,view', + 'sdcardreaders,history', + 'sdcardreaders,revision', + 'sdcardreaders,insert', + 'sdcardreaders,update', + 'sdcardreaders,differences', + 'sdcardreaders,climb', + 'sdcardreaders,talk', ); //it can be 'yes' or 'no' diff --git a/h-source/Public/Img/H2O/media-flash-sd-mmc.png b/h-source/Public/Img/H2O/media-flash-sd-mmc.png new file mode 100755 index 0000000..ff41fd8 Binary files /dev/null and b/h-source/Public/Img/H2O/media-flash-sd-mmc.png differ diff --git a/h-source/Public/Img/H2O/media-flash-sd-mmc_22.png b/h-source/Public/Img/H2O/media-flash-sd-mmc_22.png new file mode 100755 index 0000000..cd97b66 Binary files /dev/null and b/h-source/Public/Img/H2O/media-flash-sd-mmc_22.png differ diff --git a/h-source/tables.sql b/h-source/tables.sql index 194a799..59fee95 100644 --- a/h-source/tables.sql +++ b/h-source/tables.sql @@ -101,6 +101,7 @@ create table hardware ( bluetooth_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', fingerprint_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', ethernet-card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', + sd_card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', architecture char(15) not null default 'not-specified', other_names text CHARACTER SET utf8 not null )engine=innodb; @@ -133,7 +134,8 @@ create table revisions ( sound_card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', bluetooth_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', fingerprint_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', - ethernet-card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified' + ethernet-card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', + sd_card_works varchar(30) CHARACTER SET utf8 not null default 'not-specified', architecture char(15) not null default 'not-specified', other_names text CHARACTER SET utf8 not null, approved char(4) not null default 'yes', -- cgit v1.2.3