[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/manage/ -> general.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: general.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.project.php");
  34  require_once (APP_INC_PATH . "class.user.php");
  35  require_once (APP_INC_PATH . "class.setup.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", "general");
  44  
  45  $role_id = Auth::getCurrentRole();
  46  if ($role_id == User::getRoleID('administrator')) {
  47      $tpl->assign("show_setup_links", true);
  48  
  49      $tpl->assign("project_list", Project::getAll());
  50  
  51      if (@$_POST["cat"] == "update") {
  52          $setup = array();
  53          $setup["tool_caption"] = $_POST["tool_caption"];
  54          $setup["support_email"] = $_POST["support_email"];
  55          $setup["daily_tips"] = $_POST["daily_tips"];
  56          $setup["spell_checker"] = $_POST["spell_checker"];
  57          $setup["irc_notification"] = $_POST["irc_notification"];
  58          $setup["allow_unassigned_issues"] = $_POST["allow_unassigned_issues"];
  59          @$setup["update"] = $_POST["update"];
  60          @$setup["closed"] = $_POST["closed"];
  61          @$setup["notes"] = $_POST["notes"];
  62          @$setup["emails"] = $_POST["emails"];
  63          @$setup["files"] = $_POST["files"];
  64          @$setup["smtp"] = $_POST["smtp"];
  65          @$setup["scm_integration"] = $_POST["scm_integration"];
  66          @$setup["checkout_url"] = $_POST["checkout_url"];
  67          @$setup["diff_url"] = $_POST["diff_url"];
  68          @$setup["open_signup"] = $_POST["open_signup"];
  69          @$setup["accounts_projects"] = $_POST["accounts_projects"];
  70          @$setup["accounts_role"] = $_POST["accounts_role"];
  71          @$setup['subject_based_routing'] = $_POST['subject_based_routing'];
  72          @$setup['email_routing'] = $_POST['email_routing'];
  73          @$setup['note_routing'] = $_POST['note_routing'];
  74          @$setup['draft_routing'] = $_POST['draft_routing'];
  75          @$setup['email_error'] = $_POST['email_error'];
  76          @$setup['email_reminder'] = $_POST['email_reminder'];
  77          $options = Setup::load();
  78          @$setup['downloading_emails'] = $options['downloading_emails'];
  79          $res = Setup::save($setup);
  80          $tpl->assign("result", $res);
  81      }
  82      $options = Setup::load(true);
  83      $tpl->assign("setup", $options);
  84      $tpl->assign("user_roles", User::getRoles(array('Customer')));
  85  } else {
  86      $tpl->assign("show_not_allowed_msg", true);
  87  }
  88  
  89  $tpl->displayTemplate();


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