[ Index ] |
PHP Cross Reference of Eventum |
[Summary view] [Print] [Text view]
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: post.php 3258 2007-02-14 23:25:56Z 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.issue.php"); 33 require_once (APP_INC_PATH . "class.misc.php"); 34 require_once (APP_INC_PATH . "class.custom_field.php"); 35 require_once (APP_INC_PATH . "db_access.php"); 36 37 $tpl = new Template_API(); 38 $tpl->setTemplate("post.tpl.html"); 39 40 if (@$_POST["cat"] == "report") { 41 $res = Issue::addAnonymousReport(); 42 if ($res != -1) { 43 // show direct links to the issue page, issue listing page and email listing page 44 $tpl->assign("new_issue_id", $res); 45 } else { 46 // need to show everything again 47 $tpl->assign("error_msg", "1"); 48 } 49 } elseif (@$_GET["post_form"] == "yes") { 50 // only list those projects that are allowing anonymous reporting of new issues 51 $projects = Project::getAnonymousList(); 52 if (empty($projects)) { 53 $tpl->assign("no_projects", "1"); 54 } else { 55 if (!in_array($_GET["project"], array_keys($projects))) { 56 $tpl->assign("no_projects", "1"); 57 } else { 58 // get list of custom fields for the selected project 59 $options = Project::getAnonymousPostOptions($_GET["project"]); 60 if (@$options["show_custom_fields"] == "yes") { 61 $tpl->assign("custom_fields", Custom_Field::getListByProject($_GET["project"], 'anonymous_form')); 62 } 63 $tpl->assign("project_name", Project::getName($_GET["project"])); 64 } 65 } 66 } else { 67 // only list those projects that are allowing anonymous reporting of new issues 68 $projects = Project::getAnonymousList(); 69 if (empty($projects)) { 70 $tpl->assign("no_projects", "1"); 71 } else { 72 if (count($projects) == 1) { 73 $project_ids = array_keys($projects); 74 Auth::redirect('post.php?post_form=yes&project=' . $project_ids[0]); 75 } else { 76 $tpl->assign("projects", $projects); 77 } 78 } 79 } 80 81 $tpl->displayTemplate();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 19 21:21:33 2007 | Cross-referenced by PHPXref 0.7 |