[ 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: popup.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.misc.php"); 33 require_once (APP_INC_PATH . "class.auth.php"); 34 require_once (APP_INC_PATH . "class.note.php"); 35 require_once (APP_INC_PATH . "class.time_tracking.php"); 36 require_once (APP_INC_PATH . "class.issue.php"); 37 require_once (APP_INC_PATH . "class.impact_analysis.php"); 38 require_once (APP_INC_PATH . "class.filter.php"); 39 require_once (APP_INC_PATH . "class.support.php"); 40 require_once (APP_INC_PATH . "class.attachment.php"); 41 require_once (APP_INC_PATH . "class.scm.php"); 42 require_once (APP_INC_PATH . "class.notification.php"); 43 require_once (APP_INC_PATH . "class.phone_support.php"); 44 require_once (APP_INC_PATH . "class.status.php"); 45 require_once (APP_INC_PATH . "class.history.php"); 46 require_once (APP_INC_PATH . "class.user.php"); 47 require_once (APP_INC_PATH . "class.authorized_replier.php"); 48 require_once (APP_INC_PATH . "db_access.php"); 49 50 $tpl = new Template_API(); 51 $tpl->setTemplate("popup.tpl.html"); 52 53 Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true); 54 $usr_id = Auth::getUserID(); 55 $prj_id = Auth::getCurrentProject(); 56 57 if (@$_GET["cat"] == "delete_note") { 58 $res = Note::remove($_GET["id"]); 59 $tpl->assign("note_delete_result", $res); 60 } elseif (@$_GET["cat"] == "delete_time") { 61 $res = Time_Tracking::removeEntry($_GET["id"], $usr_id); 62 $tpl->assign("time_delete_result", $res); 63 } elseif (@$_POST["cat"] == "bulk_update") { 64 $res = Issue::bulkUpdate(); 65 $tpl->assign("bulk_update_result", $res); 66 } elseif (@$_POST["cat"] == "set_initial_impact") { 67 $res = Issue::setImpactAnalysis($_POST["issue_id"]); 68 $tpl->assign("set_initial_impact_result", $res); 69 } elseif (@$_POST["cat"] == "add_requirement") { 70 $res = Impact_Analysis::insert($_POST["issue_id"]); 71 $tpl->assign("add_requirement_result", $res); 72 } elseif (@$_POST["cat"] == "set_impact_requirement") { 73 $res = Impact_Analysis::update($_POST["isr_id"]); 74 $tpl->assign("set_impact_requirement_result", $res); 75 } elseif (@$_POST["cat"] == "delete_requirement") { 76 $res = Impact_Analysis::remove(); 77 $tpl->assign("requirement_delete_result", $res); 78 } elseif (@$_POST["cat"] == "save_filter") { 79 $res = Filter::save(); 80 $tpl->assign("save_filter_result", $res); 81 } elseif (@$_POST["cat"] == "delete_filter") { 82 $res = Filter::remove(); 83 $tpl->assign("delete_filter_result", $res); 84 } elseif (@$_POST["cat"] == "remove_support_email") { 85 $res = Support::removeAssociation(); 86 $tpl->assign("remove_association_result", $res); 87 } elseif (@$_GET["cat"] == "delete_attachment") { 88 $res = Attachment::remove($_GET["id"]); 89 $tpl->assign("remove_attachment_result", $res); 90 } elseif (@$_GET["cat"] == "delete_file") { 91 $res = Attachment::removeIndividualFile($_GET["id"]); 92 $tpl->assign("remove_file_result", $res); 93 } elseif (@$_POST["cat"] == "remove_checkin") { 94 $res = SCM::remove(); 95 $tpl->assign("remove_checkin_result", $res); 96 } elseif (@$_GET['cat'] == 'unassign') { 97 $res = Issue::deleteUserAssociation($_GET["iss_id"], $usr_id); 98 Workflow::handleAssignmentChange($prj_id, $_GET["iss_id"], Auth::getUserID(), Issue::getDetails($_GET["iss_id"]), Issue::getAssignedUserIDs($_GET["iss_id"])); 99 $tpl->assign('unassign_result', $res); 100 } elseif (@$_POST["cat"] == "remove_email") { 101 $res = Support::removeEmails(); 102 $tpl->assign("remove_email_result", $res); 103 } elseif (@$_GET["cat"] == "clear_duplicate") { 104 $res = Issue::clearDuplicateStatus($_GET["iss_id"]); 105 $tpl->assign("clear_duplicate_result", $res); 106 } elseif (@$_GET["cat"] == "delete_phone") { 107 $res = Phone_Support::remove($_GET["id"]); 108 $tpl->assign("delete_phone_result", $res); 109 } elseif (@$_GET["cat"] == "new_status") { 110 // XXX: need to call the workflow api in the following function? 111 $res = Issue::setStatus($_GET["iss_id"], $_GET["new_sta_id"], true); 112 if ($res == 1) { 113 History::add($_GET["iss_id"], $usr_id, History::getTypeID('status_changed'), 114 "Issue manually set to status '" . Status::getStatusTitle($_GET["new_sta_id"]) . "' by " . User::getFullName($usr_id)); 115 } 116 $tpl->assign("new_status_result", $res); 117 } elseif (@$_GET['cat'] == 'authorize_reply') { 118 $res = Authorized_Replier::addUser($_GET["iss_id"], $usr_id); 119 $tpl->assign('authorize_reply_result', $res); 120 } elseif (@$_GET['cat'] == 'remove_quarantine') { 121 if (Auth::getCurrentRole() > User::getRoleID('Developer')) { 122 $res = Issue::setQuarantine($_GET['iss_id'], 0); 123 $tpl->assign('remove_quarantine_result', $res); 124 } 125 } 126 127 $tpl->assign("current_user_prefs", Prefs::get($usr_id)); 128 129 $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 |