From debef05d3765a45c07623f9b9a308f8cd3d0d6f7 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 30 Jun 2011 08:04:02 +0000 Subject: [PATCH] * when print dynamic, check the priviledge. --- module/my/control.php | 2 +- module/my/view/blockdynamic.html.php | 6 ++++++ module/my/view/blockproducts.html.php | 8 ++++---- module/my/view/blockprojects.html.php | 10 +++++----- module/my/view/index.html.php | 8 ++++---- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 0a6ed6a6b9..5ff1a77d88 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -40,7 +40,7 @@ class my extends control $productStats = $this->loadModel('product')->getStats($this->config->my->productCounts); /* Set the dynamic pager. */ - $maxCounts = max(count($projectStats['projects']), count($productStats['products'])); // Get the max counts of projects and products, thus to get more dynamics to keep smae high. + $maxCounts = max(count($projectStats['charts']), count($productStats['charts'])); // Get the max counts of projects and products, thus to get more dynamics to keep smae high. $this->app->loadClass('pager', true); $pager = new pager(0, $this->config->my->dynamicCounts + $maxCounts); diff --git a/module/my/view/blockdynamic.html.php b/module/my/view/blockdynamic.html.php index 246a0bfb4b..8d6b88a0c5 100644 --- a/module/my/view/blockdynamic.html.php +++ b/module/my/view/blockdynamic.html.php @@ -7,6 +7,12 @@ product == 0 and $action->project == 0) $canView = true; + if(isset($productStats['products'][$action->product]) or isset($projectStats['projects'][$action->project])) $canView = true; + + if(!$canView) continue; $user = isset($users[$action->actor]) ? $users[$action->actor] : $action->actor; if($action->action == 'login' or $action->action == 'logout') $action->objectName = ''; echo ""; diff --git a/module/my/view/blockproducts.html.php b/module/my/view/blockproducts.html.php index ad7a312102..9194a787e3 100644 --- a/module/my/view/blockproducts.html.php +++ b/module/my/view/blockproducts.html.php @@ -15,12 +15,12 @@
- $product):?> -

my->home->products . $lang->colon . $product->name;?>

+ $chart):?> +

my->home->products . $lang->colon . $productStats['products'][$productID]->name;?>

id]; - echo html::a($this->createLink('product', 'browse', "productID=$product->id"), $lang->my->home->productHome); + echo $chart; + echo html::a($this->createLink('product', 'browse', "productID=$productID"), $lang->my->home->productHome); ?>
diff --git a/module/my/view/blockprojects.html.php b/module/my/view/blockprojects.html.php index 5299a80574..f2a4371100 100644 --- a/module/my/view/blockprojects.html.php +++ b/module/my/view/blockprojects.html.php @@ -10,13 +10,13 @@
- $project):?> -

my->home->projects . $lang->colon . $project->name;?>

+ $chart):?> +

my->home->projects . $lang->colon . $projectStats['projects'][$projectID]->name;?>

id]; - echo html::a($this->createLink('project', 'browse', "projectid=$project->id"), $lang->my->home->projectHome); - common::printLink('project', 'burn', "projectID=$project->id", $lang->project->largeBurnChart); + echo $chart; + echo html::a($this->createLink('project', 'browse', "projectid=$projectID"), $lang->my->home->projectHome); + common::printLink('project', 'burn', "projectID=$projectID", $lang->project->largeBurnChart); common::printLink('project', 'computeBurn', 'reload=yes', $lang->project->computeBurn, 'hiddenwin'); printf($lang->project->howToUpdateBurn, $this->createLink('help', 'field', 'module=project&method-burn&field=updateburn')); ?> diff --git a/module/my/view/index.html.php b/module/my/view/index.html.php index 3c700a344e..aaba27df62 100644 --- a/module/my/view/index.html.php +++ b/module/my/view/index.html.php @@ -27,9 +27,9 @@