From b0b366959e4f853f11498d9069acd2f7da8abfdd Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Tue, 19 Jan 2016 13:04:15 -0500 Subject: [PATCH 1/3] replaced old methods of getting projectlist and subproject list --- tools/CouchDB_Import_Demographics.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/CouchDB_Import_Demographics.php b/tools/CouchDB_Import_Demographics.php index c1217dcb3e3..dbc3e7a74d0 100644 --- a/tools/CouchDB_Import_Demographics.php +++ b/tools/CouchDB_Import_Demographics.php @@ -94,9 +94,7 @@ function __construct() { } function _getSubproject($id) { - $config = NDB_Config::singleton(); - $subprojsXML = $config->getSetting("subprojects"); - $subprojs = $subprojsXML['subproject']; + $subprojs = Utility::getSubprojectList(); foreach($subprojs as $subproj) { if($subproj['id'] == $id) { return $subproj['title']; @@ -105,9 +103,7 @@ function _getSubproject($id) { } function _getProject($id) { - $config = NDB_Config::singleton(); - $subprojsXML = $config->getSetting("Projects"); - $subprojs = $subprojsXML['project']; + $subprojs = Utility::getProjectList(); foreach($subprojs as $subproj) { if($subproj['id'] == $id) { return $subproj['title']; From 318d147c6db5d21f7076e549509d50fa953f4cae Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Tue, 19 Jan 2016 14:13:58 -0500 Subject: [PATCH 2/3] using $config->getSubprojectSettings and $config->getProjectSettings --- tools/CouchDB_Import_Demographics.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/CouchDB_Import_Demographics.php b/tools/CouchDB_Import_Demographics.php index dbc3e7a74d0..675ec2e535f 100644 --- a/tools/CouchDB_Import_Demographics.php +++ b/tools/CouchDB_Import_Demographics.php @@ -94,20 +94,18 @@ function __construct() { } function _getSubproject($id) { - $subprojs = Utility::getSubprojectList(); - foreach($subprojs as $subproj) { - if($subproj['id'] == $id) { - return $subproj['title']; - } + $config = NDB_Config::singleton(); + $subprojs = $config->getSubprojectSettings($id); + if($subprojs['id'] == $id) { + return $subprojs['title']; } } function _getProject($id) { - $subprojs = Utility::getProjectList(); - foreach($subprojs as $subproj) { - if($subproj['id'] == $id) { - return $subproj['title']; - } + $config = NDB_Config::singleton(); + $subprojs = $config->getProjectSettings($id); + if($subprojs['id'] == $id) { + return $subprojs['Name']; } } From cb9e8a2ad14750e635ce8a473f8c6854889faebd Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Wed, 20 Jan 2016 10:05:14 -0500 Subject: [PATCH 3/3] variable name change to project related --- tools/CouchDB_Import_Demographics.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/CouchDB_Import_Demographics.php b/tools/CouchDB_Import_Demographics.php index 675ec2e535f..4284882ae83 100644 --- a/tools/CouchDB_Import_Demographics.php +++ b/tools/CouchDB_Import_Demographics.php @@ -103,9 +103,9 @@ function _getSubproject($id) { function _getProject($id) { $config = NDB_Config::singleton(); - $subprojs = $config->getProjectSettings($id); - if($subprojs['id'] == $id) { - return $subprojs['Name']; + $projs = $config->getProjectSettings($id); + if($projs['id'] == $id) { + return $projs['Name']; } }