[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/reports/ -> stalled_issues.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: stalled_issues.php 3206 2007-01-24 20:24:35Z 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.report.php");
  34  require_once (APP_INC_PATH . "class.date.php");
  35  require_once (APP_INC_PATH . "db_access.php");
  36  
  37  $tpl = new Template_API();
  38  $tpl->setTemplate("reports/stalled_issues.tpl.html");
  39  
  40  Auth::checkAuthentication(APP_COOKIE);
  41  
  42  if ((Auth::getCurrentRole() <= User::getRoleID("Customer"))) {
  43      echo "Invalid role";
  44      exit;
  45  }
  46  
  47  $prj_id = Auth::getCurrentProject();
  48  
  49  if (count(@$_REQUEST['before']) < 1) {
  50      $before = date("Y-m-d", (time()-MONTH));
  51  } else {
  52      $before = join('-', $_REQUEST['before']);
  53  }
  54  if (count(@$_REQUEST['after']) < 1) {
  55      $after = date("Y-m-d", (time()-YEAR));
  56  } else {
  57      $after = join('-', $_REQUEST['after']);
  58  }
  59  if (empty($_REQUEST['sort_order'])) {
  60      $_REQUEST['sort_order'] = 'ASC';
  61  }
  62  
  63  $data = Report::getStalledIssuesByUser($prj_id, @$_REQUEST['developers'], @$_REQUEST['status'], $before, $after, $_REQUEST['sort_order']);
  64  
  65  $groups = Group::getAssocList($prj_id);
  66  $assign_options = array();
  67  if ((count($groups) > 0) && ( Auth::getCurrentRole() >User::getRoleID("Customer"))) {
  68      foreach ($groups as $grp_id => $grp_name) {
  69          $assign_options["grp:$grp_id"] = "Group: " . $grp_name;
  70      }
  71  }
  72  $assign_options += Project::getUserAssocList($prj_id, 'active', User::getRoleID('Standard User'));
  73  
  74  $tpl->assign(array(
  75      "users" =>  $assign_options,
  76      "before_date"   =>  $before,
  77      "after_date"   =>  $after,
  78      "data"  =>  $data,
  79      "developers"    => @$_REQUEST['developers'],
  80      "status_list"   =>  Status::getAssocStatusList($prj_id),
  81      "status"        =>  @$_REQUEST['status'],
  82      "sort_order"    =>  $_REQUEST['sort_order']
  83  ));
  84  
  85  $tpl->displayTemplate();


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