00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: download.php 4969 2005-11-15 10:32:43Z yeupou $
00006 #
00007 # Copyright 2005 (c) Mathieu Roy <yeupou--gnu.org>
00008 #
00009 #
00010 # The Savane project is free software; you can redistribute it and/or
00011 # modify it under the terms of the GNU General Public License
00012 # as published by the Free Software Foundation; either version 2
00013 # of the License, or (at your option) any later version.
00014 #
00015 # The Savane project is distributed in the hope that it will be useful,
00016 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018 # GNU General Public License for more details.
00019 #
00020 # You should have received a copy of the GNU General Public License
00021 # along with the Savane project; if not, write to the Free Software
00022 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00023
00024 register_globals_off();
00025
00026 # We need to do this step in a page separated from the export.php page because
00027 # ARTIFACT must be set to task
00028
00029 if (!$group_id)
00030 { exit_no_group(); }
00031
00032 $project=project_get_object($group_id);
00033
00034 if (!member_check(0, $group_id))
00035 {
00036 exit_error(_("Data Export is currently restricted to projects members"));
00037 }
00038
00039 $from = sane_get("from");
00040 $export_id = sane_get("export_id");
00041 $task_id = sane_get("task_id");
00042
00043 if (!$from || !$export_id || !$task_id)
00044 {
00045 exit_missing_param();
00046 }
00047
00048
00049 $changes = array();
00050 # Post a comment on the relevant task
00051 $comment = "Job removed per request of his owner, ".user_getrealname()."
00052
00053 ".$export_id.".xml is no longer available";
00054
00055 trackers_data_add_history('details',
00056 htmlspecialchars($comment),
00057 '',
00058 $task_id,
00059 false,
00060 'task');
00061 $changes['details']['add'] = stripslashes($comment);
00062 $changes['details']['type'] = '100';
00063
00064 # Harshly close the relevant task
00065 $now = time();
00066 $result = db_query("UPDATE task SET status_id='3',close_date='$now' WHERE bug_id='$task_id' LIMIT 1");
00067 $changes['status_id']['add'] = 'Closed';
00068
00069 # Send a mail notification
00070 list($additional_address, $sendall) = trackers_data_get_item_notification_info($task_id, 'task', 0);
00071 if ((trim($address) != "") && (trim($additional_address) != ""))
00072 { $address .= ", "; }
00073 $address .= $additional_address;
00074 trackers_mail_followup($task_id, $address, $changes,false,'task');
00075
00076 session_redirect($GLOBALS['sys_home'].$from."/export.php?group=".rawurlencode($group_name)."&feedback=".rawurlencode(sprintf(_("Export job #%s deleted, task #%s closed"), $export_id, $task_id)));
00077
00078 ?>