Skip to content

Commit

Permalink
Merge pull request #1492 from gluneau/CouchDB-getSubproject-and-getPr…
Browse files Browse the repository at this point in the history
…oject

replaced old methods of getting projectlist and subproject list
  • Loading branch information
driusan committed Jan 22, 2016
2 parents 0cf4079 + cb9e8a2 commit 76eef03
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tools/CouchDB_Import_Demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,17 @@ function __construct() {

function _getSubproject($id) {
$config = NDB_Config::singleton();
$subprojsXML = $config->getSetting("subprojects");
$subprojs = $subprojsXML['subproject'];
foreach($subprojs as $subproj) {
if($subproj['id'] == $id) {
return $subproj['title'];
}
$subprojs = $config->getSubprojectSettings($id);
if($subprojs['id'] == $id) {
return $subprojs['title'];
}
}

function _getProject($id) {
$config = NDB_Config::singleton();
$subprojsXML = $config->getSetting("Projects");
$subprojs = $subprojsXML['project'];
foreach($subprojs as $subproj) {
if($subproj['id'] == $id) {
return $subproj['title'];
}
$projs = $config->getProjectSettings($id);
if($projs['id'] == $id) {
return $projs['Name'];
}
}

Expand Down

0 comments on commit 76eef03

Please sign in to comment.