* code for dropMenu.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-05 07:13:12 +00:00
parent d77747cd64
commit d4944de830
7 changed files with 3 additions and 94 deletions
-2
View File
@@ -60,8 +60,6 @@ $lang->fold = '-';
$lang->selectAll = 'All';
$lang->selectReverse = 'Inverse';
$lang->notFound = 'Sorry, the object not found.';
$lang->showAll = '[[Show all projects]]';
$lang->hideClosed = '[[Show projects going]]';
$lang->future = 'Future';
$lang->year = 'Year';
-2
View File
@@ -60,8 +60,6 @@ $lang->fold = '-';
$lang->selectAll = '全选';
$lang->selectReverse = '反选';
$lang->notFound = '抱歉,您访问的对象并不存在!';
$lang->showAll = '[[全部显示]]';
$lang->hideClosed = '[[显示进行中]]';
$lang->future = '未来';
$lang->year = '年';
+1 -1
View File
@@ -87,4 +87,4 @@ $lang->product->aclList['private'] = '私有产品(只有项目团队成员才
$lang->product->aclList['custom'] = '自定义白名单(团队成员和白名单的成员可以访问)';
$lang->product->storySummary = "本页共 <strong>%s</strong> 个需求,预计 <strong>%s</strong> 个工时。";
$lang->product->noMatchedProduct = '找不到与"%s"相关的产品';
$lang->product->noMatchedProduct = '找不到包含"%s"的产品';
-1
View File
@@ -145,7 +145,6 @@ class productModel extends model
public function getPairs($mode = '')
{
$orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed';
$mode .= $this->cookie->productMode;
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
+1 -1
View File
@@ -178,7 +178,7 @@ $lang->project->whyNoStories = "看起来没有需求可以关联。请检
$lang->project->doneProjects = '已结束';
$lang->project->unDoneProjects = '未结束';
$lang->project->copyTeam = '复制团队';
$lang->product->noMatchedProject = '找不到与"%s"相关的项目';
$lang->product->noMatchedProject = '找不到包含"%s"的项目';
/* 交互提示。*/
$lang->project->confirmDelete = '您确定删除项目[%s]吗?';
+1 -8
View File
@@ -89,12 +89,6 @@ class projectModel extends model
$moduleName = $this->app->getModuleName();
$methodName = $this->app->getMethodName();
if($this->cookie->projectMode == 'noclosed' and $project->status == 'done')
{
setcookie('projectMode', 'all');
$this->cookie->projectMode = 'all';
}
$selectHtml = $this->select($projects, $projectID, $moduleName, $methodName, $extra);
foreach($this->lang->project->menu as $key => $menu)
{
@@ -439,8 +433,7 @@ class projectModel extends model
*/
public function getPairs($mode = '')
{
$orderBy = !empty($this->config->project->orderBy) ? $this->config->project->orderBy : 'isDone, status';
$mode .= $this->cookie->projectMode;
$orderBy = !empty($this->config->project->orderBy) ? $this->config->project->orderBy : 'isDone, status';
/* Order by status's content whether or not done */
$projects = $this->dao->select('*, IF(INSTR(" done", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
->where('iscat')->eq(0)
-79
View File
@@ -103,26 +103,6 @@ function shortcut()
}
}
/**
* Set the product switcher
*
* @access public
* @return void
*/
function setProductSwitcher()
{
productMode = $.cookie('productMode');
if(!productMode) productMode = 'noclosed';
if(productMode == 'all')
{
$("#productID").append($("<option value='noclosed' id='switcher'>" + config.lblHideClosed + "</option>"));
}
else
{
$("#productID").append($("<option value='all' id='switcher'>" + config.lblShowAll + "</option>"));
}
}
/**
* Show drop menu.
*
@@ -227,63 +207,6 @@ function saveProduct()
if($('#productID')) $.cookie('lastProduct', $('#productID').val(), {expires:config.cookieLife, path:config.webRoot});
}
/**
* Set project switcher
*
* @access public
* @return void
*/
function setProjectSwitcher()
{
projectMode = $.cookie('projectMode');
if(!projectMode) projectMode = 'noclosed';
if(projectMode == 'all')
{
$("#projectID").append($("<option value='noclosed' id='switcher'>" + config.lblHideClosed + "</option>"));
}
else
{
$("#projectID").append($("<option value='all' id='switcher'>" + config.lblShowAll + "</option>"));
}
}
/**
* Swtich project.
*
* @param int $projectID
* @param string $module
* @param string $method
* @access public
* @return void
*/
function switchProject(projectID, module, method, extra)
{
/* The projec id is a string, use it as the project model. */
if(isNaN(projectID))
{
$.cookie('projectMode', projectID, {expires:config.cookieLife, path:config.webRoot});
projectID = 0;
}
/* Process task and build modules. */
if(module == 'task' && (method == 'view' || method == 'edit' || method == 'batchedit'))
{
module = 'project';
method = 'task';
}
if(module == 'build' && method == 'edit')
{
module = 'project';
method = 'build';
}
if(module == 'project' && method == 'create') return;
link = createLink(module, method, 'projectID=' + projectID);
if(extra != '') link = createLink(module, method, 'projectID=' + projectID + '&type=' + extra);
location.href = link;
}
/**
* Save the id of the project last visited.
*
@@ -881,8 +804,6 @@ $(document).ready(function()
setRequiredFields();
setPlaceholder();
setProductSwitcher();
setProjectSwitcher();
saveProduct();
saveProject();