[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/manage/ -> customize_listing.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: customize_listing.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.user.php");
  34  require_once (APP_INC_PATH . "class.project.php");
  35  require_once (APP_INC_PATH . "class.status.php");
  36  require_once (APP_INC_PATH . "db_access.php");
  37  
  38  $tpl = new Template_API();
  39  $tpl->setTemplate("manage/index.tpl.html");
  40  
  41  Auth::checkAuthentication(APP_COOKIE);
  42  
  43  $tpl->assign("type", "customize_listing");
  44  
  45  $role_id = Auth::getCurrentRole();
  46  if ($role_id == User::getRoleID('administrator')) {
  47      $tpl->assign("show_setup_links", true);
  48  
  49      if (@$_POST["cat"] == "new") {
  50          $tpl->assign("result", Status::insertCustomization($_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']));
  51      } elseif (@$_POST["cat"] == "update") {
  52          $tpl->assign("result", Status::updateCustomization($_POST['id'], $_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']));
  53      } elseif (@$_POST["cat"] == "delete") {
  54          Status::removeCustomization($_POST['items']);
  55      }
  56  
  57      if (@$_GET["cat"] == "edit") {
  58          $details = Status::getCustomizationDetails($_GET["id"]);
  59          $tpl->assign(array(
  60              "info"        => $details,
  61              'project_id'  => $details['psd_prj_id'],
  62              'status_list' => Status::getAssocStatusList($details['psd_prj_id'], TRUE)
  63          ));
  64      }
  65  
  66      $display_customer_fields = false;
  67      @$prj_id = $_POST["prj_id"] ? $_POST["prj_id"] : $_GET["prj_id"];
  68      if (!empty($prj_id)) {
  69          $tpl->assign("status_list", Status::getAssocStatusList($prj_id, TRUE));
  70          $tpl->assign('project_id', $prj_id);
  71          $display_customer_fields = Customer::hasCustomerIntegration($prj_id);
  72      }
  73  
  74      $tpl->assign("date_fields", Issue::getDateFieldsAssocList($display_customer_fields));
  75      $tpl->assign("project_list", Project::getAll());
  76      $tpl->assign("list", Status::getCustomizationList());
  77  } else {
  78      $tpl->assign("show_not_allowed_msg", true);
  79  }
  80  
  81  $tpl->displayTemplate();


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