From: <gem...@li...> - 2011-11-28 12:00:41
|
Revision: 297 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=297&view=rev Author: mennodekker Date: 2011-11-28 12:00:31 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Don't remove public functions without notice Modified Paths: -------------- trunk/library/classes/Gems/Util/DbLookup.php Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 11:55:18 UTC (rev 296) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 12:00:31 UTC (rev 297) @@ -75,7 +75,29 @@ */ protected $session; + /** + * Retrieve a list of orgid/name pairs + * + * @staticvar array $organizations + * @return array + */ + public function getActiveOrganizations() + { + static $organizations; + if (! $organizations) { + $orgId = GemsEscort::getInstance()->getCurrentOrganization(); + $organizations = $this->db->fetchPairs(' + SELECT gor_id_organization, gor_name + FROM gems__organizations + WHERE (gor_active=1 AND + gor_id_organization IN (SELECT gr2o_id_organization FROM gems__respondent2org)) OR + gor_id_organization = ? + ORDER BY gor_name', $orgId); + } + + return $organizations; + } /** * Return key/value pairs of all active staff members * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |