-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Something bad happened in the conversion to Git, but the history is n…
…ot impressive anyway.
- Loading branch information
0 parents
commit 0d7fac9
Showing
59 changed files
with
4,385 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
$proper_name = 'Student Legal Clinic Tracker'; | ||
$version = '2.0.6'; | ||
$register = false; | ||
$unregister = false; | ||
$import_sql = true; | ||
$version_http = ''; | ||
$about = false; | ||
$priority = 50; | ||
$dependency = true; | ||
$image_dir = false; | ||
$file_dir = false; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* skeleton - phpwebsite module | ||
* | ||
* See docs/AUTHORS and docs/COPYRIGHT for relevant info. | ||
* | ||
* 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* @version $Id$ | ||
* @author Verdon Vaillancourt <verdonv at users dot sourceforge dot net> | ||
*/ | ||
|
||
$link[] = array( | ||
'label' => 'Student Legal Clinic Tracker 2.0', | ||
'restricted' => true, | ||
'url' => 'index.php?module=slc', | ||
'description' => 'Track statistics about visits', | ||
'image' => 'skeleton.png', | ||
'tab' => 'content' | ||
); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<dependency> | ||
<module> | ||
<title>core</title> | ||
<properName>phpWebSite Core</properName> | ||
<version>2.0.1</version> | ||
<url>http://phpwebsite.appstate.edu/downloads/modules/base/</url> | ||
</module> | ||
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- slc - phpwebsite module | ||
-- @version $Id: $ | ||
-- @author Adam Dixon | ||
|
||
DROP TABLE IF EXISTS slc_issue; | ||
|
||
DROP TABLE IF EXISTS slc_visit; | ||
|
||
DROP TABLE IF EXISTS slc_visit_issue_index; | ||
|
||
DROP TABLE IF EXISTS slc_visit_issue_date_index; | ||
|
||
DROP TABLE IF EXISTS slc_client; | ||
|
||
DROP TABLE IF EXISTS slc_visit_client_index; | ||
|
||
DROP TABLE IF EXISTS slc_issue_detail_index; | ||
|
||
DROP TABLE IF EXISTS slc_visit_detail_index; | ||
|
||
DROP TABLE IF EXISTS slc_client_detail_index; | ||
|
||
DROP TABLE IF EXISTS slc_detail; | ||
|
||
DROP TABLE IF EXISTS slc_landlord; | ||
|
||
DROP TABLE IF EXISTS slc_problem; | ||
|
||
DROP TABLE IF EXISTS slc_referral_type; | ||
|
||
DROP TABLE IF EXISTS slc_student_data; | ||
|
||
DROP TABLE IF EXISTS slc_visit_client_index_seq; | ||
DROP TABLE IF EXISTS slc_visit_issue_index_seq; | ||
DROP TABLE IF EXISTS slc_visit_seq; | ||
|
||
DROP TABLE IF EXISTS slc_issue_node; | ||
DROP TABLE IF EXISTS slc_issue_report; | ||
DROP TABLE IF EXISTS slc_issue_report_list; | ||
DROP TABLE IF EXISTS slc_issue_selected_node; | ||
DROP TABLE IF EXISTS slc_issue_seq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<?php | ||
/** | ||
* Updates the module | ||
* | ||
* @author Chris Coley <chris at tux dot appstate dot edu> | ||
*/ | ||
|
||
function slc_update(&$content, $current_version) { | ||
switch(1) { | ||
case version_compare($current_version, '2.0.3', '<'): | ||
$content[] = '<pre>'; | ||
|
||
$db = new PHPWS_DB('slc_problem'); | ||
$db->addWhere('id', 16); | ||
$db->addValue('description', 'Tenancy / Eviction'); | ||
|
||
if (PHPWS_Error::logIfError($db->update())) { | ||
$content[] = 'Unable to change "Tenancy/Eviction" to "Tenancy / Eviction" in table slc_problem.'; | ||
return false; | ||
} else { | ||
$content[] = 'Changed "Tenancy/Eviction" to "Tenancy / Eviction" in table slc_problem'; | ||
} | ||
|
||
slcUpdateFiles(array( 'class/ajax/GETReport.php', | ||
'class/views/ViewReports.php', | ||
'javascript/report/head.js', | ||
'templates/Report.tpl', | ||
'boost/install.sql', | ||
'boost/boost.php', | ||
'boost/update.php'), $content); | ||
|
||
$content[] = '2.0.3 changes | ||
--------------- | ||
+ Added date selectors to all reports to limit data to a specific timespan. | ||
+ Fixed the Landlord-Tenant report display issue in Firefox.</pre>'; | ||
|
||
case version_compare($current_version, '2.0.4', '<'): | ||
$content[] = '<pre>'; | ||
|
||
$db = new PHPWS_DB('slc_landlord'); | ||
$db->addWhere('id', 94); | ||
$db->addValue('name', 'Other / Unspecified'); | ||
if (PHPWS_Error::logIfError($db->update())) { | ||
$content[] = 'Unable to change "Other / Not Provided" to "Other / Unspecified" in table slc_landlord.'; | ||
return false; | ||
} | ||
|
||
$db->reset(); | ||
$db->addWhere('id', 70); | ||
$db->addValue('name', 'Roger Pope'); | ||
if (PHPWS_Error::logIfError($db->update())) { | ||
$content[] = 'Unable to move "Roger Pope" from id=95 to id=70'; | ||
return false; | ||
} | ||
|
||
$db->reset(); | ||
$db->addWhere('id', 95); | ||
if (PHPWS_Error::logIfError($db->delete())) { | ||
$content[] = 'Unable to delete Roger Pope\'s old id (95) from slc_landlord.'; | ||
return false; | ||
} | ||
|
||
$content[] = 'Successfully merged "Unknown" and "Other / Not Provided" into "Other / Unspecified" in table slc_landlord.'; | ||
|
||
$db = new PHPWS_DB('slc_issue'); | ||
$db->addWhere('landlord_id', 70); | ||
$db->addValue('landlord_id', 94); | ||
if (PHPWS_Error::logIfError($db->update())) { | ||
$content[] = 'Unable to move issues assigned to landlord "Unknown" to landlord "Other / Unspecified".'; | ||
return false; | ||
} else { | ||
$content[] = 'Successfully moved issues assigned to landlord "Unknown" to landlord "Other / Unspecified".'; | ||
} | ||
|
||
$db->reset(); | ||
$db->addWhere('landlord_id', 95); | ||
$db->addValue('landlord_id', 70); | ||
if (PHPWS_Error::logIfError($db->update())) { | ||
$content[] = 'Unable to move issues assigned to landlord "Roger Pope" from his old id (95) to his new id (70).'; | ||
return false; | ||
} else { | ||
$content[] = 'Successfully moved issues assigned to landlord Roger Pope\'s old id (95) to his new id (70).'; | ||
} | ||
|
||
slcUpdateFiles(array( 'boost/install.sql', | ||
'boost/update.php', | ||
'boost/boost.php', | ||
'class/ajax/GETReport.php', | ||
'class/ajax/POSTNewIssue.php'), $content); | ||
|
||
$content[] = '2.0.4 changes | ||
--------------- | ||
+ Merged "Unknown" and "Other / Not Provided" landlords into "Other / Unspecified". | ||
+ Updated the reports and issue creation to reflect this merging.<pre>'; | ||
|
||
case version_compare($current_version, '2.0.5', '<'): | ||
$content[] = '<pre>'; | ||
slcUpdateFiles(array( 'boost/boost.php', | ||
'boost/update.php', | ||
'class/ajax/GETReport.php', | ||
'class/views/ViewReports.php', | ||
'javascript/report/head.js', | ||
'templates/Report.tpl', | ||
'class/ajax/ExportCSV.php'), $content); | ||
$content[] = '2.0.5 changes | ||
--------------- | ||
+ Fixed some math issues in "Landlord/Tenant" and "Condition by Landlord" reports. | ||
+ Added CSV export for the "Landlord/Tenant", "Condition by Landlord", and "Appointment Statistics" reports. | ||
<pre>'; | ||
|
||
case version_compare($current_version, '2.0.6', '<'): | ||
$db = new PHPWS_DB; | ||
$result = $db->importFile(PHPWS_SOURCE_DIR . | ||
'mod/slc/boost/updates/update_2_0_6.sql'); | ||
if(PHPWS_Error::logIfError($result)){ | ||
return $result; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
function slcUpdateFiles($files, &$content) { | ||
if (PHPWS_Boost::updateFiles($files, 'checkin')) { | ||
$content[] = '--- Updated the following files:'; | ||
} else { | ||
$content[] = '--- Unable to update the following files:'; | ||
} | ||
$content[] = " " . implode("\n ", $files); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
-- Drop empty/unused/never-referenced tables | ||
DROP TABLE slc_client_detail_index, | ||
slc_detail, | ||
slc_issue_detail_index, | ||
slc_visit_detail_index, | ||
slc_visit_issue_date_index; | ||
|
||
-- Delete issue records with problem IDs that don't exist. | ||
DELETE slc_issue.* | ||
FROM slc_issue | ||
WHERE slc_issue.problem_id NOT IN ( | ||
SELECT slc_problem.id FROM slc_problem | ||
); | ||
|
||
-- Delete visit records with client IDs that don't exist. | ||
DELETE slc_visit.* | ||
FROM slc_visit | ||
WHERE slc_visit.c_id NOT IN ( | ||
SELECT id FROM slc_client | ||
); | ||
|
||
-- Delete slc_visit_issue_index records with issue IDs that don't exist. | ||
DELETE slc_visit_issue_index.* | ||
FROM slc_visit_issue_index | ||
WHERE slc_visit_issue_index.i_id NOT IN ( | ||
SELECT slc_issue.id FROM slc_issue | ||
); | ||
|
||
-- Delete slc_visit_issue_index records with visit IDs that don't exist. | ||
DELETE slc_visit_issue_index.* | ||
FROM slc_visit_issue_index | ||
WHERE slc_visit_issue_index.v_id NOT IN ( | ||
SELECT slc_visit.id FROM slc_visit | ||
); | ||
|
||
-- Delete visit records without an associated slc_visit_issue_index record. | ||
DELETE slc_visit.* | ||
FROM slc_visit | ||
WHERE slc_visit.id NOT IN ( | ||
SELECT v_id FROM slc_visit_issue_index | ||
); | ||
|
||
-- Delete issue records without an associated slc_visit_issue_index record. | ||
DELETE slc_issue.* | ||
FROM slc_issue | ||
WHERE slc_issue.id NOT IN ( | ||
SELECT i_id FROM slc_visit_issue_index | ||
); | ||
|
||
-- Then delete client records without associated visits. | ||
DELETE slc_client.* | ||
FROM slc_client | ||
WHERE slc_client.id NOT IN ( | ||
SELECT c_id FROM slc_visit | ||
); | ||
|
||
-- Merge all 'Criminal' sub-types into the main 'Criminal' type | ||
UPDATE slc_issue | ||
SET problem_id=998 | ||
WHERE problem_id IN ( | ||
25,26,27,28,29,30,31,32,33,34,995 | ||
); |
Oops, something went wrong.