From: <gem...@li...> - 2012-02-09 11:46:33
|
Revision: 466 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=466&view=rev Author: matijsdejong Date: 2012-02-09 11:46:23 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Version numbers update to 1.5.1 Track fields with code names added to mail template variables New _layoutLogin moved to GemsEscort Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Default/MailJobAction.php branches/1.5.x/library/classes/Gems/Versions.php branches/1.5.x/library/classes/GemsEscort.php branches/1.5.x/library/classes/MUtil/Version.php branches/1.5.x/library/configs/db/patches.sql Modified: branches/1.5.x/library/classes/Gems/Default/MailJobAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/MailJobAction.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/Gems/Default/MailJobAction.php 2012-02-09 11:46:23 UTC (rev 466) @@ -111,7 +111,7 @@ $model->set('gmj_from_fixed', 'label', $this->_('From other'), 'description', sprintf($this->_("Only when '%s' is '%s'."), $model->get('gmj_from_method', 'label'), end($fromMethods))); } - $model->set('gmj_process_method', 'label', $this->_('Processing Method'), 'multiOptions', $unselected + $translated->getBulkMailProcessOptions()); + $model->set('gmj_process_method', 'label', $this->_('Processing Method'), 'default', 'O', 'multiOptions', $translated->getBulkMailProcessOptions()); $model->set('gmj_filter_mode', 'label', $this->_('Filter for'), 'multiOptions', $unselected + $this->getBulkMailFilterOptions()); $model->set('gmj_filter_days_between', 'label', $this->_('Days between reminders'), 'validators[]', 'Digits'); Modified: branches/1.5.x/library/classes/Gems/Versions.php =================================================================== --- branches/1.5.x/library/classes/Gems/Versions.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/Gems/Versions.php 2012-02-09 11:46:23 UTC (rev 466) @@ -43,12 +43,12 @@ { public final function getBuild() { - return 43; + return 44; } public final function getGemsVersion() { - return '1.5'; + return '1.5.1'; } public function getProjectVersion() Modified: branches/1.5.x/library/classes/GemsEscort.php =================================================================== --- branches/1.5.x/library/classes/GemsEscort.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/GemsEscort.php 2012-02-09 11:46:23 UTC (rev 466) @@ -719,12 +719,42 @@ } /** + * Display either a link to the login screen or displays the name of the current user + * and a logoff link. + * * Function called if specified in the Project.ini layoutPrepare section before * the layout is drawn, but after the rest of the program has run it's course. * * @return mixed If null nothing is set, otherwise the name of * the function is used as Zend_View variable name. */ + protected function _layoutLogin(array $args = null) + { + $user = $this->getLoader()->getCurrentUser(); + + $div = MUtil_Html::create('div', array('id' => 'login'), $args); + + $p = $div->p(); + if ($user->isActive()) { + $p->append(sprintf($this->_('You are logged in as %s'), $user->getFullName())); + $item = $this->menu->findFirst(array($this->request->getControllerKey() => 'index', $this->request->getActionKey() => 'logoff')); + $p->a($item->toHRefAttribute(), $this->_('Logoff'), array('class' => 'logout')); + } else { + $item = $this->menu->findFirst(array($this->request->getControllerKey() => 'index', $this->request->getActionKey() => 'login')); + $p->a($item->toHRefAttribute(), $this->_('You are not logged in'), array('class' => 'logout')); + } + $item->set('visible', false); + + return $div; + } + + /** + * Function called if specified in the Project.ini layoutPrepare section before + * the layout is drawn, but after the rest of the program has run it's course. + * + * @return mixed If null nothing is set, otherwise the name of + * the function is used as Zend_View variable name. + */ protected function _layoutMessages(array $args = null) { // Do not trust $messenger being set in the view, @@ -1609,6 +1639,13 @@ return $this; } + /** + * Returns an array of {field_names} => values for this token for + * use in an e-mail tamplate. + * + * @param array $tokenData + * @return array + */ public function tokenMailFields(array $tokenData) { $locale = isset($tokenData['grs_iso_lang']) ? $tokenData['grs_iso_lang'] : $this->locale; @@ -1668,6 +1705,19 @@ $result['{track}'] = $tokenData['gtr_track_name']; + $join = $this->db->quoteInto('gtf_id_field = gr2t2f_id_field AND gr2t2f_id_respondent_track = ?', $tokenData['gto_id_respondent_track']); + $select = $this->db->select(); + $select->from('gems__track_fields', array(new Zend_Db_Expr("CONCAT('{track.', gtf_field_code, '}')"))) + ->joinLeft('gems__respondent2track2field', $join, array('gr2t2f_value')) + ->distinct() + ->where('gtf_field_code IS NOT NULL') + ->order('gtf_field_code'); + $codes = $this->db->fetchPairs($select); + + $result = $result + $codes; + // MUtil_Echo::track($codes); + + return $result; } } Modified: branches/1.5.x/library/classes/MUtil/Version.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Version.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/MUtil/Version.php 2012-02-09 11:46:23 UTC (rev 466) @@ -34,7 +34,7 @@ { const MAJOR = 1; const MINOR = 0; - const BUILD = 30; + const BUILD = 31; public static function get() { Modified: branches/1.5.x/library/configs/db/patches.sql =================================================================== --- branches/1.5.x/library/configs/db/patches.sql 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/configs/db/patches.sql 2012-02-09 11:46:23 UTC (rev 466) @@ -366,5 +366,6 @@ ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`; ALTER TABLE `gems__radius_config` CHANGE `grcfg_ip` `grcfg_ip` VARCHAR( 39 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL +-- GEMS VERSION: 44 -- PATCH: Add icon field to rounds ALTER TABLE `gems__rounds` ADD gro_icon_file VARCHAR(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gro_round_description`; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |