[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/ -> main.php (source)

   1  <?php
   2  /* vim: set expandtab tabstop=4 shiftwidth=4 encoding=utf-8: */
   3  // +----------------------------------------------------------------------+
   4  // | Eventum - Issue Tracking System                                      |
   5  // +----------------------------------------------------------------------+
   6  // | Copyright (c) 2003, 2004, 2005, 2006, 2007 MySQL AB                  |
   7  // |                                                                      |
   8  // | This program is free software; you can redistribute it and/or modify |
   9  // | it under the terms of the GNU General Public License as published by |
  10  // | the Free Software Foundation; either version 2 of the License, or    |
  11  // | (at your option) any later version.                                  |
  12  // |                                                                      |
  13  // | This program is distributed in the hope that it will be useful,      |
  14  // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  15  // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
  16  // | GNU General Public License for more details.                         |
  17  // |                                                                      |
  18  // | You should have received a copy of the GNU General Public License    |
  19  // | along with this program; if not, write to:                           |
  20  // |                                                                      |
  21  // | Free Software Foundation, Inc.                                       |
  22  // | 59 Temple Place - Suite 330                                          |
  23  // | Boston, MA 02111-1307, USA.                                          |
  24  // +----------------------------------------------------------------------+
  25  // | Authors: João Prado Maia <jpm@mysql.com>                             |
  26  // +----------------------------------------------------------------------+
  27  //
  28  // @(#) $Id: main.php 3384 2007-10-08 17:58:38Z glen $
  29  
  30  require_once(dirname(__FILE__) . "/init.php");
  31  require_once (APP_INC_PATH . "class.template.php");
  32  require_once (APP_INC_PATH . "class.auth.php");
  33  require_once (APP_INC_PATH . "class.user.php");
  34  require_once (APP_INC_PATH . "class.stats.php");
  35  require_once (APP_INC_PATH . "class.misc.php");
  36  require_once (APP_INC_PATH . "class.news.php");
  37  require_once (APP_INC_PATH . "db_access.php");
  38  require_once (APP_INC_PATH . "class.search_profile.php");
  39  
  40  $tpl = new Template_API();
  41  $tpl->setTemplate("main.tpl.html");
  42  
  43  Auth::checkAuthentication(APP_COOKIE);
  44  
  45  $prj_id = Auth::getCurrentProject();
  46  $role_id = Auth::getCurrentRole();
  47  $usr_id = Auth::getUserID();
  48  
  49  if ($role_id == User::getRoleID('customer')) {
  50      // need the activity dashboard here
  51      $customer_id = User::getCustomerID($usr_id);
  52      $tpl->assign("customer_stats", Customer::getOverallStats($prj_id, $customer_id));
  53      $tpl->assign("profile", Customer::getProfile($prj_id, $usr_id));
  54  } else {
  55      if ((Auth::getCurrentRole() <= User::getRoleID("Reporter")) && (Project::getSegregateReporters($prj_id))) {
  56          $tpl->assign('hide_stats', true);
  57      } else {
  58          $tpl->assign("status", Stats::getStatus());
  59          $tpl->assign("releases", Stats::getRelease());
  60          $tpl->assign("categories", Stats::getCategory());
  61          $tpl->assign("priorities", Stats::getPriority());
  62          $tpl->assign("users", Stats::getUser());
  63          $tpl->assign("emails", Stats::getEmailStatus());
  64          $tpl->assign("pie_chart", Stats::getPieChart());
  65      }
  66      $tpl->assign("random_tip", Misc::getRandomTip($tpl));
  67  }
  68  
  69  if  (@$_REQUEST['hide_closed'] == '') {
  70      $Stats_Search_Profile = Search_Profile::getProfile($usr_id, $prj_id, "stats");
  71  
  72      if (!empty($Stats_Search_Profile)) {
  73          $tpl->assign("hide_closed", $Stats_Search_Profile['hide_closed']);
  74      }
  75  } else {
  76      $tpl->assign("hide_closed", @$_REQUEST['hide_closed']);
  77      Search_Profile::save($usr_id, $prj_id, "stats", array('hide_closed' => @$_REQUEST['hide_closed']));
  78  }
  79  
  80  $tpl->assign("news", News::getListByProject($prj_id));
  81  
  82  $tpl->displayTemplate();


Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7