From 64fbca4467ef44081b680955592428da35b40a9a Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 26 Apr 2012 05:32:06 +0000 Subject: added RAID adapter category, part 1 - rsandu issue --- .../Application/Controllers/DownloadController.php | 6 +- .../Controllers/RaidadaptersController.php | 131 +++++++++++++++++++++ h-source/Application/Include/hardware.php | 26 ++-- h-source/Application/Include/languages.php | 15 +++ h-source/Application/Models/RaidadaptersModel.php | 68 +++++++++++ .../Application/Views/Desktop/Download/index.php | 4 + .../Application/Views/Desktop/Hardware/left.php | 4 + h-source/Config/Route.php | 10 ++ 8 files changed, 246 insertions(+), 18 deletions(-) create mode 100644 h-source/Application/Controllers/RaidadaptersController.php create mode 100644 h-source/Application/Models/RaidadaptersModel.php (limited to 'h-source') diff --git a/h-source/Application/Controllers/DownloadController.php b/h-source/Application/Controllers/DownloadController.php index 5fa11b2..7994329 100644 --- a/h-source/Application/Controllers/DownloadController.php +++ b/h-source/Application/Controllers/DownloadController.php @@ -136,7 +136,7 @@ class DownloadController extends BaseController $xml .= "\t\t".$row['hardware']['video_card_works']."\n"; } - if ($type === 'acquisition-card' or $type === 'modem') + if ($type === 'acquisition-card' or $type === 'modem' or $type === 'RAID-adapter') { $xml .= "\t\t".$row['hardware']['compatibility']."\n"; } @@ -262,4 +262,8 @@ class DownloadController extends BaseController $this->printXml($lang, array('type'=>'modem','-deleted'=>'no')); } + public function raidadapters($lang = 'en') + { + $this->printXml($lang, array('type'=>'RAID-adapter','-deleted'=>'no')); + } } \ No newline at end of file diff --git a/h-source/Application/Controllers/RaidadaptersController.php b/h-source/Application/Controllers/RaidadaptersController.php new file mode 100644 index 0000000..37bbad1 --- /dev/null +++ b/h-source/Application/Controllers/RaidadaptersController.php @@ -0,0 +1,131 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class RaidadaptersController extends GenericController +{ + + public function __construct($model, $controller, $queryString) + { + + $worksOptions = Raidadapters::$select; + $worksField = 'compatibility'; + $interfaceOptions = Raidadapters::$interface; + + parent::__construct($model, $controller, $queryString); + + //load the model + $this->model('HardwareModel'); + $this->model('RevisionsModel'); + $this->model('RaidadaptersModel'); + $this->model('TalkModel'); + + $this->mod = $this->m['RaidadaptersModel']; + + $this->m['HardwareModel']->id_user = $this->s['registered']->status['id_user']; + $this->m['HardwareModel']->type = 'RAID-adapter'; + + $this->m['HardwareModel']->setConditions($worksOptions,$worksField,$interfaceOptions); + + $this->m['HardwareModel']->setFields('model,kernel,description,distribution,comm_year,compatibility,pci_id,interface,driver,other_names','sanitizeAll'); + + $argKeys = array( + 'page:forceNat' => 1, + 'history_page:forceNat' => 1, + 'vendor:sanitizeString' => 'undef', + 'comm_year:sanitizeString' => 'undef', + 'compatibility:sanitizeString' => 'undef', + 'interface:sanitizeString' => 'undef', + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' + ); + + $this->setArgKeys($argKeys); + + $data['title'] = 'Acquisition cards'; + + $data['intefaceOptions'] = $interfaceOptions; + $data['worksOptions'] = $worksOptions; + $data['worksField'] = $worksField; + + $data['notFoundString'] = "No RAID adapter found"; + + $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'], + 'compatibility' => $this->viewArgs['compatibility'], + '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 bc25ff7..9fa218b 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -80,6 +80,7 @@ class Hardware 'ethernet-card' => 'H2O/network-wired_22.png', 'sd-card-reader' => 'H2O/media-flash-sd-mmc_22.png', 'modem' => 'Crystal/modem_22.png', + 'RAID-adapter' => 'Crystal/modem_22.png', ); public static $typeToController = array( @@ -97,6 +98,7 @@ class Hardware 'ethernet-card' => 'ethernetcards', 'sd-card-reader' => 'sdcardreaders', 'modem' => 'modems', + 'RAID-adapter' => 'raidadapters', ); public static function getTypes() @@ -430,37 +432,27 @@ class Acquisitioncards extends Hardware } -class Fingerprintreaders extends Hardware +class Fingerprintreaders extends Acquisitioncards { - 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 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 +class Sdcardreaders extends Acquisitioncards { - 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 Modems extends Hardware +class Modems extends Acquisitioncards { - 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 Raidadapters extends Acquisitioncards +{ -} \ No newline at end of file +} diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 0805b09..2e0c5b0 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -379,6 +379,9 @@ class Lang /*0319*/"contact us" => "contattaci", /*0320*/"credits" => "crediti", /*0321*/"desktop version" => "versione desktop", + /*0322*/"RAID adapters" => "Adattatori RAID", + /*0323*/"No RAID adapter found" => "Nessun adattatore RAID è stato trovato", + "Download the xml file of all the RAID adapters in the database" => "Scarica il file xml di tutti gli adattatori RAID presenti nel database", ), 'es' => array ( @@ -1560,6 +1563,7 @@ class Lang /*12*/'ethernetcards' => 'ethernet card', /*13*/'sdcardreaders' => 'sd card reader', /*14*/'modems' => 'modem', + /*15*/'raidadapters' => 'RAID adapter', ), 'it' => array( 'notebooks' => 'notebook', @@ -1576,6 +1580,7 @@ class Lang 'ethernetcards' => 'scheda ethernet', 'sdcardreaders' => 'lettore di schede sd', 'modems' => 'modem', + 'raidadapters' => 'adattatore RAID', ), 'es' => array( 'notebooks' => 'portátil', @@ -1592,6 +1597,7 @@ class Lang 'ethernetcards' => 'tarjeta de ethernet', 'sdcardreaders' => 'lector de tarjetas sd', 'modems' => 'modem', + 'raidadapters' => 'RAID adapter', ), 'fr' => array( 'notebooks' => 'notebook', @@ -1608,6 +1614,7 @@ class Lang 'ethernetcards' => 'carte ethernet', 'sdcardreaders' => 'lecteur de carte SD', 'modem' => 'modem', + 'raidadapters' => 'RAID adapter', ), 'de' => array( 'notebooks' => 'notebook', @@ -1624,6 +1631,7 @@ class Lang 'ethernetcards' => 'ethernet card', 'sdcardreaders' => 'sd card reader', 'modems' => 'modem', + 'raidadapters' => 'RAID adapter', ), 'gr' => array( /*01*/'notebooks' => 'Υπο-φορητοί υπολογιστές', @@ -1640,6 +1648,7 @@ class Lang /*12*/'ethernetcards' => 'Κάρτες ethernet', /*13*/'sdcardreaders' => 'Συσκευές ανάγνωσης καρτών sd', /*14*/'modems' => 'Συσκευές modem', + /*15*/'raidadapters' => 'RAID adapter', ), ); @@ -1659,6 +1668,7 @@ class Lang /*12*/'ethernetcards' => 'ethernet cards', /*13*/'sdcardreaders' => 'sd card readers', /*14*/'modems' => 'modems', + /*15*/'raidadapters' => 'RAID adapters', ), 'it' => array( /*01*/'notebooks' => 'notebook', @@ -1675,6 +1685,7 @@ class Lang /*12*/'ethernetcards' => 'schede ethernet', /*13*/'sdcardreaders' => 'lettori di schede sd', /*14*/'modems' => 'modem', + /*15*/'raidadapters' => 'adattatori RAID', ), 'es' => array( /*01*/'notebooks' => 'portátiles', @@ -1691,6 +1702,7 @@ class Lang /*12*/'ethernetcards' => 'tarjetas de ethernet', /*13*/'sdcardreaders' => 'lectores de tarjetas sd', /*14*/'modems' => 'modems', + /*15*/'raidadapters' => 'RAID adapters', ), 'fr' => array( /*01*/'notebooks' => 'notebooks', @@ -1707,6 +1719,7 @@ class Lang /*12*/'ethernetcards' => 'cartes ethernet', /*13*/'sdcardreaders' => 'lecteurs de cartes SD', /*14*/'modems' => 'modems', + /*15*/'raidadapters' => 'RAID adapters', ), 'de' => array( /*01*/'notebooks' => 'notebooks', @@ -1723,6 +1736,7 @@ class Lang /*12*/'ethernetcards' => 'ethernet cards', /*13*/'sdcardreaders' => 'sd card readers', /*14*/'modems' => 'modems', + /*15*/'raidadapters' => 'RAID adapters', ), 'gr' => array( /*01*/'notebooks' => 'Υπο-φορητοί υπολογιστές', @@ -1739,6 +1753,7 @@ class Lang /*12*/'ethernetcards' => 'Κάρτες ethernet', /*13*/'sdcardreaders' => 'Συσκευές ανάγνωσης καρτών sd', /*14*/'modems' => 'Συσκευές modem', + /*15*/'raidadapters' => 'RAID adapters', ), ); diff --git a/h-source/Application/Models/RaidadaptersModel.php b/h-source/Application/Models/RaidadaptersModel.php new file mode 100644 index 0000000..2e140e8 --- /dev/null +++ b/h-source/Application/Models/RaidadaptersModel.php @@ -0,0 +1,68 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class RaidadaptersModel extends GenericModel +{ + + public $type = 'RAID-adapter'; //device type + + public function __construct() + { + + $this->_popupItemNames = array( + 'vendor' => 'vendor', + 'comm_year' => 'comm_year', + 'compatibility' => 'compatibility', + 'interface' => 'interface', + ); + + $this->_popupLabels = array( + 'vendor' => gtext("vendor"), + 'comm_year' => gtext("year"), + 'compatibility' => gtext("does it work?"), + 'interface' => gtext("interface"), + ); + + $this->setPopupFunctions(); + + $this->createPopupWhere('vendor,compatibility,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'), + 'compatibility' => 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/Desktop/Download/index.php b/h-source/Application/Views/Desktop/Download/index.php index 1275d63..1ceca5a 100644 --- a/h-source/Application/Views/Desktop/Download/index.php +++ b/h-source/Application/Views/Desktop/Download/index.php @@ -97,6 +97,10 @@ modems in the database");?> "> + + RAID adapters in the database");?> + "> + diff --git a/h-source/Application/Views/Desktop/Hardware/left.php b/h-source/Application/Views/Desktop/Hardware/left.php index ece6e32..73e9b4a 100644 --- a/h-source/Application/Views/Desktop/Hardware/left.php +++ b/h-source/Application/Views/Desktop/Hardware/left.php @@ -81,4 +81,8 @@
+ +
+ +
\ No newline at end of file diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index 4b12f1a..3f71dcc 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -125,6 +125,7 @@ class Route 'download,ethernetcards', 'download,sdcardreaders', 'download,modems', + 'download,raidadapters', 'history,hide', 'history,show', 'history,block', @@ -245,6 +246,15 @@ class Route 'modems,differences', 'modems,climb', 'modems,talk', + 'raidadapters,catalogue', + 'raidadapters,view', + 'raidadapters,history', + 'raidadapters,revision', + 'raidadapters,insert', + 'raidadapters,update', + 'raidadapters,differences', + 'raidadapters,climb', + 'raidadapters,talk', ); //it can be 'yes' or 'no' -- cgit v1.2.3