[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/manage/ -> reminder_conditions.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: reminder_conditions.php 3206 2007-01-24 20:24:35Z glen $
  29  //
  30  require_once(dirname(__FILE__) . "/../init.php");
  31  require_once (APP_INC_PATH . "db_access.php");
  32  require_once (APP_INC_PATH . "class.template.php");
  33  require_once (APP_INC_PATH . "class.auth.php");
  34  require_once (APP_INC_PATH . "class.user.php");
  35  require_once (APP_INC_PATH . "class.status.php");
  36  require_once (APP_INC_PATH . "class.reminder.php");
  37  require_once (APP_INC_PATH . "class.reminder_action.php");
  38  
  39  $tpl = new Template_API();
  40  $tpl->setTemplate("manage/index.tpl.html");
  41  
  42  Auth::checkAuthentication(APP_COOKIE);
  43  
  44  $tpl->assign("type", "reminder_conditions");
  45  
  46  $rem_id = @$_POST['rem_id'] ? $_POST['rem_id'] : $_GET['rem_id'];
  47  $rma_id = @$_POST['rma_id'] ? $_POST['rma_id'] : $_GET['rma_id'];
  48  
  49  $role_id = Auth::getCurrentRole();
  50  if (($role_id == User::getRoleID('administrator')) || ($role_id == User::getRoleID('manager'))) {
  51      if ($role_id == User::getRoleID('administrator')) {
  52          $tpl->assign("show_setup_links", true);
  53      }
  54  
  55      if (@$_POST["cat"] == "new") {
  56          $tpl->assign("result", Reminder_Condition::insert());
  57      } elseif (@$_POST["cat"] == "update") {
  58          $tpl->assign("result", Reminder_Condition::update());
  59      } elseif (@$_POST["cat"] == "delete") {
  60          Reminder_Condition::remove();
  61      }
  62  
  63      if (@$_GET["cat"] == "edit") {
  64          $info = Reminder_Condition::getDetails($_GET["id"]);
  65          if (!empty($_GET['field'])) {
  66              $info['rlc_rmf_id'] = $_GET['field'];
  67          } else {
  68              $_GET['field'] = $info['rlc_rmf_id'];
  69          }
  70          $tpl->assign("info", $info);
  71          
  72      }
  73  
  74      if (!empty($_GET['field'])) {
  75          $field_title = Reminder_Condition::getFieldTitle($_GET['field']);
  76          if (Reminder_Condition::canFieldBeCompared($_GET['field'])) {
  77              $tpl->assign(array(
  78                  'show_field_options'    =>  'yes',
  79                  'comparable_fields'     =>  Reminder_Condition::getFieldAdminList(true)
  80              ));
  81          } elseif (strtolower($field_title) == 'status') {
  82              $prj_id = Reminder::getProjectID($rem_id);
  83              $tpl->assign(array(
  84                  'show_status_options' => 'yes',
  85                  'statuses'            => Status::getAssocStatusList($prj_id)
  86              ));
  87          } elseif (strtolower($field_title) == 'category') {
  88              $prj_id = Reminder::getProjectID($rem_id);
  89              $tpl->assign(array(
  90                  'show_category_options' => 'yes',
  91                  'categories'            => Category::getAssocList($prj_id)
  92              ));
  93          } else {
  94              $tpl->assign('show_status_options', 'no');
  95          }
  96          if (@$_GET["cat"] != "edit") {
  97              $tpl->assign('info', array(
  98                  'rlc_rmf_id' => $_GET['field'],
  99                  'rlc_rmo_id' => '',
 100                  'rlc_value'  => ''
 101              ));
 102          }
 103      }
 104  
 105      $tpl->assign("rem_id", $rem_id);
 106      $tpl->assign("rma_id", $rma_id);
 107      $tpl->assign("rem_title", Reminder::getTitle($rem_id));
 108      $tpl->assign("rma_title", Reminder_Action::getTitle($rma_id));
 109      $tpl->assign("fields", Reminder_Condition::getFieldAdminList());
 110      $tpl->assign("operators", Reminder_Condition::getOperatorAdminList());
 111      $tpl->assign("list", Reminder_Condition::getAdminList($rma_id));
 112  } else {
 113      $tpl->assign("show_not_allowed_msg", true);
 114  }
 115  
 116  $tpl->displayTemplate();


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