From b3bbe3ff6fddc2f4252460a5379b86235baa6f29 Mon Sep 17 00:00:00 2001 From: Eric Cambel Date: Tue, 15 Dec 2015 12:56:55 -0500 Subject: [PATCH] Fixed non-used code, bugs (specifically ReportLandlordTen.php), as well as minor/major severity issues on scrutinizer. --- boost/boost.php | 2 +- boost/controlpanel.php | 2 +- boost/dependency.xml | 2 +- boost/update.php | 2 +- build.xml | 2 +- class/AJAXFactory.php | 2 +- class/Client.php | 2 +- class/ClientDB.php | 2 +- class/CommandContext.php | 2 +- class/Issue.php | 2 +- class/ViewFactory.php | 2 +- class/Visit.php | 2 +- class/VisitDB.php | 2 +- class/ajax/AJAX.php | 2 +- class/ajax/ClientFactory.php | 2 +- class/ajax/GETNewIssue.php | 6 +- class/ajax/GETReferralBox.php | 2 - class/ajax/GETReportCSV.php | 2 +- class/ajax/GETStudentClientData.php | 4 +- class/ajax/IssuesFactory.php | 34 +++------ class/ajax/POSTIncrementVisit.php | 2 +- class/ajax/POSTNewVisit.php | 5 +- class/ajax/POSTSendMail.php | 2 +- class/ajax/VisitFactory.php | 2 +- class/exceptions/AJAXErrorException.php | 2 +- class/exceptions/AJAXNotFoundException.php | 2 +- .../exceptions/BannerNotDefinedException.php | 2 +- .../ClientAlreadyExistsException.php | 2 +- class/exceptions/DatabaseException.php | 2 +- class/exceptions/IDNotSuppliedException.php | 2 +- .../exceptions/ParameterNotFoundException.php | 2 +- .../TemplateContentNotDefinedException.php | 2 +- .../TemplateNameNotDefinedException.php | 2 +- .../TemplateNotDefinedException.php | 2 +- class/exceptions/ViewNotFoundException.php | 2 +- .../exceptions/VisitDoesNotExistException.php | 2 +- class/indexes/VisitClient.php | 2 +- class/indexes/VisitIssue.php | 2 +- class/reports/CsvReport.php | 2 +- class/reports/Report.php | 4 +- class/reports/ReportApptStats.php | 15 +--- class/reports/ReportCondByLandlord.php | 4 +- class/reports/ReportIntakePrbType.php | 2 +- class/reports/ReportLandlordTen.php | 13 ++-- class/reports/ReportLawByAgency.php | 4 +- class/reports/ReportPrbByYr.php | 2 +- class/reports/ReportTypeOfCond.php | 2 +- class/reports/ReportTypeOfRef.php | 2 +- class/views/View.php | 2 +- class/views/ViewClient.php | 2 +- class/views/ViewMain.php | 2 +- class/views/ViewNewClient.php | 2 +- class/views/ViewNewIssue.php | 53 +------------- class/views/ViewReports.php | 73 +++++++++---------- inc/defines.php | 2 +- inc/functions.php | 2 +- inc/runtime.php | 2 +- inc/settings.php | 2 +- index.php | 2 +- 59 files changed, 112 insertions(+), 199 deletions(-) diff --git a/boost/boost.php b/boost/boost.php index 4bbd642..05416d7 100644 --- a/boost/boost.php +++ b/boost/boost.php @@ -12,4 +12,4 @@ $image_dir = false; $file_dir = false; -?> + diff --git a/boost/controlpanel.php b/boost/controlpanel.php index 021a455..dee9fa3 100644 --- a/boost/controlpanel.php +++ b/boost/controlpanel.php @@ -31,4 +31,4 @@ 'tab' => 'content' ); -?> + diff --git a/boost/dependency.xml b/boost/dependency.xml index d51005b..5c412af 100644 --- a/boost/dependency.xml +++ b/boost/dependency.xml @@ -1,4 +1,4 @@ - + core diff --git a/boost/update.php b/boost/update.php index 595ced9..17eb0d9 100644 --- a/boost/update.php +++ b/boost/update.php @@ -144,4 +144,4 @@ function slcUpdateFiles($files, &$content) { $content[] = " " . implode("\n ", $files); } -?> + diff --git a/build.xml b/build.xml index 8928f73..0713517 100644 --- a/build.xml +++ b/build.xml @@ -1,4 +1,4 @@ - + diff --git a/class/AJAXFactory.php b/class/AJAXFactory.php index bb422c2..e053ae5 100644 --- a/class/AJAXFactory.php +++ b/class/AJAXFactory.php @@ -51,4 +51,4 @@ public function result() { } -?> + diff --git a/class/Client.php b/class/Client.php index 75b3e3c..4a5cbda 100644 --- a/class/Client.php +++ b/class/Client.php @@ -128,4 +128,4 @@ public function setReferralString($referralString) } } -?> + diff --git a/class/ClientDB.php b/class/ClientDB.php index 0901b6e..29ba9d2 100644 --- a/class/ClientDB.php +++ b/class/ClientDB.php @@ -6,4 +6,4 @@ class ClientDB extends Client { public function __construct(){} } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/CommandContext.php b/class/CommandContext.php index 82b1ab1..ab7a5d0 100644 --- a/class/CommandContext.php +++ b/class/CommandContext.php @@ -66,4 +66,4 @@ function redirect($request){ } } -?> + diff --git a/class/Issue.php b/class/Issue.php index c9edad6..635bafe 100644 --- a/class/Issue.php +++ b/class/Issue.php @@ -124,4 +124,4 @@ public function setLandlordName($lName) } } -?> + diff --git a/class/ViewFactory.php b/class/ViewFactory.php index 8669bd2..b5dad40 100644 --- a/class/ViewFactory.php +++ b/class/ViewFactory.php @@ -36,4 +36,4 @@ public static function getView($view = 'Main'){ } } -?> + diff --git a/class/Visit.php b/class/Visit.php index 8912920..8c7e52e 100644 --- a/class/Visit.php +++ b/class/Visit.php @@ -51,4 +51,4 @@ public function getClientId() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/VisitDB.php b/class/VisitDB.php index bbc8aa9..68b239c 100644 --- a/class/VisitDB.php +++ b/class/VisitDB.php @@ -6,4 +6,4 @@ class VisitDB extends Visit { public function __construct(){} } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/ajax/AJAX.php b/class/ajax/AJAX.php index 76e9f78..d3bf185 100644 --- a/class/ajax/AJAX.php +++ b/class/ajax/AJAX.php @@ -23,4 +23,4 @@ protected function addResult($r, $v) { } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/ajax/ClientFactory.php b/class/ajax/ClientFactory.php index c4e47d9..81913ab 100644 --- a/class/ajax/ClientFactory.php +++ b/class/ajax/ClientFactory.php @@ -90,4 +90,4 @@ public static function getReferralType($cReferral) } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/ajax/GETNewIssue.php b/class/ajax/GETNewIssue.php index a1343f0..6a3e479 100644 --- a/class/ajax/GETNewIssue.php +++ b/class/ajax/GETNewIssue.php @@ -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 @@ -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']); } @@ -72,4 +70,4 @@ private function getLandlords() } } -?> + diff --git a/class/ajax/GETReferralBox.php b/class/ajax/GETReferralBox.php index e46a35d..a2e6881 100644 --- a/class/ajax/GETReferralBox.php +++ b/class/ajax/GETReferralBox.php @@ -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); } diff --git a/class/ajax/GETReportCSV.php b/class/ajax/GETReportCSV.php index acf25ec..9c3eb4f 100644 --- a/class/ajax/GETReportCSV.php +++ b/class/ajax/GETReportCSV.php @@ -30,4 +30,4 @@ public function execute() } } -?> + diff --git a/class/ajax/GETStudentClientData.php b/class/ajax/GETStudentClientData.php index 62fbe05..7215a58 100644 --- a/class/ajax/GETStudentClientData.php +++ b/class/ajax/GETStudentClientData.php @@ -3,8 +3,6 @@ class GETStudentClientData extends AJAX { public function execute() { - $HTMLcontent = ""; - $referral = ""; // Grabs a student object. $student = ClientFactory::getClientByBannerId($_REQUEST['banner_id']); @@ -57,4 +55,4 @@ public function execute() { $this->addResult("visit", $visits); } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/ajax/IssuesFactory.php b/class/ajax/IssuesFactory.php index 9bb06a2..85e3021 100644 --- a/class/ajax/IssuesFactory.php +++ b/class/ajax/IssuesFactory.php @@ -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; @@ -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 @@ -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']); @@ -74,4 +60,4 @@ public static function getIssueByVisitId($vid) } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/ajax/POSTIncrementVisit.php b/class/ajax/POSTIncrementVisit.php index 1038b41..cd70f09 100644 --- a/class/ajax/POSTIncrementVisit.php +++ b/class/ajax/POSTIncrementVisit.php @@ -57,4 +57,4 @@ public function execute() { } -?> + diff --git a/class/ajax/POSTNewVisit.php b/class/ajax/POSTNewVisit.php index e9bb53e..bb0ae0e 100644 --- a/class/ajax/POSTNewVisit.php +++ b/class/ajax/POSTNewVisit.php @@ -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; } @@ -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; @@ -94,4 +93,4 @@ public function execute() { } } -?> + diff --git a/class/ajax/POSTSendMail.php b/class/ajax/POSTSendMail.php index c8ddb93..f1a4d60 100644 --- a/class/ajax/POSTSendMail.php +++ b/class/ajax/POSTSendMail.php @@ -34,4 +34,4 @@ public function execute(){ } } -?> + diff --git a/class/ajax/VisitFactory.php b/class/ajax/VisitFactory.php index a27ac81..b2c998c 100644 --- a/class/ajax/VisitFactory.php +++ b/class/ajax/VisitFactory.php @@ -36,4 +36,4 @@ public static function saveVisit(&$pdo, $visit) } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/AJAXErrorException.php b/class/exceptions/AJAXErrorException.php index 817e852..887e205 100644 --- a/class/exceptions/AJAXErrorException.php +++ b/class/exceptions/AJAXErrorException.php @@ -3,4 +3,4 @@ class AJAXErrorException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/AJAXNotFoundException.php b/class/exceptions/AJAXNotFoundException.php index 382ac00..6823fc3 100644 --- a/class/exceptions/AJAXNotFoundException.php +++ b/class/exceptions/AJAXNotFoundException.php @@ -3,4 +3,4 @@ class AJAXNotFoundException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/BannerNotDefinedException.php b/class/exceptions/BannerNotDefinedException.php index 44de870..f9a5b0e 100644 --- a/class/exceptions/BannerNotDefinedException.php +++ b/class/exceptions/BannerNotDefinedException.php @@ -3,4 +3,4 @@ class BannerNotDefinedException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/ClientAlreadyExistsException.php b/class/exceptions/ClientAlreadyExistsException.php index 7b67352..1749fe0 100644 --- a/class/exceptions/ClientAlreadyExistsException.php +++ b/class/exceptions/ClientAlreadyExistsException.php @@ -3,4 +3,4 @@ class ClientAlreadyExistsException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/DatabaseException.php b/class/exceptions/DatabaseException.php index 9d40160..e35fef6 100644 --- a/class/exceptions/DatabaseException.php +++ b/class/exceptions/DatabaseException.php @@ -3,4 +3,4 @@ class DatabaseException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/IDNotSuppliedException.php b/class/exceptions/IDNotSuppliedException.php index 9dc7749..3083d67 100644 --- a/class/exceptions/IDNotSuppliedException.php +++ b/class/exceptions/IDNotSuppliedException.php @@ -3,4 +3,4 @@ class IDNotSuppliedException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/ParameterNotFoundException.php b/class/exceptions/ParameterNotFoundException.php index 15c3b3b..81d8a02 100644 --- a/class/exceptions/ParameterNotFoundException.php +++ b/class/exceptions/ParameterNotFoundException.php @@ -3,4 +3,4 @@ class ParameterNotFoundException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/TemplateContentNotDefinedException.php b/class/exceptions/TemplateContentNotDefinedException.php index 0c69c6c..e4daf9a 100644 --- a/class/exceptions/TemplateContentNotDefinedException.php +++ b/class/exceptions/TemplateContentNotDefinedException.php @@ -3,4 +3,4 @@ class TemplateContentNotDefinedException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/TemplateNameNotDefinedException.php b/class/exceptions/TemplateNameNotDefinedException.php index 31c56d9..6a2276c 100644 --- a/class/exceptions/TemplateNameNotDefinedException.php +++ b/class/exceptions/TemplateNameNotDefinedException.php @@ -3,4 +3,4 @@ class TemplateNameNotDefinedException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/TemplateNotDefinedException.php b/class/exceptions/TemplateNotDefinedException.php index 7682580..7c98ed6 100644 --- a/class/exceptions/TemplateNotDefinedException.php +++ b/class/exceptions/TemplateNotDefinedException.php @@ -3,4 +3,4 @@ class TemplateNotDefinedException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/ViewNotFoundException.php b/class/exceptions/ViewNotFoundException.php index 2ccca87..2aef54d 100644 --- a/class/exceptions/ViewNotFoundException.php +++ b/class/exceptions/ViewNotFoundException.php @@ -3,4 +3,4 @@ class ViewNotFoundException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/exceptions/VisitDoesNotExistException.php b/class/exceptions/VisitDoesNotExistException.php index 1b6131c..4578cfb 100644 --- a/class/exceptions/VisitDoesNotExistException.php +++ b/class/exceptions/VisitDoesNotExistException.php @@ -3,4 +3,4 @@ class VisitDoesNotExistException extends \Exception {} -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/indexes/VisitClient.php b/class/indexes/VisitClient.php index b279747..6108fa4 100644 --- a/class/indexes/VisitClient.php +++ b/class/indexes/VisitClient.php @@ -37,4 +37,4 @@ public function setVId($v_id) } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/indexes/VisitIssue.php b/class/indexes/VisitIssue.php index 6fc4ca5..b34da6d 100644 --- a/class/indexes/VisitIssue.php +++ b/class/indexes/VisitIssue.php @@ -69,4 +69,4 @@ public function setLastAccess($last_access) } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/CsvReport.php b/class/reports/CsvReport.php index 2793917..0899624 100644 --- a/class/reports/CsvReport.php +++ b/class/reports/CsvReport.php @@ -39,4 +39,4 @@ public function sputcsv(Array $row, $delimiter = ',', $enclosure = '"', $eol = " return $csv; } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/Report.php b/class/reports/Report.php index 53f702e..4e84e97 100644 --- a/class/reports/Report.php +++ b/class/reports/Report.php @@ -11,7 +11,7 @@ public function __construct($startDate, $endDate) { $this->startDate = $startDate; $this->endDate = $endDate; - $this->excute(); + $this->execute(); } abstract function execute(); @@ -20,4 +20,4 @@ abstract function getHtmlView(); } -?> + diff --git a/class/reports/ReportApptStats.php b/class/reports/ReportApptStats.php index 1957f70..68b8552 100644 --- a/class/reports/ReportApptStats.php +++ b/class/reports/ReportApptStats.php @@ -18,10 +18,6 @@ public function __construct($startDate, $endDate) public function execute() { - - $initialVisits = 0; - $clients = 0; - $issues = 0; $followups = 0; @@ -97,18 +93,11 @@ public function execute() } $db->addWhere('counter', $count, '=', 'AND'); - /* - SELECT distinct(slc_visit_issue_index.v_id) - FROM slc_visit_issue_index - WHERE (slc_visit_issue_index.v_id IN ('2') - AND slc_visit_issue_index.counter = '2') - GROUP BY slc_visit_issue_index.v_id - */ + $result = $db->select('col'); $visits = $visits + $result; - //Before change of default value in DB (1) - //$followups += ($count - 1) * count($result); + $followups += ($count) * count($result); $db->resetWhere(); } diff --git a/class/reports/ReportCondByLandlord.php b/class/reports/ReportCondByLandlord.php index 95de769..2c06603 100644 --- a/class/reports/ReportCondByLandlord.php +++ b/class/reports/ReportCondByLandlord.php @@ -44,7 +44,8 @@ public function execute() { // Building issues count based on the number of conditions $this->issueCount = array(); - for ($i = 0; $i < count($this->issuenames); $i++) + $countConditons = count($this->issuenames); + for ($i = 0; $i < $countConditons; $i++) { $this->issueCount[] = 0; } @@ -64,6 +65,7 @@ public function execute() { } } + $total = array(); foreach ($this->issuenames as $key => $issue) { $word = str_replace(" ", "_", $issue); diff --git a/class/reports/ReportIntakePrbType.php b/class/reports/ReportIntakePrbType.php index 3883778..35248f6 100644 --- a/class/reports/ReportIntakePrbType.php +++ b/class/reports/ReportIntakePrbType.php @@ -166,4 +166,4 @@ public function getHtmlView() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/ReportLandlordTen.php b/class/reports/ReportLandlordTen.php index eec1f2c..2ff5b2a 100644 --- a/class/reports/ReportLandlordTen.php +++ b/class/reports/ReportLandlordTen.php @@ -7,6 +7,8 @@ class ReportLandlordTen extends Report { public $total; public $startDate; public $endDate; + public $issuenames; + public $emptyLandlord; public function __construct($startDate, $endDate) { @@ -16,9 +18,6 @@ public function __construct($startDate, $endDate) } public function execute() { - // Get date range from user - $this->start_date = strtotime($_REQUEST['startDate']); - $this->end_date = strtotime($_REQUEST['endDate']) + 86400; // +1 day to make date range inclusive $landlords = "SELECT * FROM slc_landlord"; $db = new \PHPWS_DB(); @@ -41,7 +40,8 @@ public function execute() { // Building issues count based on the number of conditions $this->issueCount = array(); - for ($i = 0; $i < count($this->issuenames); $i++) + $countConditions = count($this->issuenames); + for ($i = 0; $i < $countConditions; $i++) { $this->issueCount[] = 0; } @@ -52,6 +52,7 @@ public function execute() { $content['landlord_issue_repeat'][] = array('ISSUE_NAME' => $issue); } + $overallCount = 0; foreach ($landlords as $landlord) { $row = $this->landlordRow($landlord); @@ -95,7 +96,7 @@ private function landlordRow($landlord) GROUP BY slc_problem.description'; //change by landlord id $sth = $this->pdo->prepare($query); - $sth->execute(array("startDate"=>$this->start_date, "endDate"=>$this->end_date, "lId"=>$landlord['id'])); + $sth->execute(array("startDate"=>$this->startDate, "endDate"=>$this->endDate, "lId"=>$landlord['id'])); $result = $sth->fetchAll(\PDO::FETCH_ASSOC); $row["NAME"] = $landlord['name']; @@ -193,4 +194,4 @@ public function getCsvView() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/ReportLawByAgency.php b/class/reports/ReportLawByAgency.php index 3caec83..7f0d395 100644 --- a/class/reports/ReportLawByAgency.php +++ b/class/reports/ReportLawByAgency.php @@ -48,7 +48,7 @@ public function execute() } $content["TITLE"] = "Agency"; - $contant["STATS"] = "Statistics"; + $content["STATS"] = "Statistics"; $row = array(); foreach($agencies as $key => $condition) @@ -70,4 +70,4 @@ public function getHtmlView() } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/ReportPrbByYr.php b/class/reports/ReportPrbByYr.php index a910902..cf14091 100644 --- a/class/reports/ReportPrbByYr.php +++ b/class/reports/ReportPrbByYr.php @@ -187,4 +187,4 @@ public function getHtmlView() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/ReportTypeOfCond.php b/class/reports/ReportTypeOfCond.php index a5cc60b..3d8fa07 100644 --- a/class/reports/ReportTypeOfCond.php +++ b/class/reports/ReportTypeOfCond.php @@ -66,4 +66,4 @@ public function getHtmlView() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/reports/ReportTypeOfRef.php b/class/reports/ReportTypeOfRef.php index 341eada..cf1cbe5 100644 --- a/class/reports/ReportTypeOfRef.php +++ b/class/reports/ReportTypeOfRef.php @@ -64,4 +64,4 @@ public function getHtmlView() } } -?> \ No newline at end of file + \ No newline at end of file diff --git a/class/views/View.php b/class/views/View.php index 0937a4c..5725e8e 100644 --- a/class/views/View.php +++ b/class/views/View.php @@ -25,4 +25,4 @@ public function addNotifications($n) } } -?> + diff --git a/class/views/ViewClient.php b/class/views/ViewClient.php index 3916946..8d2d8ca 100644 --- a/class/views/ViewClient.php +++ b/class/views/ViewClient.php @@ -42,4 +42,4 @@ public function checkBannerID($banner_id) return $result; } } -?> + diff --git a/class/views/ViewMain.php b/class/views/ViewMain.php index 646edcf..bb3e87c 100644 --- a/class/views/ViewMain.php +++ b/class/views/ViewMain.php @@ -21,4 +21,4 @@ public function display(\slc\CommandContext $context) { } } -?> + diff --git a/class/views/ViewNewClient.php b/class/views/ViewNewClient.php index b043fac..0619963 100644 --- a/class/views/ViewNewClient.php +++ b/class/views/ViewNewClient.php @@ -30,4 +30,4 @@ private function setupTree() { private $theTree = array(); } -?> + diff --git a/class/views/ViewNewIssue.php b/class/views/ViewNewIssue.php index 5de5f5a..45a2b24 100644 --- a/class/views/ViewNewIssue.php +++ b/class/views/ViewNewIssue.php @@ -19,53 +19,6 @@ public function display(\slc\CommandContext $context) { $this->setupTree(); - /* - $tree = new \PHPWS_Template('slc'); - $tree->setFile('IssueTree.tpl'); - - foreach( $this->theTree["Type Of Problem"] as $pType ) { - - if ( $pType["DBNAME"] == "problemlandlord") { - foreach( $this->theTree["Conditions"] as $data ) { - $tree->setCurrentBlock("problemlandlordcondition"); - $tree->setData($data); - $tree->parseCurrentBlock(); - } - - foreach ($this->theTree["Landlord-Tenant"] as $data) { - $tree->setCurrentBlock("problemlandlordnormal"); - $tree->setData($data); - $tree->parseCurrentBlock(); - } - } else if ( $pType["DBNAME"] == "problemregular") { - foreach( $this->theTree["Problem"] as $data ) { - $tree->setCurrentBlock("problemregular"); - $tree->setData($data); - $tree->parseCurrentBlock(); - } - } - */ - // This displays the 'Criminal' sub-types. We don't use those anymore, so this is commented out to hide them. - /*else if ( $pType["DBNAME"] == "problemcriminal") { - foreach( $this->theTree["Law Enforcement Agency"] as $data ) { - $tree->setCurrentBlock("problemcriminalagency"); - $tree->setData($data); - $tree->parseCurrentBlock(); - } - - foreach( $this->theTree["Type of Criminal Problem"] as $data ) { - $tree->setCurrentBlock("problemcriminaltype"); - $tree->setData($data); - $tree->parseCurrentBlock(); - } - }*/ - - /* - $tree->setCurrentBlock($pType["DBNAME"]); - $tree->setData($pType); - $tree->parseCurrentBlock(); - } - */ $content['VISITID'] = $_REQUEST['visitid']; // extract client from visitid @@ -76,12 +29,10 @@ public function display(\slc\CommandContext $context) { $content['CLIENTID'] = $results[0]['client_id']; $content['TITLE'] = "Create New Issue for ".$_REQUEST['cname']; - //$content['SELECTED_ISSUES'] = "[ none ]"; $content['PROBLEMS'] = $this->theTree; $content['LANDLORD_PICKER'] = \PHPWS_Template::process(array("landlords"=>$this->landlords), 'slc', 'LandlordPicker.tpl'); - //\javascriptMod('slc', 'viewClient'); $content = \PHPWS_Template::process($content, 'slc', 'NewIssue.tpl'); return parent::useTemplate($content); } @@ -126,12 +77,10 @@ private function setupTree() { foreach ($results as $r) { $this->landlords[] = array("LANDLORD_ID" => $r['id'], "NAME"=>$r['name']); } - - //\javascriptMod('slc', 'newIssue'); } } -?> + diff --git a/class/views/ViewReports.php b/class/views/ViewReports.php index 9e6fb15..f0279b5 100644 --- a/class/views/ViewReports.php +++ b/class/views/ViewReports.php @@ -2,44 +2,37 @@ namespace slc\views; class ViewReports extends View { - public function display(\slc\CommandContext $context) { - \javascriptMod('slc', 'report'); - $HTMLcontent = ""; - /* - $content = array(); - - - // Report Dropdown - $ajax = \slc\AjaxFactory::get("report_picker"); - $ajax->loadCall("GETReportBox"); - $ajax->execute(); - $result = $ajax->result(); - $content['REPORTPICKER'] = $result['report_picker']; // the HTML for the picker - */ - // Date range selection - javascript('datepicker'); - - - - $form = new \PHPWS_Form("timespan"); - - $form->addText('start_date', ''); // date pickers are initially blank - $form->setSize('start_date', 10); - $form->addCssClass('start_date', 'datepicker'); - $form->addCssClass('start_date', 'form-control'); - - $form->addText('end_date', ''); // date pickers are initially blank - $form->setSize('end_date', 10); - $form->addCssClass('end_date', 'datepicker'); - $form->addCssClass('end_date', 'form-control'); - - $content['START_DATE'] = $form->get('start_date'); - $content['END_DATE'] = $form->get('end_date'); - - // Process the template - $HTMLcontent .= \PHPWS_Template::process($content, 'slc', 'Report.tpl'); - - return parent::useTemplate($HTMLcontent); // Insert into the accessible div - } + public function display(\slc\CommandContext $context) + { + \javascriptMod('slc', 'report'); + $HTMLcontent = ""; + + // Date range selection + javascript('datepicker'); + + + + $form = new \PHPWS_Form("timespan"); + + $form->addText('start_date', ''); // date pickers are initially blank + $form->setSize('start_date', 10); + $form->addCssClass('start_date', 'datepicker'); + $form->addCssClass('start_date', 'form-control'); + + $form->addText('end_date', ''); // date pickers are initially blank + $form->setSize('end_date', 10); + $form->addCssClass('end_date', 'datepicker'); + $form->addCssClass('end_date', 'form-control'); + + $content = array(); + + $content['START_DATE'] = $form->get('start_date'); + $content['END_DATE'] = $form->get('end_date'); + + // Process the template + $HTMLcontent .= \PHPWS_Template::process($content, 'slc', 'Report.tpl'); + + return parent::useTemplate($HTMLcontent); // Insert into the accessible div + } } -?> + diff --git a/inc/defines.php b/inc/defines.php index 4f47613..d9352dc 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -22,4 +22,4 @@ function getYearList(){ STUDENT_GRADUATE => 'Graduate', STUDENT_OTHER => 'Other'); } -?> + diff --git a/inc/functions.php b/inc/functions.php index 5c263c7..ae9a461 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -119,4 +119,4 @@ function endsWith($haystack, $needle) return (substr($haystack, $start) === $needle); } -?> + diff --git a/inc/runtime.php b/inc/runtime.php index 86594ee..2ede34a 100644 --- a/inc/runtime.php +++ b/inc/runtime.php @@ -8,4 +8,4 @@ exit(); } -?> + diff --git a/inc/settings.php b/inc/settings.php index b8fc9cf..964645e 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -2,4 +2,4 @@ $settings = array('encode_salt' => 'defaultSettings'); -?> \ No newline at end of file + \ No newline at end of file diff --git a/index.php b/index.php index 0b37535..9cf7263 100644 --- a/index.php +++ b/index.php @@ -66,4 +66,4 @@ $navLinks = new \slc\views\NavLinks(); \Layout::plug($navLinks->display(), 'NAV_LINKS'); -?> +