* finish task#1475.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-02 08:33:44 +00:00
parent 5f8bfb7743
commit 2d0b26df15
5 changed files with 39 additions and 17 deletions

View File

@@ -20,6 +20,9 @@ $lang->product->read = "Info";
$lang->product->delete = "Delete";
$lang->product->close = "Close";
$lang->product->select = '--select product--';
$lang->product->mine = 'I charge : ';
$lang->product->other = 'Other : ';
$lang->product->closed = 'Closed»';
$lang->product->basicInfo = 'Basic info';
$lang->product->otherInfo = 'Other info';

View File

@@ -20,6 +20,9 @@ $lang->product->read = "产品详情";
$lang->product->delete = "删除产品";
$lang->product->close = "关闭";
$lang->product->select = '--请选择产品--';
$lang->product->mine = '我负责:';
$lang->product->other = '其他:';
$lang->product->closed = '已关闭»';
$lang->product->basicInfo = '基本信息';
$lang->product->otherInfo = '其他信息';

View File

@@ -2,25 +2,35 @@
<?php js::set('module', $module);?>
<?php js::set('method', $method);?>
<?php js::set('extra', $extra);?>
<input type='text' id='search' value='' onkeyup='searchItems(this.value, "product", productID, module, method, extra)' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'>
<input type='text' class='gray' id='search' value='' onkeyup='searchItems(this.value, "product", productID, module, method, extra)' placeholder='<?php echo $this->app->loadLang('search')->search->common;?>'>
<div id='searchResult'>
<div id='defaultMenu' class='f-left'>
<ul>
<?php
foreach($products as $product)
{
$isOwner = $product->PO == $this->app->user->account or $product->QD == $this->app->user->account or $product->RD == $this->app->user->account;
if($product->status == 'normal' and $isOwner) echo "<li>" . html::a(sprintf($link, $product->id), $product->name). "</li>";
}
foreach($products as $product)
{
$isOwner = $product->PO == $this->app->user->account or $product->QD == $this->app->user->account or $product->RD == $this->app->user->account;
if($product->status == 'normal' and !$isOwner) echo "<li>" . html::a(sprintf($link, $product->id), $product->name). "</li>";
}
$i = 0;
foreach($products as $product)
{
if($product->status == 'normal' and $product->PO == $this->app->user->account)
{
if(!$i) echo "<span class='black'>{$lang->product->mine}</span>";
echo "<li>" . html::a(sprintf($link, $product->id), $product->name, '', "class='mine'"). "</li>";
$i++;
}
}
if($i) echo "<span class='black'>{$lang->product->other}</span>";
$class = $i ? "class='other'" : '';
foreach($products as $product)
{
if($product->status == 'normal' and !($product->PO == $this->app->user->account))
{
echo "<li>" . html::a(sprintf($link, $product->id), $product->name, '', "$class"). "</li>";
}
}
?>
</ul>
<div class='a-right'><a id='more' onClick='showMore()'><?php echo $lang->more;?>&raquo;</a></div>
<div class='a-right'><a class='gray' id='more' onClick='switchMore()'><?php echo $lang->product->closed;?></a></div>
</div>
<div id='moreMenu' class='hidden f-left'>
@@ -28,7 +38,7 @@
<?php
foreach($products as $product)
{
if($product->status == 'closed') echo "<li>" . html::a(sprintf($link, $product->id), $product->name). "</li>";
if($product->status == 'closed') echo "<li>" . html::a(sprintf($link, $product->id), $product->name, '', "class='closed'"). "</li>";
}
?>
</ul>

View File

@@ -138,6 +138,8 @@ var showMenu = 0; //Showing or hiding drop menu.
function showDropMenu(objectType, objectID, module, method, extra)
{
if(showMenu == 1) { showMenu = 0; return $("#dropMenu").hide();};
$('#wrap').click(function(){return $("#dropMenu").hide();});
$.get(createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data);});
var offset = $('#currentItem').offset();
$("#dropMenu").css({ top:offset.top + $('#currentItem').height() + "px", left:offset.left });
@@ -172,14 +174,14 @@ function searchItems(keywords, objectType, objectID, module, method, extra)
}
/**
* Show more items.
* Show or hide more items.
*
* @access public
* @return void
*/
function showMore()
function switchMore()
{
$('#moreMenu').removeClass('hidden');
$('#moreMenu').toggle(0, function(){$('#moreMenu').css('width', $('#defaultMenu').width())});
$('#search').focus();
}

View File

@@ -260,6 +260,7 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table
/*-----------------------COLOR SETTING----------------------------*/
.white {color:white;}
.black {color:black;}
.red {color:red;}
.blue {color:blue}
.yellow {color:yellow;}
@@ -323,8 +324,11 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table
#dropMenu, #dropMenu ul {background:#f1f1f1; height:auto}
#dropMenu ul {line-height:24px; max-height:320px; overflow-y:auto}
#dropMenu li {float:none;}
#dropMenu li {float:none; padding-left:12px}
#dropMenu, #dropMenu li {text-align: left}
#dropMenu li a:hover {font-weight: bold}
#dropMenu li a.mine {color:#1a59b6}
#dropMenu li a.other, #dropMenu li a.closed, #dropMenu #more{color:gray; font-size:12px}
#projectID {background:#e5e5e5; border:1px solid #e5e5e5}