You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2012-01-11 15:18:52
|
Revision: 405 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=405&view=rev Author: matijsdejong Date: 2012-01-11 15:18:41 +0000 (Wed, 11 Jan 2012) Log Message: ----------- function relocated by alphabet Modified Paths: -------------- trunk/new_project/htdocs/gems/js/autoSubmitForm.js Modified: trunk/new_project/htdocs/gems/js/autoSubmitForm.js =================================================================== --- trunk/new_project/htdocs/gems/js/autoSubmitForm.js 2012-01-11 15:18:06 UTC (rev 404) +++ trunk/new_project/htdocs/gems/js/autoSubmitForm.js 2012-01-11 15:18:41 UTC (rev 405) @@ -44,6 +44,12 @@ } }, + error: function (request, status) { + if (request.status === 401) { + location.href = location.href; + } + }, + filter: function () { //If we have a pending request and want to create a new one, cancel the first @@ -78,12 +84,6 @@ } } }, - - error: function (request, status) { - if (request.status === 401) { - location.href = location.href; - } - }, success: function (data, status, request) { jQuery(this.options.targetId).html(data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-11 15:18:13
|
Revision: 404 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=404&view=rev Author: matijsdejong Date: 2012-01-11 15:18:06 +0000 (Wed, 11 Jan 2012) Log Message: ----------- Pushing progress on progress Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php trunk/library/classes/MUtil/Html/ProgressPanel.php trunk/library/classes/MUtil/Html/ProgressPanelPush.js Added Paths: ----------- trunk/library/classes/MUtil/Html/ProgressPanelPull.js Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-01-06 14:09:20 UTC (rev 403) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-01-11 15:18:06 UTC (rev 404) @@ -253,7 +253,7 @@ // ../handlers/add name="CGI-exe" // add attribute responseBufferLimit="1024" - for ($i = 0; $i < 100; $i += 1) { + for ($i = 50; $i < 100; $i += 10) { if ($i < 20) { $text = 'Just beginning'; } else if ($i < 50) { @@ -264,9 +264,9 @@ $text = 'Nearly done'; } // IIS? - echo str_repeat(' ',1024*3); + // echo str_repeat(' ',1024*3); $progress->update($i, ' ' . $text); - sleep(15); + sleep(1); } $progress->finish(); } // */ Modified: trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php =================================================================== --- trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php 2012-01-06 14:09:20 UTC (rev 403) +++ trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php 2012-01-11 15:18:06 UTC (rev 404) @@ -164,6 +164,26 @@ } /** + * Sets the default value for a field to search and replace in the content. + * + * Used to set the value only when it is empty. + * + * No markers are used. If you want to replace '{path}' with 'x', you + * must specificy the name '{path}', not 'path'. + * + * @param string $name Full name to replace. + * @param string $value The value placed. + * @return MUtil_Html_Link_LinkAbstract (continuation pattern) + */ + public function setDefault($name, $value) + { + if (! isset($this->_fields[$name])) { + $this->_fields[$name] = $value; + } + return $this; + } + + /** * Set a field to search and replace in the content. * * No markers are used. If you want to replace '{path}' with 'x', you Modified: trunk/library/classes/MUtil/Html/ProgressPanel.php =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanel.php 2012-01-06 14:09:20 UTC (rev 403) +++ trunk/library/classes/MUtil/Html/ProgressPanel.php 2012-01-11 15:18:06 UTC (rev 404) @@ -83,6 +83,13 @@ ); /** + * When true the progressbar should start immediately. When false the user has to perform an action. + * + * @var boolean + */ + protected $_autoStart = true; + + /** * When content must contain certain element types only the default child tag contains * the tagname of the element that is created to contain the content. * @@ -140,6 +147,13 @@ ); /** + * The mode to use for the panel: push or pull + * + * @var string + */ + public $method = 'Pull'; + + /** * The name of the parameter used for progress panel signals * * @var string @@ -196,12 +210,8 @@ public function getCode() { if (! isset($this->_content[self::CODE])) { - $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanelPush.js'); - // $js->setInHeader(false); - $js->setField('FUNCTION_PREFIX_', $this->getFunctionPrefix()); - $js->setField('{TEXT_TAG}', $this->_defaultChildTag); - $js->setField('{TEXT_CLASS}', $this->progressTextClass); - $js->setField('{ID}', $this->getAttrib('id')); + $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanel' . $this->method . '.js'); + $js->setInHeader(false); $this->_content[self::CODE] = $js; } @@ -242,7 +252,11 @@ public function getProgressBarAdapter() { if (! $this->_progressBarAdapter instanceof Zend_ProgressBar_Adapter) { - $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPush()); + if ($this->method == 'Pull') { + $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPull()); + } else { + $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPush()); + } } return $this->_progressBarAdapter; @@ -274,11 +288,15 @@ { ZendX_JQuery::enableView($view); - if ($this->getProgressBarAdapter() instanceof Zend_ProgressBar_Adapter_JsPush) { + if ($this->getProgressBarAdapter() instanceof Zend_ProgressBar_Adapter) { $js = $this->getCode(); - if (! $js->hasField('{URL}')) { - $js->setField('{URL}', $view->url(array($this->progressParameterName => $this->progressParameterRunValue))); - } + + // Set the fields, in case they where not set earlier + $js->setDefault('__AUTOSTART__', $this->_autoStart ? 'true' : 'false'); + $js->setDefault('{ID}', $this->getAttrib('id')); + $js->setDefault('{TEXT_TAG}', $this->_defaultChildTag); + $js->setDefault('{TEXT_CLASS}', $this->progressTextClass); + $js->setDefault('{URL}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterRunValue)), "/")); } if ($this->_lastChild) { @@ -344,7 +362,11 @@ public function setProgressBarAdapter(Zend_ProgressBar_Adapter $adapter) { if ($adapter instanceof Zend_ProgressBar_Adapter_JsPush) { + $js = $this->getCode(); $prefix = $this->getFunctionPrefix(); + + // Set the fields, in case they where not set earlier + $js->setDefault('FUNCTION_PREFIX_', $prefix); $adapter->setUpdateMethodName($prefix . 'Update'); $adapter->setFinishMethodName($prefix . 'Finish'); } Added: trunk/library/classes/MUtil/Html/ProgressPanelPull.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanelPull.js (rev 0) +++ trunk/library/classes/MUtil/Html/ProgressPanelPull.js 2012-01-11 15:18:06 UTC (rev 404) @@ -0,0 +1,86 @@ + + +// Creating the widget +jQuery.widget("ui.pullProgressPanel", { + + // default options + options: { + autoStart: false, + // target: the element whose content is replaced + timeout: 2000 + // url: the request url + }, + + _init: function() { + if (this.options.autoStart) { + this.start(); + } + }, + + complete: function (request, status) { + this.request = null; + + // Check for changes + // - if the input field was changed since the last request + // filter() will search on the new value + // - if the input field has not changed, then no new request + // is made. + // this.start(); + }, + + error: function (request, status) { + console.log(status); + /* if (request.status === 401) { + location.href = location.href; + } // */ + }, + + start: function() { + if (this.request == null) { + if (this.options.url) { + var self = this; + this.request = jQuery.ajax({ + url: this.options.url, + type: "GET", + dataType: "json", + // data: postData, + error: function(request, status, error) {self.error(request, status);}, + complete: function(request, status) {self.complete(request, status);}, + success: function(data, status, request) {self.success(data, status, request);} + }); + + } + } + }, + + success: function (data, status, request) { + // console.log(stringdata); + // data = jQuery.parseJSON(stringdata); + console.log(data); + + text = data.percent + '%'; + if (data.text) { + text = text + data.text; + } + + jQuery(this.options.target).html(text); + }, + + request: null +}); + +jQuery(document).ready(function() { + jQuery("#{ID}").pullProgressPanel({"url":"{URL}","autoStart":__AUTOSTART__,"target":"#{ID} {TEXT_TAG}.{TEXT_CLASS}"}); +}); + +function FUNCTION_PREFIX_Finish() +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", 100); + + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + if (inner) { + inner.empty(); + inner.append('100% Done!'); + } +} Modified: trunk/library/classes/MUtil/Html/ProgressPanelPush.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanelPush.js 2012-01-06 14:09:20 UTC (rev 403) +++ trunk/library/classes/MUtil/Html/ProgressPanelPush.js 2012-01-11 15:18:06 UTC (rev 404) @@ -16,13 +16,13 @@ value: data.percent }); - inner = main.find('.{TEXT_CLASS}'); + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); if (inner) { - inner.empty(); - inner.append(data.percent + '%'); + text = data.percent + '%'; if (data.text) { - inner.append(data.text); + text = text + data.text; } + inner.html(text); } } @@ -39,8 +39,8 @@ } -// FUNCTION_PREFIX_Start(); - -// jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: 'Hi'})); -// jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: ''})); -jQuery().ready(FUNCTION_PREFIX_Start()); +if (__AUTOSTART__) { + // jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: 'Hi'})); + // jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: ''})); + jQuery().ready(FUNCTION_PREFIX_Start()); +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-06 14:09:26
|
Revision: 403 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=403&view=rev Author: mennodekker Date: 2012-01-06 14:09:20 +0000 (Fri, 06 Jan 2012) Log Message: ----------- reverting #400 and committing other fix for the same problem Modified Paths: -------------- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Modified: trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-06 14:02:50 UTC (rev 402) +++ trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-06 14:09:20 UTC (rev 403) @@ -157,10 +157,10 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems($model); + $this->initItems(); //And any remaining item - $this->addItems($bridge, $model, $this->_items); + $this->addItems($bridge, $this->_items); } /** @@ -171,22 +171,22 @@ * * @return void */ - protected function addItems(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, $element1) + protected function addItems(MUtil_Model_FormBridge $bridge, $element1) { $args = func_get_args(); - if (count($args) < 3) { - throw new Gems_Exception_Coding('Use at least 3 arguments; bridge, model and then one or more individual items'); + if (count($args)<2) { + throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more idividual items'); } $bridge = array_shift($args); - $model = array_shift($args); $elements = MUtil_Ra::flatten($args); //Remove the elements from the _items variable $this->_items = array_diff($this->_items, $elements); - + //And add them to the bridge foreach($elements as $name) { + $model = $this->getModel(); if ($label = $model->get($name, 'label')) { $bridge->add($name); } else { @@ -362,9 +362,10 @@ /** * Initialize the _items variable to hold all items from the model */ - protected function initItems(MUtil_Model_ModelAbstract $model) + protected function initItems() { if (is_null($this->_items)) { + $model = $this->getModel(); $this->_items = $model->getItemsOrdered(); } } @@ -549,4 +550,4 @@ // Note we use an MUtil_Form return $this->_form->isValid($this->formData, $this->disableValidatorTranslation); } -} +} \ No newline at end of file Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-06 14:02:50 UTC (rev 402) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-06 14:09:20 UTC (rev 403) @@ -64,7 +64,7 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems($model); + $this->initItems(); //Create our tab structure first check if tab already exists to allow extension if (!($bridge->getTab('general'))) { @@ -72,17 +72,17 @@ } //Need the first two together for validation $bridge->addHtml('org')->b($this->_('Organization')); - $this->addItems($bridge, $model, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); + $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); $bridge->addHtml('contact')->b($this->_('Contact')); $bridge->addHtml('contact_desc')->i($this->_('The contact details for this organization, used for emailing.')); - $this->addItems($bridge, $model, 'gor_contact_name', 'gor_contact_email'); + $this->addItems($bridge, 'gor_contact_name', 'gor_contact_email'); $bridge->addHtml('general_other')->b($this->_('Other')); - $this->addItems($bridge, $model, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); + $this->addItems($bridge, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); if (!($bridge->getTab('email'))) { $bridge->addTab('email', 'value', $this->_('Email') . ' & ' . $this->_('Token')); } - $this->addItems($bridge, $model, 'gor_welcome', 'gor_signature'); + $this->addItems($bridge, 'gor_welcome', 'gor_signature'); if (!($bridge->getTab('access'))) { $bridge->addTab('access', 'value', $this->_('Access')); @@ -94,7 +94,7 @@ unset($multiOptions[$this->formData['gor_id_organization']]); $model->set('gor_accessible_by', 'multiOptions', $multiOptions); } - $this->addItems($bridge, $model, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); + $this->addItems($bridge, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); //Show what organizations we can access if (isset($this->formData['gor_id_organization']) && !empty($this->formData['gor_id_organization'])) { @@ -106,7 +106,7 @@ $bridge->addExhibitor('allowed', 'value', $display, 'label', $this->_('Can access')); } - $this->addItems($bridge, $model, 'gor_user_class'); + $this->addItems($bridge, 'gor_user_class'); if (isset($this->formData['gor_user_class']) && !empty($this->formData['gor_user_class'])) { $class = $this->formData['gor_user_class'] . 'Definition'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-06 14:02:59
|
Revision: 402 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=402&view=rev Author: mennodekker Date: 2012-01-06 14:02:50 +0000 (Fri, 06 Jan 2012) Log Message: ----------- Fixed parameterCollector to not return empty values and updated doc/debug Modified Paths: -------------- trunk/library/classes/Gems/Menu/ParameterCollector.php trunk/library/classes/Gems/Menu/SubMenuItem.php trunk/library/classes/Gems/Menu.php Modified: trunk/library/classes/Gems/Menu/ParameterCollector.php =================================================================== --- trunk/library/classes/Gems/Menu/ParameterCollector.php 2012-01-06 14:01:17 UTC (rev 401) +++ trunk/library/classes/Gems/Menu/ParameterCollector.php 2012-01-06 14:02:50 UTC (rev 402) @@ -81,7 +81,7 @@ */ public function getMenuParameter($name, $altname = null) { - if (array_key_exists($name, $this->values)) { + if (array_key_exists($name, $this->values) && ! empty($this->values[$name])) { return $this->values[$name]; } @@ -89,7 +89,7 @@ foreach ($this->sources as $source) { if ($source instanceof Zend_Controller_Request_Abstract) { $value = $source->getParam($name, null); - if (null === $value) { + if (null === $value || empty($value)) { $value = $source->getParam($altname, $this->values[$name]); } $this->values[$name] = $value; @@ -106,7 +106,7 @@ $this->values[$name] = $source[$name]; } } - if (null !== $this->values[$name]) { + if (null !== $this->values[$name] && ! empty($this->values[$name])) { break; } } Modified: trunk/library/classes/Gems/Menu/SubMenuItem.php =================================================================== --- trunk/library/classes/Gems/Menu/SubMenuItem.php 2012-01-06 14:01:17 UTC (rev 401) +++ trunk/library/classes/Gems/Menu/SubMenuItem.php 2012-01-06 14:02:50 UTC (rev 402) @@ -153,7 +153,9 @@ if ($this->_parameters && is_array($this->_parameters)) { foreach ($this->_parameters as $param => $name) { $parameters[$param] = $source->getMenuParameter($name, $param); - // MUtil_Echo::r($param . '/' . $name . ' => ' . $value, $this->get('label')); + if (Gems_Menu::$verbose) { + MUtil_Echo::r($param . '/' . $name . ' => ' . $parameters[$param], $this->get('label')); + } } } Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2012-01-06 14:01:17 UTC (rev 401) +++ trunk/library/classes/Gems/Menu.php 2012-01-06 14:02:50 UTC (rev 402) @@ -451,7 +451,7 @@ /** * - * @return Gems_Menu_MenuAbstract + * @return Gems_Menu_SubMenuItem */ public function getCurrentParent() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-06 14:01:23
|
Revision: 401 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=401&view=rev Author: mennodekker Date: 2012-01-06 14:01:17 +0000 (Fri, 06 Jan 2012) Log Message: ----------- Fix RespondentTrack throwing an error after update and getFirstToken() Modified Paths: -------------- trunk/library/classes/Gems/Tracker/RespondentTrack.php Modified: trunk/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- trunk/library/classes/Gems/Tracker/RespondentTrack.php 2012-01-06 10:22:34 UTC (rev 400) +++ trunk/library/classes/Gems/Tracker/RespondentTrack.php 2012-01-06 14:01:17 UTC (rev 401) @@ -534,7 +534,9 @@ if (true === $refresh) { unset($this->_tokens); unset($this->_activeTokens); - unset($this->_firstToken); + //Next line will cause errors later on when we refresh the tokens, getFirstToken() will then throw an error + //unset($this->_firstToken); + $this->_firstToken = null; } $this->_tokens = array(); $this->_activeTokens = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-06 10:22:41
|
Revision: 400 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=400&view=rev Author: michieltcs Date: 2012-01-06 10:22:34 +0000 (Fri, 06 Jan 2012) Log Message: ----------- Pass to initItems() and addItems() Modified Paths: -------------- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Modified: trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-05 12:48:04 UTC (rev 399) +++ trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-06 10:22:34 UTC (rev 400) @@ -157,10 +157,10 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems(); + $this->initItems($model); //And any remaining item - $this->addItems($bridge, $this->_items); + $this->addItems($bridge, $model, $this->_items); } /** @@ -171,22 +171,23 @@ * * @return void */ - protected function addItems(MUtil_Model_FormBridge $bridge, $element1) + protected function addItems(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, $element1) { $args = func_get_args(); - if (count($args)<2) { - throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more idividual items'); + if (count($args) < 3) { + throw new Gems_Exception_Coding('Use at least 3 arguments; bridge, model and then one or more individual items'); } $bridge = array_shift($args); + $model = array_shift($args); $elements = MUtil_Ra::flatten($args); //Remove the elements from the _items variable $this->_items = array_diff($this->_items, $elements); - + //And add them to the bridge foreach($elements as $name) { - if ($label = $this->model->get($name, 'label')) { + if ($label = $model->get($name, 'label')) { $bridge->add($name); } else { $bridge->addHidden($name); @@ -361,10 +362,10 @@ /** * Initialize the _items variable to hold all items from the model */ - protected function initItems() + protected function initItems(MUtil_Model_ModelAbstract $model) { if (is_null($this->_items)) { - $this->_items = $this->model->getItemsOrdered(); + $this->_items = $model->getItemsOrdered(); } } Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-05 12:48:04 UTC (rev 399) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-06 10:22:34 UTC (rev 400) @@ -64,7 +64,7 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems(); + $this->initItems($model); //Create our tab structure first check if tab already exists to allow extension if (!($bridge->getTab('general'))) { @@ -72,17 +72,17 @@ } //Need the first two together for validation $bridge->addHtml('org')->b($this->_('Organization')); - $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); + $this->addItems($bridge, $model, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); $bridge->addHtml('contact')->b($this->_('Contact')); $bridge->addHtml('contact_desc')->i($this->_('The contact details for this organization, used for emailing.')); - $this->addItems($bridge, 'gor_contact_name', 'gor_contact_email'); + $this->addItems($bridge, $model, 'gor_contact_name', 'gor_contact_email'); $bridge->addHtml('general_other')->b($this->_('Other')); - $this->addItems($bridge, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); + $this->addItems($bridge, $model, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); if (!($bridge->getTab('email'))) { $bridge->addTab('email', 'value', $this->_('Email') . ' & ' . $this->_('Token')); } - $this->addItems($bridge, 'gor_welcome', 'gor_signature'); + $this->addItems($bridge, $model, 'gor_welcome', 'gor_signature'); if (!($bridge->getTab('access'))) { $bridge->addTab('access', 'value', $this->_('Access')); @@ -94,7 +94,7 @@ unset($multiOptions[$this->formData['gor_id_organization']]); $model->set('gor_accessible_by', 'multiOptions', $multiOptions); } - $this->addItems($bridge, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); + $this->addItems($bridge, $model, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); //Show what organizations we can access if (isset($this->formData['gor_id_organization']) && !empty($this->formData['gor_id_organization'])) { @@ -106,7 +106,7 @@ $bridge->addExhibitor('allowed', 'value', $display, 'label', $this->_('Can access')); } - $this->addItems($bridge, 'gor_user_class'); + $this->addItems($bridge, $model, 'gor_user_class'); if (isset($this->formData['gor_user_class']) && !empty($this->formData['gor_user_class'])) { $class = $this->formData['gor_user_class'] . 'Definition'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-05 12:48:11
|
Revision: 399 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=399&view=rev Author: mennodekker Date: 2012-01-05 12:48:04 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Some explorations on testing Modified Paths: -------------- trunk/test/classes/MUtil/DateTest.php Added Paths: ----------- trunk/test/classes/MUtil/Model/ trunk/test/classes/MUtil/Model/FormBridgeTest.php trunk/test/data/ trunk/test/data/TestModel.php Modified: trunk/test/classes/MUtil/DateTest.php =================================================================== --- trunk/test/classes/MUtil/DateTest.php 2012-01-05 12:21:11 UTC (rev 398) +++ trunk/test/classes/MUtil/DateTest.php 2012-01-05 12:48:04 UTC (rev 399) @@ -5,7 +5,7 @@ * Test class for Gems_Event_EventCalculations. * Generated by PHPUnit on 2011-08-15 at 09:44:58. */ -class Mutil_DateTest extends PHPUnit_Framework_TestCase +class MUtil_DateTest extends PHPUnit_Framework_TestCase { /** * @var Mutil_Date Added: trunk/test/classes/MUtil/Model/FormBridgeTest.php =================================================================== --- trunk/test/classes/MUtil/Model/FormBridgeTest.php (rev 0) +++ trunk/test/classes/MUtil/Model/FormBridgeTest.php 2012-01-05 12:48:04 UTC (rev 399) @@ -0,0 +1,69 @@ +<?php +class MUtil_Model_FormBridgeTest extends PHPUnit_Framework_TestCase +{ + /** + * @var MUtil_Model_FormBridge + */ + protected $object; + + /** + * The options array as set in the setUp() + * + * @var array + */ + protected $options; + + /** + * + * @var MUtil_Model_ModelAbstract + */ + protected $model; + + public function setUp() + { + parent::setUp(); + + require_once GEMS_WEB_DIR . '/data/TestModel.php'; + $this->model = new TestModel('testModel'); + $this->options = array( + 'date' => array( + 'dateFormat' => 'dd-MM-yyyy', + 'description' => 'dd-mm-yyyy', + 'size' => 10, + 'jQueryParams' => array( + 'buttonImage' => 'datepicker.png', + 'changeMonth' => true, + 'changeYear' => true, + 'duration' => 'fast', + 'showOn' => 'button' + ) + ) + ); + Zend_Registry::set(MUtil_Model_FormBridge::REGISTRY_KEY, $this->options); + parent::setUpBeforeClass(); + } + + public function tearDown() + { + + } + + public function testOptions() + { + $model = $this->model; + $form = new Zend_Form(); + + //Unchanged when not in the fixedOptions + $this->object = new MUtil_Model_FormBridge($model, $form); + $options = array('description'=>'test'); + $original = $options; + MUtil_Model_FormBridge::applyFixedOptions('input', $options); + $this->assertEquals($original, $options); + + //Overruled and extended when in the fixedOptions + $options = $original; + MUtil_Model_FormBridge::applyFixedOptions('date', $options); + $expected = $this->options['date']; + $this->assertEquals($expected, $options); + } +} \ No newline at end of file Added: trunk/test/data/TestModel.php =================================================================== --- trunk/test/data/TestModel.php (rev 0) +++ trunk/test/data/TestModel.php 2012-01-05 12:48:04 UTC (rev 399) @@ -0,0 +1,28 @@ +<?php +/** + * This is a simple testmodel without any added functionality to be able to the the basic model workings except + * for the load, save and delete methods + */ +class TestModel extends MUtil_Model_ModelAbstract +{ + //put your code here + protected function _load($filter = true, $sort = true) + { + return false; + } + + public function delete($filter = true) + { + return 0; + } + + public function hasNew() + { + return false; + } + + public function save(array $newValues, array $filter = null) + { + return $newValues; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-05 12:21:17
|
Revision: 398 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=398&view=rev Author: michieltcs Date: 2012-01-05 12:21:11 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Cherry pick r384 and r385 from trunk Revision Links: -------------- http://gemstracker.svn.sourceforge.net/gemstracker/?rev=384&view=rev http://gemstracker.svn.sourceforge.net/gemstracker/?rev=385&view=rev Modified Paths: -------------- branches/1.5.0-pulse/library/classes/Gems/Default/CronAction.php Removed Paths: ------------- branches/1.5.0-pulse/library/controllers/EmailController.php Property Changed: ---------------- branches/1.5.0-pulse/ branches/1.5.0-pulse/library/ branches/1.5.0-pulse/library/classes/Gems/User/UserPasswordValidator.php Property changes on: branches/1.5.0-pulse ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:350 + /trunk:350,384-385 Property changes on: branches/1.5.0-pulse/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/newUser:113-150 /branches/newUser2:175-207 /trunk/library:350 + /branches/newUser:113-150 /branches/newUser2:175-207 /trunk/library:350,384-385 Modified: branches/1.5.0-pulse/library/classes/Gems/Default/CronAction.php =================================================================== --- branches/1.5.0-pulse/library/classes/Gems/Default/CronAction.php 2012-01-05 11:47:16 UTC (rev 397) +++ branches/1.5.0-pulse/library/classes/Gems/Default/CronAction.php 2012-01-05 12:21:11 UTC (rev 398) @@ -157,6 +157,9 @@ $startUser = $userLoader->getCurrentUser(); $user = $startUser; + // Check for unprocessed tokens + $this->loader->getTracker()->processCompletedTokens(null, $startUser->getUserId()); + $model = $this->loader->getTracker()->getTokenModel(); $mailer = new Gems_Email_TemplateMailer($this->escort); Property changes on: branches/1.5.0-pulse/library/classes/Gems/User/UserPasswordValidator.php ___________________________________________________________________ Modified: svn:mergeinfo - /branches/newUser/classes/Gems/User/UserPasswordValidator.php:113-150 /branches/newUser2/classes/Gems/User/UserPasswordValidator.php:175-207 + /branches/newUser/classes/Gems/User/UserPasswordValidator.php:113-150 /branches/newUser2/classes/Gems/User/UserPasswordValidator.php:175-207 /trunk/library/classes/Gems/User/UserPasswordValidator.php:384-385 Deleted: branches/1.5.0-pulse/library/controllers/EmailController.php =================================================================== --- branches/1.5.0-pulse/library/controllers/EmailController.php 2012-01-05 11:47:16 UTC (rev 397) +++ branches/1.5.0-pulse/library/controllers/EmailController.php 2012-01-05 12:21:11 UTC (rev 398) @@ -1,50 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @deprecated Since 1.5, use CronController - * @package Gems - * @subpackage Default - * @author Michiel Rook <mi...@to...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id$ - */ - -/** - * This action performs automatic timed actions on the server. - * - * @deprecated Since 1.5, use CronController - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.4 - */ -class EmailController extends Gems_Default_CronAction -{ } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-05 11:47:27
|
Revision: 397 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=397&view=rev Author: mennodekker Date: 2012-01-05 11:47:16 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Fixed error for the case that no registry key for MUtil_Model_FormBridge options is present and made the key configurable Modified Paths: -------------- trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-01-05 09:54:04 UTC (rev 396) +++ trunk/library/classes/GemsEscort.php 2012-01-05 11:47:16 UTC (rev 397) @@ -1011,7 +1011,7 @@ 'showOn' => 'button', ); - Zend_Registry::set('MUtil_Model_FormBridge', array('date' => $dateFormOptions)); + Zend_Registry::set(MUtil_Model_FormBridge::REGISTRY_KEY, array('date' => $dateFormOptions)); } protected function createProjectClass($className, $param1 = null, $param2 = null) Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:54:04 UTC (rev 396) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 11:47:16 UTC (rev 397) @@ -64,6 +64,11 @@ const TEXT_OPTIONS = 'text'; const TEXTAREA_OPTIONS = 'textarea'; + /** + * The key to use in the Zend_Registry to store global fixed options + */ + const REGISTRY_KEY = 'MUtil_Model_FormBridge'; + protected $form; protected $model; @@ -670,7 +675,11 @@ static $typeOptions; if (! $typeOptions) { - $typeOptions = Zend_Registry::get('MUtil_Model_FormBridge'); + if (Zend_Registry::isRegistered(self::REGISTRY_KEY)) { + $typeOptions = Zend_Registry::get(self::REGISTRY_KEY); + } else { + $typeOptions = array(); + } } if (substr($type, 0, 3) == 'add') { 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:55:16
|
Revision: 396 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=396&view=rev Author: mennodekker Date: 2012-01-05 09:54:04 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Fixed translation bug in form selects: When element was created and options added it didn't know about the translation status of the form it was being added to Modified Paths: -------------- trunk/library/classes/Gems/Default/GroupAction.php trunk/library/classes/Gems/Default/RoleAction.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/Default/GroupAction.php =================================================================== --- trunk/library/classes/Gems/Default/GroupAction.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/Gems/Default/GroupAction.php 2012-01-05 09:54:04 UTC (rev 396) @@ -1,35 +1,35 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - + /** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * * @author Matijs de Jong * @since 1.0 * @version 1.1 @@ -62,7 +62,7 @@ $bridge->addHidden('ggp_id_group'); $bridge->addText('ggp_name', 'size', 15, 'minlength', 4, 'validator', $model->createUniqueValidator('ggp_name')); $bridge->addText('ggp_description', 'size', 40); - $bridge->addSelect('ggp_role', 'disableTranslator', true); + $bridge->addSelect('ggp_role'); $bridge->addCheckbox('ggp_group_active'); $bridge->addCheckbox('ggp_staff_members'); $bridge->addCheckbox('ggp_respondent_members'); Modified: trunk/library/classes/Gems/Default/RoleAction.php =================================================================== --- trunk/library/classes/Gems/Default/RoleAction.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/Gems/Default/RoleAction.php 2012-01-05 09:54:04 UTC (rev 396) @@ -77,9 +77,9 @@ $roles = $this->acl->getRoles(); $parents = array_combine($roles, $roles); - $bridge->addMultiCheckbox('grl_parents', 'disableTranslator', true, 'multiOptions', $parents, 'required', false); + $bridge->addMultiCheckbox('grl_parents', 'multiOptions', $parents, 'required', false); - $checkbox = $bridge->addMultiCheckbox('grl_privileges', 'disableTranslator', true, 'multiOptions', $this->getUsedPrivileges(), 'required', false); + $checkbox = $bridge->addMultiCheckbox('grl_privileges', 'multiOptions', $this->getUsedPrivileges(), 'required', false); //Get inherited privileges and disable tem $result = $this->escort->acl->getRolePrivileges(); Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:54:04 UTC (rev 396) @@ -156,6 +156,12 @@ private function _mergeOptions($name, array $options, $allowedOptionKeys_array) { + //If not explicitly set, use the form value for translatorDisabled, since we + //create the element outside the form scope and later add it + if (!isset($options['disableTranslator'])) { + $options['disableTranslator'] = $this->form->translatorIsDisabled(); + } + $args = func_get_args(); $allowedOptionsKeys = MUtil_Ra::args($args, 2); 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-01-03 10:54:57
|
Revision: 394 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=394&view=rev Author: mennodekker Date: 2012-01-03 10:54:48 +0000 (Tue, 03 Jan 2012) Log Message: ----------- Minor fixes for better display of tabforms Modified Paths: -------------- trunk/library/classes/Gems/Form/TableForm.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/Form/TableForm.php =================================================================== --- trunk/library/classes/Gems/Form/TableForm.php 2012-01-02 13:07:44 UTC (rev 393) +++ trunk/library/classes/Gems/Form/TableForm.php 2012-01-03 10:54:48 UTC (rev 394) @@ -110,11 +110,6 @@ //Add the group as usual parent::addDisplayGroup($elements, $name, $options); - //Fix alternation when number of elements is not even - if (count($elements) % 2) { - $dropMe = $this->_alternate->__toString(); - } - //Retrieve it and set decorators $group = $this->getDisplayGroup($name); $group->setDecorators( array('FormElements', @@ -123,7 +118,7 @@ 'Tooltip', array('Description', array('tag'=>'label', 'class'=>'optional', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'escape'=>false)), array(array('labelCellOpen' => 'HtmlTag'), array('tag' => 'td', 'class'=>'label', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'openOnly'=>true)), - array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $this->_alternate . ' ' . $group->getName(). ' ' . $group->getAttrib('class'))) + array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $group->getName(). ' ' . $group->getAttrib('class'))) )); //Now add the right decorators to the elements @@ -217,16 +212,6 @@ if (!is_null($dec1)) array_unshift($decorators, $dec1); $element->setDecorators($decorators); - if ($element instanceof Zend_Form_Element_Hidden) { - //Make row hidden so it takes no height - $decorator = $element->getDecorator('row'); - $decorator->setOption('style', 'display:none;'); - - } else { - $decorator = $element->getDecorator('row'); - $decorator->setOption('class', $this->_alternate . ' ' . $element->getName()); - } - return $this; } @@ -250,4 +235,23 @@ } return $this; } + + public function setView(Zend_View_Interface $view = null) + { + //If we set the view, fix the alternating rows + if ($view) { + foreach($this as $name => $element) { + $decorator = $element->getDecorator('row'); + if ($decorator) { + if ($element instanceof Zend_Form_Element_Hidden) { + $decorator->setOption('style', 'display:none;'); + } else { + $decorator->setOption('class', $this->_alternate . ' ' . $name); + } + } + } + } + + return parent::setView($view); + } } \ No newline at end of file Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2012-01-02 13:07:44 UTC (rev 393) +++ trunk/library/classes/Gems/TabForm.php 2012-01-03 10:54:48 UTC (rev 394) @@ -324,8 +324,8 @@ $decorators = $this->getDecorators(); if (empty($decorators)) { $this->setDecorators(array( - array('TabErrors'), - array('decorator' => array('SubformElements' => 'FormElements')), + 'TabErrors', + array(array('SubformElements' => 'FormElements')), array('HtmlTag', array('tag' => 'div', 'id' => 'tabContainer', 'class' => 'mainForm')), array('TabContainer', array('id' => 'tabContainer', 'style' => 'width: 99%;')), 'FormElements', Modified: trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php =================================================================== --- trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php 2012-01-02 13:07:44 UTC (rev 393) +++ trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php 2012-01-03 10:54:48 UTC (rev 394) @@ -70,7 +70,8 @@ $js[] = " });"; $js[] = '}'; - $this->view->inlineScript()->appendScript(implode("\n", $js)); // */ + $this->jquery->addOnLoad(implode("\n", $js)); + //$this->view->inlineScript()->appendScript(implode("\n", $js)); // */ } return $result; } Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-02 13:07:44 UTC (rev 393) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-03 10:54:48 UTC (rev 394) @@ -465,7 +465,7 @@ } $element = new Zend_Form_Element_Password($name, $options); - $this->form->addElement($element); + $this->_applyValidators($name, $element); if ($stringlength) { $element->addValidator('StringLength', true, $stringlength); @@ -483,7 +483,7 @@ $repeatElement->addValidator(new MUtil_Validate_IsConfirmed($name, isset($options['label']) ? $options['label'] : null)); } - return $this->_addToForm($name, $element); + return $element; } public function addRadio($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-02 13:07:50
|
Revision: 393 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=393&view=rev Author: mennodekker Date: 2012-01-02 13:07:44 +0000 (Mon, 02 Jan 2012) Log Message: ----------- forgot to cleanup the unit tests Modified Paths: -------------- trunk/test/classes/IndexControllerTest.php Modified: trunk/test/classes/IndexControllerTest.php =================================================================== --- trunk/test/classes/IndexControllerTest.php 2012-01-02 12:35:23 UTC (rev 392) +++ trunk/test/classes/IndexControllerTest.php 2012-01-02 13:07:44 UTC (rev 393) @@ -23,8 +23,7 @@ * * At the moment we only set a salt in the project resource */ - public function _fixSetup() { - $this->bootstrap->bootstrap(); + protected function _fixSetup() { $project = $this->bootstrap->getBootstrap()->getResource('project'); $project->salt = 'TESTCASE'; } @@ -48,9 +47,6 @@ { $this->_fixSetup(); $this->dispatch('/index/login'); - $reponse = $this->getFrontController()->getResponse(); - var_dump($reponse->getBody()); - $this->assertController('index'); $this->assertAction('login'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-02 12:35:29
|
Revision: 392 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=392&view=rev Author: mennodekker Date: 2012-01-02 12:35:23 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Fixed unit tests Modified Paths: -------------- trunk/library/classes/Gems/User/Organization.php trunk/library/classes/Gems/Util/AccessLogActions.php trunk/library/classes/Gems/Util/DbLookup.php trunk/test/classes/IndexControllerTest.php Modified: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php 2012-01-02 10:17:42 UTC (rev 391) +++ trunk/library/classes/Gems/User/Organization.php 2012-01-02 12:35:23 UTC (rev 392) @@ -201,8 +201,12 @@ */ protected function loadData($id) { - $sql = "SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1"; - $data = $this->db->fetchRow($sql, $id); + try { + $sql = "SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1"; + $data = $this->db->fetchRow($sql, $id); + } catch (Exception $e) { + $data = false; + } if ($data) { try { Modified: trunk/library/classes/Gems/Util/AccessLogActions.php =================================================================== --- trunk/library/classes/Gems/Util/AccessLogActions.php 2012-01-02 10:17:42 UTC (rev 391) +++ trunk/library/classes/Gems/Util/AccessLogActions.php 2012-01-02 12:35:23 UTC (rev 392) @@ -75,6 +75,12 @@ */ protected function loadData($id) { - return $this->db->fetchAssoc('SELECT glac_name, glac_id_action AS id, glac_log AS log FROM gems__log_actions ORDER BY glac_name'); + try { + $data = $this->db->fetchAssoc('SELECT glac_name, glac_id_action AS id, glac_log AS log FROM gems__log_actions ORDER BY glac_name'); + } catch (Exception $exc) { + $data = array(); + } + + return $data; } } Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-01-02 10:17:42 UTC (rev 391) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-01-02 12:35:23 UTC (rev 392) @@ -249,7 +249,11 @@ 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'); + try { + $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 ORDER BY gor_name'); + } catch (Exception $e) { + $organizations = array(); + } } natsort($organizations); } Modified: trunk/test/classes/IndexControllerTest.php =================================================================== --- trunk/test/classes/IndexControllerTest.php 2012-01-02 10:17:42 UTC (rev 391) +++ trunk/test/classes/IndexControllerTest.php 2012-01-02 12:35:23 UTC (rev 392) @@ -17,16 +17,40 @@ parent::setUp(); } + + /** + * Here we fix the intentional errors that are in de default setup + * + * At the moment we only set a salt in the project resource + */ + public function _fixSetup() { + $this->bootstrap->bootstrap(); + $project = $this->bootstrap->getBootstrap()->getResource('project'); + $project->salt = 'TESTCASE'; + } + + public function testSaltRequired() + { + $this->dispatch('/'); + $reponse = $this->getFrontController()->getResponse(); + $exception = $reponse->getExceptionByMessage("Missing required project setting: 'salt'."); + $this->assertTrue(count($exception) == 1); + } public function testHomeRedirectsToLogin() { + $this->_fixSetup(); $this->dispatch('/'); $this->assertRedirectTo('/index/login'); } public function testLoginPage() { + $this->_fixSetup(); $this->dispatch('/index/login'); + $reponse = $this->getFrontController()->getResponse(); + var_dump($reponse->getBody()); + $this->assertController('index'); $this->assertAction('login'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-02 10:17:48
|
Revision: 391 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=391&view=rev Author: mennodekker Date: 2012-01-02 10:17:42 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Possibly incompatible fix: Fixed userloading for inactive users (i.e. userdata returns no row) Fix for delete in staffModel resulting in an error because not all key values where present and the joined table got an insert instead of an update Doc for code completion in Model Modified Paths: -------------- trunk/library/classes/Gems/Model.php trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php trunk/library/classes/Gems/User/User.php trunk/library/classes/MUtil/Model/JoinModel.php Modified: trunk/library/classes/Gems/Model.php =================================================================== --- trunk/library/classes/Gems/Model.php 2011-12-30 12:12:18 UTC (rev 390) +++ trunk/library/classes/Gems/Model.php 2012-01-02 10:17:42 UTC (rev 391) @@ -171,6 +171,11 @@ return $model; } + /** + * Load the organization model + * + * @return Gems_Model_OrganizationModel + */ public function getOrganizationModel() { $model = $this->_loadClass('OrganizationModel', true); @@ -227,6 +232,11 @@ return $model; } + /** + * Load the staffmodel + * + * @return Gems_Model_StaffModel + */ public function getStaffModel() { $model = $this->_loadClass('StaffModel', true); Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php =================================================================== --- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2011-12-30 12:12:18 UTC (rev 390) +++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-01-02 10:17:42 UTC (rev 391) @@ -168,7 +168,20 @@ { $select = $this->getUserSelect($login_name, $organization); - return $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); + $result = $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); + + /* + * Handle the case that we have a login record, but no matching userdata (ie. user is inactive) + * if you want some kind of auto-register you should change this + */ + if ($result == false) { + $result = array( + 'user_active' => false, + 'user_role' => 'nologin', + ); + } + + return $result; } /** Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-12-30 12:12:18 UTC (rev 390) +++ trunk/library/classes/Gems/User/User.php 2012-01-02 10:17:42 UTC (rev 391) @@ -222,6 +222,17 @@ } /** + * Helper method for the case a user tries to authenticate while he is inactive + * + * @param array $params + * @return boolean + */ + public function alwaysFalse($params) + { + return false; + } + + /** * Authenticate a users credentials using the submitted form * * @param array $formValues the array containing all formvalues from the login form @@ -229,17 +240,21 @@ */ public function authenticate($formValues) { - $auth = Gems_Auth::getInstance(); + $auth = Gems_Auth::getInstance(); - $formValues['allowed_ip_ranges'] = $this->getAllowedIPRanges(); - $formValues['organization'] = $this->getBaseOrganizationId(); + $formValues['allowed_ip_ranges'] = $this->getAllowedIPRanges(); + $formValues['organization'] = $this->getBaseOrganizationId(); - $adapter = $this->definition->getAuthAdapter($formValues); - $authResult = $auth->authenticate($adapter, $formValues); + if ($this->isActive()) { + $adapter = $this->definition->getAuthAdapter($formValues); + } else { + $adapter = new Gems_Auth_Adapter_Callback(array($this,'alwaysFalse'), $formValues['userlogin'], $formValues); + } - $this->_authResult = $authResult; + $authResult = $auth->authenticate($adapter, $formValues); + $this->_authResult = $authResult; - return $authResult; + return $authResult; } /** Modified: trunk/library/classes/MUtil/Model/JoinModel.php =================================================================== --- trunk/library/classes/MUtil/Model/JoinModel.php 2011-12-30 12:12:18 UTC (rev 390) +++ trunk/library/classes/MUtil/Model/JoinModel.php 2012-01-02 10:17:42 UTC (rev 391) @@ -175,8 +175,11 @@ $filter = $this->_checkFilterUsed($filter); if ($this->_deleteValues) { - // MUtil_Model::$verbose = true; - $changed = $this->save($this->_deleteValues + $filter, $filter, $saveTables); + // First get the old values so we can have all the key values + $oldValues = $this->loadFirst($filter); + + // Add the oldValues to the save + $changed = $this->save($this->_deleteValues + $oldValues, $filter, $saveTables); } else { $changed = 0; foreach ($saveTables as $table_name) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-30 12:12:24
|
Revision: 390 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=390&view=rev Author: matijsdejong Date: 2011-12-30 12:12:18 +0000 (Fri, 30 Dec 2011) Log Message: ----------- First working versions of the ProgressPanel.php Modified Paths: -------------- trunk/new_project/htdocs/gems/css/gems.css Removed Paths: ------------- trunk/new_project/htdocs/gems/css/progress_animation.gif Modified: trunk/new_project/htdocs/gems/css/gems.css =================================================================== --- trunk/new_project/htdocs/gems/css/gems.css 2011-12-30 12:11:45 UTC (rev 389) +++ trunk/new_project/htdocs/gems/css/gems.css 2011-12-30 12:12:18 UTC (rev 390) @@ -352,15 +352,6 @@ .print-only { display: none; } -.progress { - background: url('progress_animation.gif') repeat-x center left transparent; - border: black solid 1px; - margin: 4px 0; - padding: 2px; - text-align: center; - width: 100%; -} - .rightAlign { text-align: right; } @@ -644,6 +635,17 @@ margin-bottom: 0.25em; } +.ui-progressbar { + margin: 4px; + width: 98%; +} + +.ui-progressbar-text { + margin: 1px; + padding: 4px; + text-align: center; +} + .zend_echo { background-color: #FAF8CC; border: #F62817 2px dotted; Deleted: trunk/new_project/htdocs/gems/css/progress_animation.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-30 12:11:51
|
Revision: 389 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=389&view=rev Author: matijsdejong Date: 2011-12-30 12:11:45 +0000 (Fri, 30 Dec 2011) Log Message: ----------- First working versions of the ProgressPanel.php Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/MUtil/Html/ProgressPanel.php Added Paths: ----------- trunk/library/classes/MUtil/Html/ProgressPanelPush.js Removed Paths: ------------- trunk/library/classes/MUtil/Html/ProgressPanel.js Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2011-12-22 17:07:21 UTC (rev 388) +++ trunk/library/classes/Gems/Default/SourceAction.php 2011-12-30 12:11:45 UTC (rev 389) @@ -245,8 +245,30 @@ $this->html->pInfo($this->_('Synchronization will update the status of all surveys imported into this project to the status at the sources.')); /* $progress = $this->html->progress('0%'); + // $progress = $this->html->progress(); if ($progress->run($this->getRequest())) { - MUtil_Echo::track('running'); + + // IIS 7: %windir%\System32\inetsrv\config\applicationHost.config + // ../handlers/add name="PHP_via_FastCGI" + // ../handlers/add name="CGI-exe" + // add attribute responseBufferLimit="1024" + + for ($i = 0; $i < 100; $i += 1) { + if ($i < 20) { + $text = 'Just beginning'; + } else if ($i < 50) { + $text = 'A bit done'; + } else if ($i < 80) { + $text = 'Getting closer'; + } else { + $text = 'Nearly done'; + } + // IIS? + echo str_repeat(' ',1024*3); + $progress->update($i, ' ' . $text); + sleep(15); + } + $progress->finish(); } // */ if ($data) { Deleted: trunk/library/classes/MUtil/Html/ProgressPanel.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanel.js 2011-12-22 17:07:21 UTC (rev 388) +++ trunk/library/classes/MUtil/Html/ProgressPanel.js 2011-12-30 12:11:45 UTC (rev 389) @@ -1,27 +0,0 @@ - -function FUNCTION_PREFIX_Start() -{ - var iFrame = document.createElement('iframe'); - iFrame.setAttribute('style', 'position: absolute; left: -100px; top: -100px; width: 10px; height: 10px; overflow: hidden;'); - document.getElementsByTagName('body')[0].appendChild(iFrame); - iFrame.src = '{URL}'; -} - -function FUNCTION_PREFIX_Update(data) -{ - main = document.getElementById('{ID}'); // .style.width = data.percent + '%'; - - inner = main.getElementsByTagName('{CHILD}')[0]; - inner.style.width = data.percent + '%'; - inner.innerHTML = data.text; -} - -function FUNCTION_PREFIX_Finish() -{ - document.getElementById('{id}').style.width = '100%'; - - document.getElementById('pg-text-1').innerHTML = 'Demo done'; - document.getElementById('pg-text-2').innerHTML = 'Demo done'; -} - -// FUNCTION_PREFIX_Start(); Modified: trunk/library/classes/MUtil/Html/ProgressPanel.php =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanel.php 2011-12-22 17:07:21 UTC (rev 388) +++ trunk/library/classes/MUtil/Html/ProgressPanel.php 2011-12-30 12:11:45 UTC (rev 389) @@ -78,7 +78,7 @@ * @var array The actual storage of the attributes. */ protected $_attribs = array( - 'class' => 'progress', + 'class' => 'ui-progressbar ui-widget ui-widget-content ui-corner-all', 'id' => 'progress_bar' ); @@ -104,12 +104,6 @@ protected $_functionPrefix; /** - * - * @var MUtil_Html_HtmlElement - */ - protected $_innerElement; - - /** * Usually no text is appended before an element, but for certain elements we choose * to add a "\n" newline character instead, to keep the output readable in source * view. @@ -119,6 +113,33 @@ protected $_prependString = "\n"; /** + * + * @var Zend_ProgressBar + */ + protected $_progressBar; + + /** + * + * @var Zend_ProgressBar_Adapter + */ + protected $_progressBarAdapter; + + /** + * Extra array with special types for subclasses. + * + * When an object of one of the key types is used, then use + * the class method defined as the value. + * + * @see $_specialTypesDefault + * + * @var array Of 'class or interfacename' => 'class method' of null + */ + protected $_specialTypes = array( + 'Zend_ProgressBar' => 'setProgressBar', + 'Zend_ProgressBar_Adapter' => 'setProgressBarAdapter', + ); + + /** * The name of the parameter used for progress panel signals * * @var string @@ -133,6 +154,13 @@ public $progressParameterRunValue = 'run'; /** + * Class name of inner element that displays text + * + * @var string + */ + public $progressTextClass = 'ui-progressbar-text'; + + /** * Creates a 'div' progress panel * * @param mixed $arg_array A MUtil_Ra::args data collection. @@ -145,6 +173,18 @@ } /** + * Update the progess panel + * + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function finish() + { + $bar = $this->getProgressBar(); + $bar->finish(); + + return $this; + } + /** * Returns the JavaScript object associated with this object. * * WARNING: calling this object sets it's position in the order the @@ -156,10 +196,11 @@ public function getCode() { if (! isset($this->_content[self::CODE])) { - $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanel.js'); + $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanelPush.js'); // $js->setInHeader(false); $js->setField('FUNCTION_PREFIX_', $this->getFunctionPrefix()); - $js->setField('{CHILD}', $this->_defaultChildTag); + $js->setField('{TEXT_TAG}', $this->_defaultChildTag); + $js->setField('{TEXT_CLASS}', $this->progressTextClass); $js->setField('{ID}', $this->getAttrib('id')); $this->_content[self::CODE] = $js; @@ -176,13 +217,38 @@ public function getFunctionPrefix() { if (! $this->_functionPrefix) { - $this->setFunctionPrefix(__CLASS__ . '_'); + $this->setFunctionPrefix(__CLASS__ . '_' . $this->getAttrib('id'). '_'); } return (string) $this->_functionPrefix; } /** + * + * @return Zend_ProgressBar + */ + public function getProgressBar() + { + if (! $this->_progressBar instanceof Zend_ProgressBar) { + $this->setProgressBar(new Zend_ProgressBar($this->getProgressBarAdapter(), 0, 100)); + } + return $this->_progressBar; + } + + /** + * + * @return Zend_ProgressBar_Adapter + */ + public function getProgressBarAdapter() + { + if (! $this->_progressBarAdapter instanceof Zend_ProgressBar_Adapter) { + $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPush()); + } + + return $this->_progressBarAdapter; + } + + /** * Creates a 'div' progress panel * * @param mixed $arg_array A MUtil_Ra::args data collection. @@ -206,11 +272,30 @@ */ protected function renderElement(Zend_View_Abstract $view) { - $js = $this->getCode(); - if (! $js->hasField('{URL}')) { - $js->setField('{URL}', $view->url(array($this->progressParameterName => $this->progressParameterRunValue))); + ZendX_JQuery::enableView($view); + + if ($this->getProgressBarAdapter() instanceof Zend_ProgressBar_Adapter_JsPush) { + $js = $this->getCode(); + if (! $js->hasField('{URL}')) { + $js->setField('{URL}', $view->url(array($this->progressParameterName => $this->progressParameterRunValue))); + } } + if ($this->_lastChild) { + $this->_lastChild->class = $this->progressTextClass; + + // These style elements inline because they are REQUIRED to make the panel work. + // + // Making the child position absolute means it is positioned over the content that + // the JQuery progress widget displays (the bar itself) and so this solution allows + // the text to be displayed over the progress bar (when it has a relative position). + // + // The elements should be display neutral. + // + $this->_lastChild->style = 'left: 0; height: 100%; position: absolute; top: 0; width: 100%;'; + $this->style = 'position: relative;'; + } + return parent::renderElement($view); } @@ -239,4 +324,47 @@ $this->_functionPrefix = $prefix; return $this; } + + /** + * + * @param Zend_ProgressBar $progressBar + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function setProgressBar(Zend_ProgressBar $progressBar) + { + $this->_progressBar = $progressBar; + return $this; + } + + /** + * + * @param Zend_ProgressBar_Adapter_Interface $adapter + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function setProgressBarAdapter(Zend_ProgressBar_Adapter $adapter) + { + if ($adapter instanceof Zend_ProgressBar_Adapter_JsPush) { + $prefix = $this->getFunctionPrefix(); + $adapter->setUpdateMethodName($prefix . 'Update'); + $adapter->setFinishMethodName($prefix . 'Finish'); + } + + $this->_progressBarAdapter = $adapter; + return $this; + } + + /** + * Update the progess panel + * + * @param int $value + * @param string $text + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function update($value, $text = null) + { + $bar = $this->getProgressBar(); + $bar->update($value, $text); + + return $this; + } } Added: trunk/library/classes/MUtil/Html/ProgressPanelPush.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanelPush.js (rev 0) +++ trunk/library/classes/MUtil/Html/ProgressPanelPush.js 2011-12-30 12:11:45 UTC (rev 389) @@ -0,0 +1,46 @@ + +function FUNCTION_PREFIX_Start() +{ + var iFrame = document.createElement('iframe'); + iFrame.setAttribute('style', 'position: absolute; left: -100px; top: -100px; width: 10px; height: 10px; overflow: hidden;'); + // iFrame.setAttribute('style', 'position: absolute; left: 0px; top: 0px; width: 100px; height: 100px; overflow: hidden;'); + document.getElementsByTagName('body')[0].appendChild(iFrame); + iFrame.src = '{URL}'; +} + +function FUNCTION_PREFIX_Update(data) +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", data.percent); + main.progressbar({ + value: data.percent + }); + + inner = main.find('.{TEXT_CLASS}'); + if (inner) { + inner.empty(); + inner.append(data.percent + '%'); + if (data.text) { + inner.append(data.text); + } + } +} + +function FUNCTION_PREFIX_Finish() +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", 100); + + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + if (inner) { + inner.empty(); + inner.append('100% Done!'); + } +} + + +// FUNCTION_PREFIX_Start(); + +// jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: 'Hi'})); +// jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: ''})); +jQuery().ready(FUNCTION_PREFIX_Start()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 17:07:27
|
Revision: 388 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=388&view=rev Author: matijsdejong Date: 2011-12-22 17:07:21 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Extra documentation in MenuAbstract.php ProjectSettings.php %s in salt is not required UserLoader.php $currentUser is not always initialized. Modified Paths: -------------- trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-12-22 15:41:40 UTC (rev 387) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-12-22 17:07:21 UTC (rev 388) @@ -263,8 +263,8 @@ /** * Add a page to the menu * - * @param string $label The label to display for the menu item - * @param string $privilege The privilege for the item + * @param string $label The label to display for the menu item, null for access without display + * @param string $privilege The privilege for the item, null is always, 'pr.islogin' must be logged in, 'pr.nologin' only when not logged in. * @param string $controller What controller to use * @param string $action The name of the action * @param array $other Array of extra options for this item, e.g. 'visible', 'allowed', 'class', 'icon', 'target', 'type', 'button_only' Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 15:41:40 UTC (rev 387) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 17:07:21 UTC (rev 388) @@ -166,10 +166,6 @@ throw new Gems_Exception_Coding($error); } - if (strpos($this->offsetGet('salt'), '%s') === false) { - throw new Gems_Exception_Coding("Required project setting 'salt' must contain '%s'."); - } - $superPassword = $this->getSuperAdminPassword(); if ((APPLICATION_ENV === 'production') && $this->getSuperAdminName() && $superPassword) { if (strlen($superPassword) < $this->minimumSuperPasswordLength) { Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-12-22 15:41:40 UTC (rev 387) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-12-22 17:07:21 UTC (rev 388) @@ -1,4 +1,5 @@ <?php + /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -155,7 +156,7 @@ self::USER_STAFF => $this->translate->_('Db storage'), 'RadiusUser' => $this->translate->_('Radius storage') ); - + return $definitions; } @@ -191,7 +192,7 @@ static $organizations = array(); if (null === $organizationId) { - $organizationId = intval(self::$currentUser->getCurrentOrganizationId()); + $organizationId = intval(self::getCurrentUser()->getCurrentOrganizationId()); } if (! isset($organizations[$organizationId])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 15:41:46
|
Revision: 387 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=387&view=rev Author: matijsdejong Date: 2011-12-22 15:41:40 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Whoops Modified Paths: -------------- trunk/new_project/application/configs/project.ini Modified: trunk/new_project/application/configs/project.ini =================================================================== --- trunk/new_project/application/configs/project.ini 2011-12-22 15:31:37 UTC (rev 386) +++ trunk/new_project/application/configs/project.ini 2011-12-22 15:41:40 UTC (rev 387) @@ -18,7 +18,7 @@ ; On production pwd should be empty or langer than 10 chars ;---------------------------------------------------------- admin.user = superadmin -admin.pwd = superadmi +admin.pwd = ;admin.ipRanges = css.gems = gems/css/gems-fixed.css This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 15:31:43
|
Revision: 386 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=386&view=rev Author: matijsdejong Date: 2011-12-22 15:31:37 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Simplified installation and setup errors are now shown in the ErrorController Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/GemsEscort.php trunk/new_project/application/configs/project.ini trunk/new_project/htdocs/index.php Property Changed: ---------------- trunk/new_project/library/ Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 13:14:38 UTC (rev 385) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 15:31:37 UTC (rev 386) @@ -97,9 +97,11 @@ parent::__construct($array, ArrayObject::ARRAY_AS_PROPS); - //@@TODO: some checks should not be done on each and every request! - // this can be a problem when testing - $this->checkRequiredValues(); + if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { + $this->offsetSet('name', GEMS_PROJECT_NAME); + } + + $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1)); } /** @@ -133,7 +135,7 @@ * * @return void */ - protected function checkRequiredValues() + public function checkRequiredValues() { $missing = array(); foreach ($this->requiredKeys as $key => $names) { @@ -164,6 +166,10 @@ throw new Gems_Exception_Coding($error); } + if (strpos($this->offsetGet('salt'), '%s') === false) { + throw new Gems_Exception_Coding("Required project setting 'salt' must contain '%s'."); + } + $superPassword = $this->getSuperAdminPassword(); if ((APPLICATION_ENV === 'production') && $this->getSuperAdminName() && $superPassword) { if (strlen($superPassword) < $this->minimumSuperPasswordLength) { @@ -171,12 +177,6 @@ throw new Gems_Exception_Coding($error); } } - - if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { - $this->offsetSet('name', GEMS_PROJECT_NAME); - } - - $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1)); } /** Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-12-22 13:14:38 UTC (rev 385) +++ trunk/library/classes/GemsEscort.php 2011-12-22 15:31:37 UTC (rev 386) @@ -1450,6 +1450,9 @@ */ public function routeShutdown(Zend_Controller_Request_Abstract $request) { + // Npow is a good time to check for required values + $this->project->checkRequiredValues(); + $loader = $this->getLoader(); $user = $loader->getCurrentUser(); Modified: trunk/new_project/application/configs/project.ini =================================================================== --- trunk/new_project/application/configs/project.ini 2011-12-22 13:14:38 UTC (rev 385) +++ trunk/new_project/application/configs/project.ini 2011-12-22 15:31:37 UTC (rev 386) @@ -10,16 +10,16 @@ ; Put %s somewhere within the salt to mix the value ; in the salt. ;--------------------------------------------------- -salt = +salt = ;---------------------------------------------------------- ; The non database super user ; ; On production pwd should be empty or langer than 10 chars ;---------------------------------------------------------- -admin.user = super -;admin.pwd = -;admin.ipRanges = +admin.user = superadmin +admin.pwd = superadmi +;admin.ipRanges = css.gems = gems/css/gems-fixed.css css.print.url = gems/css/gems_print.css Modified: trunk/new_project/htdocs/index.php =================================================================== --- trunk/new_project/htdocs/index.php 2011-12-22 13:14:38 UTC (rev 385) +++ trunk/new_project/htdocs/index.php 2011-12-22 15:31:37 UTC (rev 386) @@ -1,34 +1,33 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** * Project root file * * Gemms specific startup @@ -63,6 +62,7 @@ if (getenv('APPLICATION_ENV')) { $env = getenv('APPLICATION_ENV'); } else { + // Erasmus MC processing if (strpos($_SERVER["HTTP_HOST"], 'survey') === false) { $env = 'testing'; } else { @@ -76,7 +76,7 @@ /** * Load database login variables, Erasmus MC way. */ -require realpath(GEMS_ROOT_DIR . '/var/settings/db.inc.php'); +// require realpath(GEMS_ROOT_DIR . '/var/settings/db.inc.php'); /** * Start standard GEMS bootstrap. Property changes on: trunk/new_project/library ___________________________________________________________________ Added: svn:ignore + Gems This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 13:14:49
|
Revision: 385 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=385&view=rev Author: matijsdejong Date: 2011-12-22 13:14:38 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Email action is now Cron action Removed Paths: ------------- trunk/library/controllers/EmailController.php Deleted: trunk/library/controllers/EmailController.php =================================================================== --- trunk/library/controllers/EmailController.php 2011-12-22 12:58:28 UTC (rev 384) +++ trunk/library/controllers/EmailController.php 2011-12-22 13:14:38 UTC (rev 385) @@ -1,50 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @deprecated Since 1.5, use CronController - * @package Gems - * @subpackage Default - * @author Michiel Rook <mi...@to...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id$ - */ - -/** - * This action performs automatic timed actions on the server. - * - * @deprecated Since 1.5, use CronController - * @package Gems - * @subpackage Default - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.4 - */ -class EmailController extends Gems_Default_CronAction -{ } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 12:58:37
|
Revision: 384 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=384&view=rev Author: matijsdejong Date: 2011-12-22 12:58:28 +0000 (Thu, 22 Dec 2011) Log Message: ----------- It is useful to check for completed tokens before you send the e-mails Modified Paths: -------------- trunk/library/classes/Gems/Default/CronAction.php Modified: trunk/library/classes/Gems/Default/CronAction.php =================================================================== --- trunk/library/classes/Gems/Default/CronAction.php 2011-12-22 09:08:36 UTC (rev 383) +++ trunk/library/classes/Gems/Default/CronAction.php 2011-12-22 12:58:28 UTC (rev 384) @@ -157,6 +157,9 @@ $startUser = $userLoader->getCurrentUser(); $user = $startUser; + // Check for unprocessed tokens + $this->loader->getTracker()->processCompletedTokens(null, $startUser->getUserId()); + $model = $this->loader->getTracker()->getTokenModel(); $mailer = new Gems_Email_TemplateMailer($this->escort); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-22 09:08:43
|
Revision: 383 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=383&view=rev Author: mennodekker Date: 2011-12-22 09:08:36 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Fixed error with patient search, added organization to table and search. TODO: make search refresh too so patients/staff search can be filtered on selected organization Modified Paths: -------------- trunk/library/classes/Gems/Default/LogAction.php Modified: trunk/library/classes/Gems/Default/LogAction.php =================================================================== --- trunk/library/classes/Gems/Default/LogAction.php 2011-12-21 14:09:41 UTC (rev 382) +++ trunk/library/classes/Gems/Default/LogAction.php 2011-12-22 09:08:36 UTC (rev 383) @@ -46,6 +46,23 @@ public $maxPeriod = 1; public $minPeriod = -15; + public function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) + { + // Add edit button if allowed, otherwise show, again if allowed + if ($menuItem = $this->findAllowedMenuItem('edit', 'show')) { + $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); + } + + $html = MUtil_Html::create(); + $br = $html->br(); + + $bridge->addSortable('glua_created'); + $bridge->addSortable('glac_name'); + $bridge->addSortable('glua_message'); + $bridge->addMultiSort('staff_name', $br, 'glua_organization'); + $bridge->addSortable('respondent_name'); + } + public function getAutoSearchElements(MUtil_Model_ModelAbstract $model, array $data) { $elements = parent::getAutoSearchElements($model, $data); @@ -93,19 +110,29 @@ $elements[] = null; // break into separate spans + $elements[] = $this->_('Organization:'); + $sql = 'SELECT gor_id_organization, gor_name FROM gems__organizations'; + $elements[] = $this->_createSelectElement('glua_organization', $sql, $this->_('All organizations')); + $elements[] = $this->_('Staff:'); $sql = "SELECT glua_by, CONCAT(gsf_last_name, ', ', COALESCE(CONCAT(gsf_first_name, ' '), ''), COALESCE(gsf_surname_prefix, '')) AS name " . "FROM gems__log_useractions " . "JOIN gems__staff ON glua_by = gsf_id_user"; + /*if (isset($data['glua_organization']) && !empty($data['glua_organization'])) { + $sql .= ' WHERE glua_organization = ' . $this->db->quote($data['glua_organization']); + }*/ $elements[] = $this->_createSelectElement('glua_by', $sql, $this->_('All staff')); + $elements[] = MUtil_Html::create('br'); $elements[] = $this->_('Patient:'); - $sql = "SELECT glua_by, CONCAT(grs_last_name, ', ', COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, '')) AS name " + $sql = "SELECT glua_to, CONCAT(grs_last_name, ', ', COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, '')) AS name " . "FROM gems__log_useractions " - . "JOIN gems__respondents ON glua_by = grs_id_user"; + . "JOIN gems__respondents ON glua_to = grs_id_user"; + /*if (isset($data['glua_organization']) && !empty($data['glua_organization'])) { + $sql .= ' WHERE glua_organization = ' . $this->db->quote($data['glua_organization']); + }*/ $elements[] = $this->_createSelectElement('glua_to', $sql, $this->_('All patients')); - $elements[] = MUtil_Html::create('br'); $elements[] = $this->_('Action:'); $sql = "SELECT glac_id_action, glac_name " . "FROM gems__log_actions "; @@ -164,6 +191,10 @@ $model->set('glac_name', 'label', $this->_('Action')); $model->set('glua_message', 'label', $this->_('Message')); $model->set('staff_name', 'label', $this->_('Staff')); + + //Not only active, we want to be able to read the log for inactive organizations too + $orgs = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations'); + $model->set('glua_organization', 'label', $this->_('Organization'), 'multiOptions', $orgs); $model->set('respondent_name', 'label', $this->_('Respondent')); if ($detailed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-21 14:09:50
|
Revision: 382 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=382&view=rev Author: mennodekker Date: 2011-12-21 14:09:41 +0000 (Wed, 21 Dec 2011) Log Message: ----------- fixed wrong key for portnumber in Radius config Modified Paths: -------------- trunk/library/classes/Gems/User/RadiusUserDefinition.php Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2011-12-21 12:24:20 UTC (rev 381) +++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2011-12-21 14:09:41 UTC (rev 382) @@ -134,9 +134,16 @@ //Ok hardcoded for now this needs to be read from the userdefinition $configData = $this->loadConfig(array('gor_id_organization' => $formValues['organization'])); - $config = array('ip' => $configData['grcfg_ip'], - 'port' => $configData['grcfg_port'], - 'sharedsecret' => $configData['grcfg_secret']); + $config = array('ip' => $configData['grcfg_ip'], + 'authenticationport' => $configData['grcfg_port'], + 'sharedsecret' => $configData['grcfg_secret']); + + //Unset empty + foreach($config as $key=>$value) { + if (empty($value)) { + unset($config[$key]); + } + } $adapter = new Gems_User_Adapter_Radius($config); $adapter->setIdentity($formValues['userlogin']) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-21 12:24:31
|
Revision: 381 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=381&view=rev Author: mennodekker Date: 2011-12-21 12:24:20 +0000 (Wed, 21 Dec 2011) Log Message: ----------- QuickFix: Allow pr.staff.edit.all to change the userclass from the default for the organization to allow special accounts to use a different auth method Modified Paths: -------------- trunk/library/classes/Gems/Default/StaffAction.php Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2011-12-21 09:43:26 UTC (rev 380) +++ trunk/library/classes/Gems/Default/StaffAction.php 2011-12-21 12:24:20 UTC (rev 381) @@ -123,7 +123,16 @@ $ucfirst = new Zend_Filter_Callback('ucfirst'); - $bridge->addHiddenMulti('gsf_id_user', 'gul_id_user', 'gup_id_user', 'gul_user_class', 'gul_login', 'gul_id_organization'); + $bridge->addHiddenMulti('gsf_id_user', 'gul_id_user', 'gup_id_user', 'gul_login', 'gul_id_organization'); + + //Escape for local users when using radius, should be changed to something more elegant later + //@@TODO: Think of a better way to allow multiple methods per organization + if ($this->escort->hasPrivilege('pr.staff.edit.all')) { + $model->set('gul_user_class', 'label', $this->_('User Definition')); + $bridge->add('gul_user_class'); + } else { + $bridge->addHidden('gul_user_class'); + } //@@TODO: How do we change this? Only per org, or allow per user? //What classes are available? Maybe use something like event loader and add a little desc. to each type? $bridge->addText('gsf_login', 'size', 15, 'minlength', 4, @@ -224,7 +233,7 @@ //otherwise use the defaultStaffDefinition $org = $this->loader->getOrganization($this->menu->getParameterSource()->getMenuParameter('gsf_id_organization', $this->loader->getCurrentUser()->getCurrentOrganizationId())); $orgDef = $org->get('gor_user_class', $this->defaultStaffDefinition); - $model->set('gul_user_class', 'default', $orgDef); + $model->set('gul_user_class', 'default', $orgDef, 'multiOptions', $this->loader->getUserLoader()->getAvailableStaffDefinitions()); $model->set('gsf_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages()); $model->set('gul_can_login', 'label', $this->_('Can login'), 'multiOptions', $this->util->getTranslated()->getYesNo()); $model->set('gsf_logout_on_survey', 'label', $this->_('Logout on survey'), 'multiOptions', $this->util->getTranslated()->getYesNo()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |