Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray Clark authored and Ray Clark committed Dec 2, 2014
1 parent 651008c commit e98a7df
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
17 changes: 14 additions & 3 deletions issues_discuss_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$array = $result->fetchall();

$sql2="SELECT helpDeskTechnicians.*, surname , title, preferredName FROM helpDeskIssue JOIN helpDeskTechnicians ON (helpDeskIssue.technicianID=helpDeskTechnicians.technicianID) JOIN gibbonPerson ON (helpDeskTechnicians.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE issueID=:issueID " ;
$result2=$connection2->prepare($sql2);
$result2=$connection2->prepare($sql2);
$result2->execute($data);
$array2 = $result2->fetchall();

Expand All @@ -76,6 +76,10 @@
print "<div class='trailHead'><a href='" . $_SESSION[$guid]["absoluteURL"] . "'>" . _("Home") . "</a> > <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["q"]) . "/" . getModuleEntry($_GET["q"], $connection2, $guid) . "'>" . _(getModuleName($_GET["q"])) . "</a> > </div><div class='trailEnd'>" . _('Discuss Issue') . "</div>" ;
print "</div>" ;

if(!isset($array2[0]["technicianID"])) {
$array2[0]["technicianID"] = null;
}

if(technicianExists($connection2, $array2[0]["technicianID"]))
{
if(!($array2[0]["technicianID"]==getTechnicianID($_SESSION[$guid]["gibbonPersonID"], $connection2))) {
Expand All @@ -85,7 +89,7 @@
exit();
}
}
else {
else if(!($array2[0]["technicianID"]==null)){
print "<div class='error'>" ;
print "You do not have access to this action." ;
print "</div>" ;
Expand Down Expand Up @@ -116,9 +120,16 @@
print "<tr>" ;
print "<td>". $array[0]["description"] ."</td>" ;
print "</tr>" ;
if($array2[0]["technicianID"]==null) {
print "<tr>";
print "<td class='right'>";
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/issues_acceptProcess.php?issueID=". $issueID . "'><img title=" . _('Accept ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/plus.png'/></a>";
print "</td>";
print "</tr>";
}
print "</table>" ;

if(isset($array2[0]["techicanID"])) {
if(!($array2[0]["technicianID"]==null)) {
print "<a name='discuss'></a>" ;
print "<h2 style='padding-top: 30px'>" . _('Discuss') . "</h2>" ;
print "<table class='smallIntBorder' cellspacing='0' style='width: 100%;'>" ;
Expand Down
3 changes: 3 additions & 0 deletions issues_submitProccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
header("Location: {$URL}");
break ;
}


notifyTechnican($connection2, $guid, $connection2->lastInsertId());
//Success 0
$URL=$URL . "&addReturn=success0" ;
header("Location: {$URL}");
Expand Down
2 changes: 1 addition & 1 deletion issues_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
print "<tr>";
printf("<td>" .dateConvertBack($guid, $row["date"]). "</td>");
printf("<td>" .$row['issueName']. "</td>");
printf("<td>" .substr($row['description'], 0, 20). "...</td>");
printf("<td>" .substr($row['description'], 0, 15). "...</td>");
printf("<td>" .formatName($row['title'],$row['preferredName'],$row['surname'], "Student", FALSE, FALSE). "</td>");
printf("<td>" .$row['status']. "</td>");
printf("<td>" .$row['category']. "</td>");
Expand Down
9 changes: 4 additions & 5 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
PRIMARY KEY (`issueDiscussID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;" ;

$moduleTables[3]="INSERT INTO `gibbonSetting` (`gibbonSystemSettingsID`, `scope`, `name`, `nameDisplay`, `description`, `value`)
VALUES
(NULL, 'Help Desk', 'issuePriority', 'Issue Priority', 'Different priority levels for the issues.', ''),
(NULL, 'Help Desk', 'issuePriorityName', 'Issue Priority Name', 'Different name for the Issue Priority', 'Priority'),
$moduleTables[3]="INSERT INTO `gibbonSetting` (`gibbonSystemSettingsID`, `scope`, `name`, `nameDisplay`, `description`, `value`)
VALUES
(NULL, 'Help Desk', 'issuePriority', 'Issue Priority', 'Different priority levels for the issues.', ''),
(NULL, 'Help Desk', 'issuePriorityName', 'Issue Priority Name', 'Different name for the Issue Priority', 'Priority'),
(NULL, 'Help Desk', 'issueCategory', 'Issue Category', 'Different categories for the issues.', 'Network,Hardware,Software,Application')";
//Action rows
//One array per action
Expand Down Expand Up @@ -153,7 +153,6 @@
$actionRows[$actionCount]["categoryPermissionOther"]="N" ;

$actionCount++ ;
<<<<<<< HEAD
$actionRows[$actionCount]["name"]="Create Technician" ;
$actionRows[$actionCount]["precedence"]="0" ;
$actionRows[$actionCount]["category"]="" ;
Expand Down
18 changes: 17 additions & 1 deletion moduleFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function technicianExists($connection2, $technicianID)

function technicianExistsFromPersonID($connection2, $gibbonPersonID) {
try {
$data=array("gibbonPersonID"=> $personID);
$data=array("gibbonPersonID"=> $gibbonPersonID);
$sql="SELECT * FROM helpDeskTechnicians WHERE gibbonPersonID=:gibbonPersonID";
$result=$connection2->prepare($sql);
$result->execute($data);
Expand All @@ -148,4 +148,20 @@ function technicianExistsFromPersonID($connection2, $gibbonPersonID) {
return ($result->rowCount()==1);
}

function notifyTechnican($connection2, $guid, $issueID) {
try {
$data=array();
$sql="SELECT * FROM helpDeskTechnicians";
$result=$connection2->prepare($sql);
$result->execute($data);
}
catch(PDOException $e) {
print $e;
}

while($row = $result->fetch()) {
setNotification($connection2, $guid, $row["gibbonPersonID"], "A new issue has been added.", "Help Desk", "/index.php?q=/modules/Help Desk/issues_discuss_view.php&issueID=" . $issueID);
}
}

?>

0 comments on commit e98a7df

Please sign in to comment.