aboutsummaryrefslogtreecommitdiff
path: root/h-source
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-02 14:29:55 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-02 14:29:55 +0000
commit10bbe357616c36e86ae3c3c7a26840b0c1973756 (patch)
treef0d588a10213ee9b91e12af0592112c1964e3755 /h-source
parent662e663843729d20aef25743f1d3f58adf6865b5 (diff)
improved search
Diffstat (limited to 'h-source')
-rw-r--r--h-source/Application/Controllers/SearchController.php19
-rw-r--r--h-source/Application/Include/hardware.php1
-rw-r--r--h-source/Application/Include/languages.php3
-rw-r--r--h-source/Application/Views/Search/lspci_results.php22
-rwxr-xr-xh-source/Public/Css/website.css5
5 files changed, 47 insertions, 3 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index 21b3a2e..a65ba62 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -236,6 +236,25 @@ class SearchController extends BaseController
}
$whereString = "'".implode("','",$vendorIDProductIDArray)."'";
$data['table'] = $this->m['HardwareModel']->select()->where(array('pci_id'=>"in($whereString)"))->send();
+
+ $foundPciidArray = $this->m['HardwareModel']
+ ->select('pci_id')
+ ->where(array('pci_id'=>"in($whereString)"))
+ ->toList('pci_id')
+ ->send();
+
+ $notFoundDevices = array();
+
+ foreach ($lspciFiltered as $device)
+ {
+ if (!in_array($device['vendorId'].":".$device['deviceId'],$foundPciidArray))
+ {
+ $notFoundDevices[] = $device;
+ }
+ }
+
+ $data['notFoundDevices'] = $notFoundDevices;
+
}
$this->append($data);
$this->cleverLoad('lspci_results');
diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php
index 11d12df..9d6fadc 100644
--- a/h-source/Application/Include/hardware.php
+++ b/h-source/Application/Include/hardware.php
@@ -26,6 +26,7 @@ class Hardware
public static $controllers = array('notebooks','wifi','videocards','printers','scanners','threegcards','soundcards'); //used by UsersController::login()
+ //classId => controller
public static $deviceClasses = array(
'0403' => 'soundcards',
'0280' => 'wifi',
diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php
index 0952da8..810fac1 100644
--- a/h-source/Application/Include/languages.php
+++ b/h-source/Application/Include/languages.php
@@ -151,6 +151,9 @@ class Lang
"the text submitted by you does not seem the lspci -vmmnn output. Please check the text and try again" => "il testo che hai inviato non sembra l'output del comando lspci -vmmnn. Per favore ricontrolla il testo e riprova",
"Search form" => "Form della ricerca",
"write here the output of lspci -vmmnn" => "scrivi qui l'output del comando lspci -vmmnn",
+ "The following devices has been found in the database" => "I seguenti device sono stati trovati nel database",
+ "yes" => "sì",
+ "The following devices has not been found in the database" => "I seguenti device non sono stati trovati nel database",
),
'es' => array
(
diff --git a/h-source/Application/Views/Search/lspci_results.php b/h-source/Application/Views/Search/lspci_results.php
index a23d505..57e728c 100644
--- a/h-source/Application/Views/Search/lspci_results.php
+++ b/h-source/Application/Views/Search/lspci_results.php
@@ -38,30 +38,46 @@
<a href="<?php echo $this->baseUrl."/search/form/$lang";?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a>
</div>
<?php } ?>
+
+ <?php if (count($table)>0) { ?>
+ <div class="search_item_found">
+ <?php echo gtext("The following devices has been found in the database");?>:
+ </div>
+ <?php }?>
<?php foreach ($table as $row) { ?>
<div class="lspci_item_found">
<div class="lspci_item_found_model">
- <img align="top" class="catalogue_item_icon" src="<?php echo MyStrings::getHardIcon($row['hardware']['type']);?>"> <span class="search_result_model_name"><?php echo "<b>".$row['hardware']['type']."</b> - ".$row['hardware']['model'];?></span>
+ <img align="top" class="catalogue_item_icon" src="<?php echo MyStrings::getHardIcon($row['hardware']['type']);?>"> <span class="search_result_model_name"><?php echo "<b>".$row['hardware']['type']."</b> - <a href='".$this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."'>".$row['hardware']['model']."</a>";?></span>
</div>
<div class="lspci_item_found_compat">
<?php
switch ($row['hardware']['type'])
{
case 'wifi':
- echo gtext("does it work with free software?"). " <b>".$row['hardware']['wifi_works']."</b>";
+ echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['wifi_works'])."</b>";
break;
case 'videocard':
echo gtext("does it work with free software?"). " <b>".gtext(Videocard::$videoReverse[$row['hardware']['video_card_works']])."</b>";
break;
case 'soundcard':
- echo gtext("does it work with free software?"). " <b>".$row['hardware']['sound_card_works']."</b>";
+ echo gtext("does it work with free software?"). " <b>".gtext($row['hardware']['sound_card_works'])."</b>";
break;
}
?>
</div>
</div>
<?php } ?>
+
+ <?php if (count($notFoundDevices)>0) { ?>
+ <div class="search_item_found">
+ <?php echo gtext("The following devices has not been found in the database");?>:
+ </div>
+ <?php }?>
+
+ <?php foreach ($notFoundDevices as $device) { ?>
+
+ <?php } ?>
</div>
diff --git a/h-source/Public/Css/website.css b/h-source/Public/Css/website.css
index 8f15343..5609d12 100755
--- a/h-source/Public/Css/website.css
+++ b/h-source/Public/Css/website.css
@@ -1580,4 +1580,9 @@ td.text_item_date
.search_result_model_name
{
padding-left:10px;
+}
+
+.search_item_found
+{
+ margin:5px;
} \ No newline at end of file