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 Mar 19, 2015
1 parent 981c45c commit 0bf2e15
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,10 @@
UPDATE gibbonModule SET url='https://github.com/raynichc/helpdesk' WHERE name='Help Desk';end
" ;

//v0.3.05
$count++;
$sql[$count][0]="0.3.05" ;
$sql[$count][1]="
" ;

?>
7 changes: 6 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,9 @@ Fixed one permission having the wrong URL.
v0.3.04
-------
Fixed helpDesk_setTechGroup.php not having the technicians group as a default.
Changed some icons to others to fit the theme of the rest of gibbon.
Changed some icons to others to fit the theme of the rest of gibbon.

v0.3.05
-------
Added row coloring to tables to fit with the rest of gibbon.
Allowed Resolved issues to be viewed.
10 changes: 8 additions & 2 deletions helpDesk_manageTechnicianGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/helpDesk_createTechnicianGroup.php'>" . _('Create') . "</a>";
print "</div>" ;
if (! $result->rowcount() == 0){
$rowCount = 0;
while($row=$result->fetch()){
print "<tr>" ;
if($rowCount%2 == 0) {
print "<tr class='even'>";
}
else {
print "<tr class='odd'>";
}
print "<td>" . $row['groupName'] . "</td>" ;
print "<td> ";
$techsIn = "";
Expand All @@ -117,7 +123,7 @@
print"</td>" ;

print "</tr>" ;

$rowCount++;
}
} else {
print "<tr>";
Expand Down
10 changes: 8 additions & 2 deletions helpDesk_manageTechnicians.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/helpDesk_createTechnician.php'>" . _('Create') . "</a>";
print "</div>" ;
if (! $result->rowcount() == 0){
$rowCount=0;
while($row=$result->fetch()){
print "<tr>" ;
if($rowCount%2 == 0) {
print "<tr class='even'>";
}
else {
print "<tr class='odd'>";
}
print "<td>". formatName($row['title'],$row['preferredName'],$row['surname'], "Student", FALSE, FALSE) ."</td>" ;
print "<td> ";
$issues = "";
Expand All @@ -121,7 +127,7 @@
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/helpDesk_setTechGroup.php&technicianID=". $row['technicianID'] ."'><img title=" . _('Edit ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/config.png'/></a>";
print "</td>";
print "</tr>" ;

$rowCount++;
}
} else {
print "<tr>";
Expand Down
2 changes: 1 addition & 1 deletion issues_discussPostProccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}


if (!relatedToIssue($connection2, $issueID, $_SESSION[$guid]["gibbonPersonID"]) && !getPermissionValue($connection2, $_SESSION[$guid]["gibbonPersonID"], "resolveIssue")) {
if (!relatedToIssue($connection2, $issueID, $_SESSION[$guid]["gibbonPersonID"]) && !getPermissionValue($connection2, $_SESSION[$guid]["gibbonPersonID"], "resolveIssue") || getIssueStatus($connection2, $issueID)=="Resolved") {
//Fail 0 aka No permission
$URL=$URL . "&addReturn=fail0" ;
header("Location: {$URL}");
Expand Down
6 changes: 3 additions & 3 deletions issues_discussView.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
$result=$connection2->prepare($sql);
$result->execute($data);

$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 " ;
$sql2="SELECT helpDeskTechnicians.*, surname , title, preferredName, helpDeskIssue.status AS issueStatus FROM helpDeskIssue JOIN helpDeskTechnicians ON (helpDeskIssue.technicianID=helpDeskTechnicians.technicianID) JOIN gibbonPerson ON (helpDeskTechnicians.gibbonPersonID=gibbonPerson.gibbonPersonID) WHERE issueID=:issueID " ;
$result2=$connection2->prepare($sql2);
$result2->execute($data);
$array2 = $result2->fetchall();
Expand Down Expand Up @@ -185,13 +185,13 @@
print "<table class='smallIntBorder' cellspacing='0' style='width: 100%;'>" ;
print "<tr>" ;
print "<td style='text-align: justify; padding-top: 5px; width: 33%; vertical-align: top; max-width: 752px!important;' colspan=3>" ;

if($array2[0]["issueStatus"]!="Resolved") {
print "<div style='margin: 0px' class='linkTop'>" ;
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . getModuleName($_GET["q"]) . "/issues_discussView.php&issueID=" . $_GET["issueID"] . "'>" . _('Refresh') . "<img style='margin-left: 5px' title='" . _('Refresh') . "' src='./themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/refresh.png'/></a> <a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/issues_discussPost.php&issueID=" . $_GET["issueID"] . "'>" . _('Add') . "<img style='margin-left: 5px' title='" . _('Add') . "' src='./themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/page_new.png'/></a> " ;
if(getPermissionValue($connection2, $_SESSION[$guid]["gibbonPersonID"], "resolveIssue")) { print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/issues_resolveProcess.php?issueID=". $_GET["issueID"] . "'>" . _('Resolve'); }
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/issues_resolveProcess.php?issueID=". $_GET["issueID"] . "'><img title=" . _('Resolve ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/iconTick.png'/></a>";
print "</div>" ;

}
if ($result3->rowCount()==0){
print "<div class = 'error'>" ;
print _("There are no records to display.");
Expand Down
18 changes: 15 additions & 3 deletions issues_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
print "<a style='position:relative; bottom:10px;float:right;' href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/issues_create.php'><img style='margin-left: 2px' title=" . _('Create ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/page_new.png'/></a>";
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/issues_create.php'>" . _('Create ') . "</a>";
print "</div>" ;
print "<table class = 'smallIntBorder' cellspacing = '0' style = 'width: 100% !important'>";
print "<table cellspacing = '0' style = 'width: 100% !important'>";
print "<tr>";
print "<th>ID</th>";
print "<th>Title<br/>";
Expand All @@ -356,8 +356,15 @@
print "</tr>";
}
else {
$rowCount = 0;
foreach($resultIssue as $row){
print "<tr>";
if($rowCount%2 == 0) {
print "<tr class='even'>";
}
else {
print "<tr class='odd'>";
}

print "<td style='text-align: center;'><b>" . intval($row['issueID']) . "</b></td>";
$issueName = $row['issueName'];
if(strlen($issueName)>15) $issueName = substr($issueName, 0, 15) . "...";
Expand All @@ -371,7 +378,7 @@
if($renderPriority) { printf("<td><b>" .$row['priority']. "</b></td>"); }
printf("<td><b>" .$row['status']. "</b><br/>");
print "<span style='font-size: 85%; font-style: italic'>" . dateConvertBack($guid, $row["date"]) . "</span></td>" ;
print "<td style='width:15%'>";
print "<td style='width:16%'>";
$openCreated = false;
$resolveCreated = false;
if(isTechnician($_SESSION[$guid]["gibbonPersonID"], $connection2) && !relatedToIssue($connection2, intval($row['issueID']), $_SESSION[$guid]["gibbonPersonID"]))
Expand Down Expand Up @@ -401,8 +408,13 @@
if(!$openCreated && !($row['status']=="Resolved")) { print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/issues_discussView.php&issueID=". $row["issueID"] . "'><img style='margin-left: 5px' title=" . _('Open ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/zoom.png'/></a>"; }
if(!$resolveCreated && !($row['status']=="Resolved")) { print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/modules/" . $_SESSION[$guid]["module"] . "/issues_resolveProcess.php?issueID=". $row["issueID"] . "'><img style='margin-left: 5px' title=" . _('Resolve ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/iconTick.png'/></a>"; }
}
if($row['status']=="Resolved" && relatedToIssue($connection2, intval($row['issueID']), $_SESSION[$guid]["gibbonPersonID"])) {
print "<a href='" . $_SESSION[$guid]["absoluteURL"] . "/index.php?q=/modules/" . $_SESSION[$guid]["module"] . "/issues_discussView.php&issueID=". $row["issueID"] . "'><img style='margin-left: 5px' title=" . _('Open ') . "' src='" . $_SESSION[$guid]["absoluteURL"] . "/themes/" . $_SESSION[$guid]["gibbonThemeName"] . "/img/zoom.png'/></a>";
$openCreated = true;
}
print "</td>";
print "</tr>";
$rowCount++;
}
}
print "</table>";
Expand Down
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL="issues_view.php" ;
$type="Additional" ;
$category="Other" ;
$version="0.3.04" ;
$version="0.3.05" ;
$author="Adrien Tremblay & Ray Clark" ;
$url="https://github.com/raynichc/helpdesk" ;

Expand Down
18 changes: 18 additions & 0 deletions moduleFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ function relatedToIssue($connection2, $issueID, $gibbonPersonID) {
$isRelated = $row["gibbonPersonID"]==$gibbonPersonID;
}

if(getPermissionValue($connection2, $gibbonPersonID, "fullAccess")) {
$isRelated = true;
}

return $isRelated;
}

Expand Down Expand Up @@ -223,4 +227,18 @@ function getPermissionValue($connection2, $gibbonPersonID, $permission) {
}
return $row[$permission];
}

function getIssueStatus($connection2, $issueID) {
try {
$data=array("issueID"=> $issueID);
$sql="SELECT status FROM helpDeskIssue WHERE issueID:issueID";
$result=$connection2->prepare($sql);
$result->execute($data);
$row = $result->fetch();
}
catch(PDOException $e) {
print $e;
}
return $row["status"];
}
?>
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Sets version information
*/
$moduleVersion="0.3.04" ;
$moduleVersion="0.3.05" ;

/*
*/
Expand Down

0 comments on commit 0bf2e15

Please sign in to comment.