From 3f18a25b33df582ecebf6cfaf043c6cc5939ec7c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 25 Dec 2010 22:25:45 +0000 Subject: added the subtype entry (laser,inkjet,..) for printers --- h-source/Application/Controllers/PrintersController.php | 4 +++- h-source/Application/Include/hardware.php | 2 ++ h-source/Application/Models/PrintersModel.php | 1 + h-source/Application/Views/Printers/form.php | 5 +++++ h-source/Application/Views/Printers/page.php | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/h-source/Application/Controllers/PrintersController.php b/h-source/Application/Controllers/PrintersController.php index 6521e1b..8353809 100644 --- a/h-source/Application/Controllers/PrintersController.php +++ b/h-source/Application/Controllers/PrintersController.php @@ -51,6 +51,7 @@ class PrintersController extends GenericController "+checkIsStrings|".Printer::compatibilityList() => "compatibility", "++checkIsStrings|".Printer::$commYear => "comm_year", "+++checkIsStrings|".Printer::$interface => "interface", + "++++checkIsStrings|".Printer::$subtype => "subtype", ); $this->m['HardwareModel']->strongConditions['insert'] = array( @@ -62,6 +63,7 @@ class PrintersController extends GenericController "+checkIsStrings|".Printer::compatibilityList() => "compatibility", "++checkIsStrings|".Printer::$commYear => "comm_year", "+++checkIsStrings|".Printer::$interface => "interface", + "++++checkIsStrings|".Printer::$subtype => "subtype", ); $this->m['HardwareModel']->softConditions['update'] = array( @@ -82,7 +84,7 @@ class PrintersController extends GenericController "++checkMatch|/^[a-zA-Z0-9\-\_\.\+\s\/\,\:\;\(\)\[\]]+$/" => "driver|only the following characters are allowed for the driver entry: a-z A-Z 0-9 - _ . + s / , : ; ( ) [ ]", ); - $this->m['HardwareModel']->setFields('vendor,model,kernel,description,compatibility,distribution,comm_year,pci_id,driver,interface','sanitizeAll'); + $this->m['HardwareModel']->setFields('vendor,model,kernel,description,compatibility,distribution,comm_year,pci_id,driver,interface,subtype','sanitizeAll'); $argKeys = array( 'page:forceNat' => 1, diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index 9879d14..c6d930e 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -55,6 +55,8 @@ class Printer extends hardware public static $interface = "not-specified,USB,Serial,Parallel,Firewire,SCSI,Ethernet"; + public static $subtype = "not-specified,laser,inkjet,other"; + public static function vendorsList() { return implode(',',array_values(self::$vendors)); diff --git a/h-source/Application/Models/PrintersModel.php b/h-source/Application/Models/PrintersModel.php index 8606201..af86980 100644 --- a/h-source/Application/Models/PrintersModel.php +++ b/h-source/Application/Models/PrintersModel.php @@ -52,6 +52,7 @@ class PrintersModel extends BaseModel $this->diffFields = array( 'vendor' => gtext("vendor"), 'model' => gtext('model name'), + 'subtype' => gtext('subtype')." (laser, inkjet, ..)", 'pci_id' => gtext("VendorID:ProductID code of the device"), 'comm_year' => gtext('year of commercialization'), 'interface' => gtext("interface"), diff --git a/h-source/Application/Views/Printers/form.php b/h-source/Application/Views/Printers/form.php index ef29cf6..aafb747 100644 --- a/h-source/Application/Views/Printers/form.php +++ b/h-source/Application/Views/Printers/form.php @@ -50,6 +50,11 @@ +
+ + +
+
diff --git a/h-source/Application/Views/Printers/page.php b/h-source/Application/Views/Printers/page.php index f3e2ec4..a84a695 100644 --- a/h-source/Application/Views/Printers/page.php +++ b/h-source/Application/Views/Printers/page.php @@ -48,6 +48,11 @@
+
+
(laser, inkjet, ..):
+
+
+
:
-- cgit v1.2.3