From: <gem...@li...> - 2011-10-12 13:14:25
|
Revision: 95 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=95&view=rev Author: mennodekker Date: 2011-10-12 13:14:19 +0000 (Wed, 12 Oct 2011) Log Message: ----------- cleanup exportaction stepengine only looks at rounds when a round id is present Modified Paths: -------------- trunk/library/classes/Gems/Default/ExportAction.php trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php Modified: trunk/library/classes/Gems/Default/ExportAction.php =================================================================== --- trunk/library/classes/Gems/Default/ExportAction.php 2011-10-12 08:40:10 UTC (rev 94) +++ trunk/library/classes/Gems/Default/ExportAction.php 2011-10-12 13:14:19 UTC (rev 95) @@ -96,7 +96,7 @@ //Now add all onload actions to make the form still work $actions = $this->view->jQuery()->getOnLoadActions(); $this->html->raw('<script type="text/javascript">'); - foreach($actions as $action) { + foreach ($actions as $action) { $this->html->raw($action); } $this->html->raw('</script>'); @@ -161,11 +161,9 @@ //then remove it or make it more efficient unset($data['records']); if (isset($data['sid'])) { - $gsu_id = intval($data['sid']); - $survey = $this->loader->getTracker()->getSurvey($gsu_id); - - $filter = $this->_getFilter($data); - $answers = $survey->getRawTokenAnswerRows($filter); + $survey = $this->loader->getTracker()->getSurvey(intval($data['sid'])); + $filter = $this->_getFilter($data); + $answers = $survey->getRawTokenAnswerRows($filter); } else { $answers = array(); } @@ -226,11 +224,8 @@ */ public function handleExport($data) { - $language = $this->locale->getLanguage(); - $emptyMsg = sprintf($this->_('No %s found.'), $this->getTopic(0)); - $gsu_id = intval($data['sid']); - $survey = $this->loader->getTracker()->getSurvey($gsu_id); - + $language = $this->locale->getLanguage(); + $survey = $this->loader->getTracker()->getSurvey($data['sid']); $filter = $this->_getFilter($data); $answers = $survey->getRawTokenAnswerRows($filter); $answerModel = $survey->getAnswerModel($language); @@ -239,7 +234,7 @@ $answerModel->set('organizationid', 'multiOptions', $this->escort->getAllowedOrganizations()); if (count($answers) === 0) { - $answers[0] = array('' => $emptyMsg); + $answers[0] = array('' => sprintf($this->_('No %s found.'), $this->getTopic(0))); } if (isset($data['type'])) { Modified: trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-10-12 08:40:10 UTC (rev 94) +++ trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-10-12 13:14:19 UTC (rev 95) @@ -281,17 +281,20 @@ if ($token->hasSuccesCode() && (! $token->isCompleted())) { - $round = $this->_rounds[$token->getRoundId()]; + //Only process the token when linked to a round + if(array_key_exists($token->getRoundId(), $this->_rounds)) { + $round = $this->_rounds[$token->getRoundId()]; - $fromDate = $this->getValidFromDate($round['grp_valid_after_source'], $round['grp_valid_after_field'], $round['grp_valid_after_id'], $token, $respTrack); - $validFrom = $this->calculateFromDate($fromDate, $round['grp_valid_after_unit'], $round['grp_valid_after_length']); + $fromDate = $this->getValidFromDate($round['grp_valid_after_source'], $round['grp_valid_after_field'], $round['grp_valid_after_id'], $token, $respTrack); + $validFrom = $this->calculateFromDate($fromDate, $round['grp_valid_after_unit'], $round['grp_valid_after_length']); - // MUtil_Echo::track($round, (string) $fromDate, $validFrom); + // MUtil_Echo::track($round, (string) $fromDate, $validFrom); - $untilDate = $this->getValidUntilDate($round['grp_valid_for_source'], $round['grp_valid_for_field'], $round['grp_valid_for_id'], $token, $respTrack, $validFrom); - $validUntil = $this->calculateUntilDate($untilDate, $round['grp_valid_for_unit'], $round['grp_valid_for_length']); + $untilDate = $this->getValidUntilDate($round['grp_valid_for_source'], $round['grp_valid_for_field'], $round['grp_valid_for_id'], $token, $respTrack, $validFrom); + $validUntil = $this->calculateUntilDate($untilDate, $round['grp_valid_for_unit'], $round['grp_valid_for_length']); - $changed += $token->setValidFrom($validFrom, $validUntil, $userId); + $changed += $token->setValidFrom($validFrom, $validUntil, $userId); + } } $token = $token->getNextToken(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |