From: <gem...@li...> - 2011-10-24 11:30:51
|
Revision: 129 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=129&view=rev Author: mennodekker Date: 2011-10-24 11:30:45 +0000 (Mon, 24 Oct 2011) Log Message: ----------- getStaff now returns only active staff 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-10-24 11:18:29 UTC (rev 128) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-10-24 11:30:45 UTC (rev 129) @@ -213,13 +213,19 @@ return $roles; } + /** + * Return key/value pairs of all active staff members + * + * @staticvar array $data + * @return array + */ public function getStaff() { static $data; if (! $data) { $data = $this->db->fetchPairs("SELECT gsf_id_user, CONCAT(COALESCE(gsf_last_name, '-'), ', ', COALESCE(gsf_first_name, ''), COALESCE(CONCAT(' ', gsf_surname_prefix), '')) - FROM gems__staff ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); + FROM gems__staff WHERE gsf_active = 1 ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); } return $data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-28 11:55:24
|
Revision: 296 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=296&view=rev Author: michieltcs Date: 2011-11-28 11:55:18 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Return all organizations if gor_has_login column does not (yet) exist 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:37:20 UTC (rev 295) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 11:55:18 UTC (rev 296) @@ -224,7 +224,11 @@ static $organizations; if (! $organizations) { - $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 AND gor_has_login=1 ORDER BY gor_name'); + try { + $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 AND gor_has_login=1 ORDER BY gor_name'); + } catch (Exception $e) { + $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 ORDER BY gor_name'); + } natsort($organizations); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <gem...@li...> - 2012-01-05 10:54:24
|
Revision: 395 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=395&view=rev Author: mennodekker Date: 2012-01-05 09:27:33 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Do NOT translate roles (only used in the groups display) to prevent confusion Modified Paths: -------------- trunk/library/classes/Gems/Util/DbLookup.php Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-01-03 10:54:48 UTC (rev 394) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-01-05 09:27:33 UTC (rev 395) @@ -299,7 +299,8 @@ if ($this->acl) { foreach ($this->acl->getRoles() as $role) { - $roles[$role] = $this->translate->_(ucfirst($role)); + //Do not translate, only make first one uppercase + $roles[$role] = ucfirst($role); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-05-30 14:09:22
|
Revision: 708 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=708&view=rev Author: mennodekker Date: 2012-05-30 14:09:16 +0000 (Wed, 30 May 2012) Log Message: ----------- Add helper to find all organizations with the same gor_code Modified Paths: -------------- trunk/library/classes/Gems/Util/DbLookup.php Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-05-30 14:06:59 UTC (rev 707) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-05-30 14:09:16 UTC (rev 708) @@ -236,6 +236,30 @@ } /** + * Get all organizations that share a given code + * + * On empty this will return all organizations + * + * @staticvar array $organizations + * @param string $code + * @return array key = gor_id_organization, value = gor_name + */ + public function getOrganizationsByCode($code = null) + { + static $organizations = array(); + + if (is_null($code)) { + return $this->getOrganizations(); + } + + if (!isset($organizations[$code])) { + $organizations[$code] = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 and gor_code=? ORDER BY gor_name', array($code)); + } + + return $organizations[$code]; + } + + /** * Returns a list of the organizations where users can login. * * @staticvar array $organizations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-23 10:52:32
|
Revision: 867 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=867&view=rev Author: mennodekker Date: 2012-07-23 10:52:21 +0000 (Mon, 23 Jul 2012) Log Message: ----------- Fetch all surveys in a track, also the ones that are not in the rounds table and the ones that don't have responses yet Modified Paths: -------------- trunk/library/classes/Gems/Util/DbLookup.php Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-07-23 10:48:56 UTC (rev 866) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-07-23 10:52:21 UTC (rev 867) @@ -357,15 +357,14 @@ // Read some data from tables, initialize defaults... $select = $this->db->select(); - // Fetch al surveys + // Fetch all surveys $select->from('gems__surveys') ->join('gems__sources', 'gsu_id_source = gso_id_source') ->where('gso_active = 1') - ->where('gsu_id_survey IN (SELECT gto_id_survey FROM gems__tokens WHERE gto_completion_time IS NOT NULL)') ->order(array('gsu_active DESC', 'gsu_survey_name')); if ($trackId) { - $select->where('gsu_id_survey IN (SELECT gro_id_survey FROM gems__rounds WHERE gro_id_track = ?)', $trackId); + $select->where('gsu_id_survey IN (SELECT gto_id_survey FROM gems__tokens WHERE gto_id_track = ?)', $trackId); } $result = $this->db->fetchAll($select); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |