Skip to content

Commit

Permalink
Fixed non-used code, bugs (specifically ReportLandlordTen.php), as we…
Browse files Browse the repository at this point in the history
…ll as minor/major severity issues on scrutinizer.
  • Loading branch information
cambelem committed Dec 15, 2015
1 parent 380b28a commit b3bbe3f
Show file tree
Hide file tree
Showing 59 changed files with 112 additions and 199 deletions.
2 changes: 1 addition & 1 deletion boost/boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
$image_dir = false;
$file_dir = false;

?>
2 changes: 1 addition & 1 deletion boost/controlpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
'tab' => 'content'
);

?>
2 changes: 1 addition & 1 deletion boost/dependency.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0"
<dependency>
<module>
<title>core</title>
Expand Down
2 changes: 1 addition & 1 deletion boost/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ function slcUpdateFiles($files, &$content) {
$content[] = " " . implode("\n ", $files);
}

?>
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"

<project name="slc" default="build">
<property environment="env" />
Expand Down
2 changes: 1 addition & 1 deletion class/AJAXFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public function result() {

}

?>
2 changes: 1 addition & 1 deletion class/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ public function setReferralString($referralString)
}
}

?>
2 changes: 1 addition & 1 deletion class/ClientDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class ClientDB extends Client {
public function __construct(){}
}

?>
2 changes: 1 addition & 1 deletion class/CommandContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ function redirect($request){
}
}

?>
2 changes: 1 addition & 1 deletion class/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ public function setLandlordName($lName)
}
}

?>
2 changes: 1 addition & 1 deletion class/ViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public static function getView($view = 'Main'){
}
}

?>
2 changes: 1 addition & 1 deletion class/Visit.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public function getClientId()
}
}

?>
2 changes: 1 addition & 1 deletion class/VisitDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ class VisitDB extends Visit {
public function __construct(){}
}

?>
2 changes: 1 addition & 1 deletion class/ajax/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ protected function addResult($r, $v) {
}
}

?>
2 changes: 1 addition & 1 deletion class/ajax/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public static function getReferralType($cReferral)
}
}

?>
6 changes: 2 additions & 4 deletions class/ajax/GETNewIssue.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

class GETNewIssue extends AJAX {

private $theTree = array();
private $landlords = array();

public function execute() {

// Grabs the data associated with each problem type as well as their
Expand Down Expand Up @@ -49,6 +46,7 @@ private function grabProblemTypes($type, $id) {
else if($type == 'Landlord-Tenant')
$type = 'LandlordTenant';

$typeArray = array();
foreach ($result as $r) {
$typeArray[$type][] = array("problem_id" => $r['id'], "name"=>$r['description'], "type"=>$r['type']);
}
Expand All @@ -72,4 +70,4 @@ private function getLandlords()
}
}

?>
2 changes: 0 additions & 2 deletions class/ajax/GETReferralBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public function execute() {
foreach( $results as $r ) { // types
$rTypes[] = array("referral_id" => $r['id'], "name"=>$r['name']);
}

//$referralPicker = \PHPWS_Template::process(array("referrals"=>$rTypes), 'slc', 'ReferralPicker.tpl');

$this->addResult("referral_picker", $rTypes);
}
Expand Down
2 changes: 1 addition & 1 deletion class/ajax/GETReportCSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public function execute()
}
}

?>
4 changes: 1 addition & 3 deletions class/ajax/GETStudentClientData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

class GETStudentClientData extends AJAX {
public function execute() {
$HTMLcontent = "";
$referral = "";

// Grabs a student object.
$student = ClientFactory::getClientByBannerId($_REQUEST['banner_id']);
Expand Down Expand Up @@ -57,4 +55,4 @@ public function execute() {
$this->addResult("visit", $visits);
}
}
?>
34 changes: 10 additions & 24 deletions class/ajax/IssuesFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ class IssuesFactory
// returns the issue id
public static function saveIssue($issue)
{
/*
$db = \Database::newDB();
$pdo = $db->getPDO();
$values = array('id'=>$issue->getId(),
'problem_id'=>$issue->getProblemId(),
'landlord_id'=>$issue->getLandlordId());
$query = 'INSERT INTO slc_issue (id, problem_id, landlord_id)
VALUES (:id, :problem_id, :landlord_id)';
$sth = $pdo->prepare($query);
$sth->execute($values);
*/
$db = new \PHPWS_DB("slc_issue");
$results = $db->saveObject($issue);
return $results;
Expand All @@ -32,14 +18,14 @@ public static function getIssueByVisitId($vid)
$db = \Database::newDB();
$pdo = $db->getPDO();

$query = 'SELECT vii.id AS "VIIID",
p.description AS "ISSUENAME",
l.name as "LANDLORDNAME",
i.landlord_id as "LANDLORDID",
i.problem_id as "PROBLEMID",
vii.i_id AS "ISSUEID",
vii.counter AS "COUNTER",
vii.resolve_date AS "RESOLVEDATE",
$query = 'SELECT vii.id AS "VIIID",
p.description AS "ISSUENAME",
l.name as "LANDLORDNAME",
i.landlord_id as "LANDLORDID",
i.problem_id as "PROBLEMID",
vii.i_id AS "ISSUEID",
vii.counter AS "COUNTER",
vii.resolve_date AS "RESOLVEDATE",
vii.last_access AS "LASTACCESS"
FROM slc_visit_issue_index as vii
INNER JOIN slc_issue i ON vii.i_id=i.id
Expand All @@ -56,7 +42,7 @@ public static function getIssueByVisitId($vid)
{
$issue = new \slc\Issue($ir['ISSUEID']);
$issue->setName($ir['ISSUENAME']);
$issue->setLastAccess(prettyTime($ir['LASTACCESS'])." (".prettyAccess($ir['LASTACCESS']).")");
$issue->setLastAccess(prettyTime($ir['LASTACCESS'])." (".prettyAccess($ir['LASTACCESS']).")");
$issue->setCounter($ir['COUNTER']);
$issue->setResolutionDate($ir['RESOLVEDATE']);
$issue->setVisitIssueId($ir['VIIID']);
Expand All @@ -74,4 +60,4 @@ public static function getIssueByVisitId($vid)

}

?>
2 changes: 1 addition & 1 deletion class/ajax/POSTIncrementVisit.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public function execute() {

}

?>
5 changes: 2 additions & 3 deletions class/ajax/POSTNewVisit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class POSTNewVisit extends AJAX {
public function execute() {
if ( !isset($_REQUEST['banner_id']) ) {
$this->addResult("warning", "No Banner ID Supplied");
// throw new IDNotSuppliedException();
return;
}

Expand Down Expand Up @@ -60,7 +59,7 @@ public function execute() {

$i = new \slc\Issue($pid, $llid);
$result = IssuesFactory::saveIssue($i);
//$result = null;

if ($result == null)
{
$warning = "Error with issue " . $pid . " " . $llid;
Expand Down Expand Up @@ -94,4 +93,4 @@ public function execute() {
}
}

?>
2 changes: 1 addition & 1 deletion class/ajax/POSTSendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public function execute(){
}
}

?>
2 changes: 1 addition & 1 deletion class/ajax/VisitFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public static function saveVisit(&$pdo, $visit)
}
}

?>
2 changes: 1 addition & 1 deletion class/exceptions/AJAXErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class AJAXErrorException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/AJAXNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class AJAXNotFoundException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/BannerNotDefinedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class BannerNotDefinedException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/ClientAlreadyExistsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class ClientAlreadyExistsException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/DatabaseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class DatabaseException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/IDNotSuppliedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class IDNotSuppliedException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/ParameterNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class ParameterNotFoundException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/TemplateContentNotDefinedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class TemplateContentNotDefinedException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/TemplateNameNotDefinedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class TemplateNameNotDefinedException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/TemplateNotDefinedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class TemplateNotDefinedException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/ViewNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class ViewNotFoundException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/exceptions/VisitDoesNotExistException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

class VisitDoesNotExistException extends \Exception {}

?>
2 changes: 1 addition & 1 deletion class/indexes/VisitClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function setVId($v_id)
}
}

?>
2 changes: 1 addition & 1 deletion class/indexes/VisitIssue.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ public function setLastAccess($last_access)
}
}

?>
2 changes: 1 addition & 1 deletion class/reports/CsvReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public function sputcsv(Array $row, $delimiter = ',', $enclosure = '"', $eol = "
return $csv;
}
}
?>
4 changes: 2 additions & 2 deletions class/reports/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct($startDate, $endDate)
{
$this->startDate = $startDate;
$this->endDate = $endDate;
$this->excute();
$this->execute();
}

abstract function execute();
Expand All @@ -20,4 +20,4 @@ abstract function getHtmlView();

}

?>
Loading

0 comments on commit b3bbe3f

Please sign in to comment.