aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-05-21 17:02:31 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-05-21 17:02:31 +0000
commit6a4e5eee22fe3a2b69cdadbdf0cb7b210b6783c7 (patch)
treebcde13f1e29b40fd92e6ff75580b08ddeb6f66bd
parent759f536ae8a94ec5cce173fd00855aa39f0dbf3a (diff)
h-source:improved search, now also the other_names entry is considered
-rw-r--r--h-source/Application/Controllers/SearchController.php15
-rw-r--r--h-source/Application/Views/Search/results.php17
-rw-r--r--h-source/Application/Views/header.php4
-rw-r--r--h-source/Public/Css/explorer6.css112
-rw-r--r--h-source/Public/Css/main.css16
5 files changed, 37 insertions, 127 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index 9633a0e..9e7cb68 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -60,11 +60,18 @@ class SearchController extends BaseController
if (strcmp($this->viewArgs['action'],'search') === 0)
{
Params::$whereClauseSymbolArray = array('like');
+
+ $this->m['HardwareModel']->logicalOperators = array('AND','OR');
$whereClause = array(
- 'type' => $this->viewArgs['type'],
- 'model' => "like '%".$this->viewArgs['model']."%'",
- '-deleted' => "no",
+ 'type' => $this->viewArgs['type'],
+ 'level1' => array(
+ 'model' => "like '%".$this->viewArgs['model']."%'",
+ 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ ),
+// 'model' => "like '%".$this->viewArgs['model']."%'",
+// 'other_names' => "like '%".$this->viewArgs['model']."%'",
+ '-deleted' => "no",
);
$recordNumber = $this->m['HardwareModel']->clear()->where($whereClause)->orderBy("id_hard desc")->rowNumber();
@@ -77,7 +84,7 @@ class SearchController extends BaseController
//set the limit clause
$limit = $this->h['Pages']->getLimit($page,$recordNumber,10);
- $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
+ $data['table'] = $this->m['HardwareModel']->clear()->select('id_hard,model,type,comm_year,other_names')->where($whereClause)->limit($limit)->orderBy("id_hard desc")->send();
// echo $this->m['HardwareModel']->getQuery();
$data['pageList'] = $this->h['Pages']->render($page-3,7);
diff --git a/h-source/Application/Views/Search/results.php b/h-source/Application/Views/Search/results.php
index dfe0ab9..2bc14f4 100644
--- a/h-source/Application/Views/Search/results.php
+++ b/h-source/Application/Views/Search/results.php
@@ -38,14 +38,19 @@
?>
<div class="search_result_item">
- <div>
- <?php echo gtext("model name");?>: <b><a href="<?php echo $this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model']);?>"><?php echo $row['hardware']['model'];?></a></b>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("model name");?>:</div> <div class="search_result_item_right"><b><a href="<?php echo $this->baseUrl."/".MyStrings::$reverse[$row['hardware']['type']]."/view/$lang/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model']);?>"><?php echo $row['hardware']['model'];?></a></b></div>
</div>
- <div>
- <?php echo gtext("model type");?>: <b><?php echo $row['hardware']['type'];?></b>
+ <?php if ( strcmp($row['hardware']['other_names'],'') !== 0 ) { ?>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("possible other names of the device");?>:</div> <div class="search_result_item_right"><b><?php echo nl2br($row['hardware']['other_names']);?></b></div>
</div>
- <div>
- <?php echo gtext("year of commercialization");?>: <b><?php echo $row['hardware']['comm_year'];?></b>
+ <?php } ?>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("model type");?>: </div> <div class="search_result_item_right"><b><?php echo $row['hardware']['type'];?></b></div>
+ </div>
+ <div class="first_level">
+ <div class="search_result_item_left"><?php echo gtext("year of commercialization");?>: </div> <div class="search_result_item_right"><b><?php echo $row['hardware']['comm_year'];?></b></div>
</div>
</div>
diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php
index e86006b..5247659 100644
--- a/h-source/Application/Views/header.php
+++ b/h-source/Application/Views/header.php
@@ -36,10 +36,6 @@ $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index';
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl?>/Public/Css/main.css">
<link rel="Shortcut Icon" href="<?php echo $this->baseUrl?>/Public/Img/tab_icon_2.ico" type="image/x-icon">
- <!--[if IE 6]>
- <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Css/explorer6.css">
- <![endif]-->
-
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl;?>/Public/Css/explorer7.css">
<![endif]-->
diff --git a/h-source/Public/Css/explorer6.css b/h-source/Public/Css/explorer6.css
deleted file mode 100644
index 29b6456..0000000
--- a/h-source/Public/Css/explorer6.css
+++ /dev/null
@@ -1,112 +0,0 @@
-ul#menuBlock li {
- height:24px;
-}
-
-ul#menuBlock li ul {
- top:25px;
- margin-left:3px;
-}
-
-ul#menuBlock li ul li {
- margin-top:-1px;
-}
-
-.view_page_top_box
-{
- height:32px;
-}
-
-.update_submit_class
-{
- padding:7px;
-}
-
-.view_page_update_button
-{
- width:35px;
-}
-
-/*div that contains the update form*/
-.view_page_update_button
-{
- margin-top:2px;
- margin-right:5px;
-}
-.update_submit_class
-{
- padding:2px;
- width:45px;
-}
-.notebooks_insert_form
-{
- margin-right:-30px;
-}
-
-.notebook_insert_link
-{
- margin:0px 0px 0px 5px;
- padding-right:0px;
- width:245px;
-}
-.view_page_history_button
-{
- margin-left:10px;
-}
-.top_left_images_help
-{
- height:22px;
- margin-bottom:-3px;
-}
-ul#menuBlock li {
- height:26px;
-}
-ul#menuBlock li ul {
- left:-6px;
-}
-.user_logged
-{
- margin-left:62px;
-}
-.viewall_popup_menu_status_item
-{
- padding-left:2px;
-/* background:red; */
-}
-.copyright_notice_box
-{
- width:140px;
-}
-.language_links_box ul
-{
- width:100%;
- margin:-1px 5px 30px 5px;
-}
-.language_links_box ul li
-{
- margin-bottom:5px;
-}
-.language_links_box ul li a
-{
- height:30px;
-}
-.talk_numb_ext
-{
- margin-top:-30px;
-}
-.talk_numb_ext a, .talk_numb_ext_wiki a
-{
- margin-bottom:0px;
-}
-.talk_numb_ext_wiki
-{
- width:130px;
-}
-.language_links_box a.current_lang
-{
- background:#6495ED;
-}
-
-.last_modifications ul
-{
- margin-left:0px;
-} \ No newline at end of file
diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css
index da2c7b5..f2886e1 100644
--- a/h-source/Public/Css/main.css
+++ b/h-source/Public/Css/main.css
@@ -394,7 +394,7 @@ a.link_menu
/*executed operation string*/
.executed {
- font:bold 12px/1.5 sans-serif,,arial;
+ font:bold 12px/1.5 sans-serif,arial;
padding:5px;
margin:5px 5px 15px 5px;
background:#E0FFFF;
@@ -1145,7 +1145,21 @@ ins
border-top:1px solid #CECECE;
padding:5px 0px;
}
+.search_result_item .first_level
+{
+ overflow:hidden;
+}
+.search_result_item_left
+{
+ width:300px;
+ float:left;
+}
+.search_result_item_right
+{
+ width:400px;
+ float:left;
+}
.diff_color_notice
{
background:#f1d8d8;