1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<?
# IRM - The Information Resource Manager
# Copyright (C) 1999 Yann Ramin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License (in file COPYING) for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: tracking-assign.php3,v 1.6 2000/03/17 05:48:34 atrus Exp $
#
################################################################################
# CHANGELOG #
################################################################################
# 8/06/99 - Keith Schoenefeld: Added CHANGELOG to file :) #
# 8/06/99 - Keith Schoenefeld: Changed cfg_notifybyemail to #
# cfg_notifyassignedbymeail to better #
# distinguish between the email notifications. #
################################################################################
include("../irm.inc");
AuthCheck("admin");
$db = new DB;
# This catch exists because there are two ways of assigning a job.
if ($HTTP_REFERER == "$UPREFIX/users/tracking-assign-form.php3?ID=$ID") {
commonHeader("IRM Tracking - Assigned");
PRINT "Job number $ID has been assigned to $user.\n<br>\n";
commonFooter();
}
else {
header("Location: $HTTP_REFERER");
}
$query = "UPDATE tracking SET assign = '$user' WHERE (ID = $ID)";
$result = $db->query($query);
# Notify by email functions
if ($cfg_notifyassignedbyemail == 1) {
$query = "SELECT * FROM users WHERE (name = '$user')";
$result = $db->query($query);
$email = $db->result($result, 0, "email");
$query = "SELECT * FROM tracking where (ID=$ID)";
$result = $db->query($query);
$status = $db->result($result, 0, "status");
$priority = $db->result($result, 0, "priority");
$contents = $db->result($result, 0, "contents");
mail("$email", "IRM: Tracking Job $ID Assigned to You!", "Tracking job assigned to you by Name=$IRMName.\nID=$ID Status=$status Priority=$priority\n\nRequest:\n$contents", "From: irm\n\n");
}
if($cfg_userupdates == 1)
{
$query = "SELECT * FROM tracking WHERE (ID = $ID)";
$result = $db->query("$query");
$emailupdates = $db->result($result, 0, "emailupdates");
$uemail = $db->result($result, 0, "uemail");
if($emailupdates == "yes")
{
mail("$uemail", "IRM: Tracking Job $ID Assigned to $user!", "Status=$status Priority=$priority\n\nRequest:\n$contents", "From: irm\n\n");
}
}
?>
|