From: <gem...@li...> - 2012-07-03 07:40:07
|
Revision: 808 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=808&view=rev Author: mennodekker Date: 2012-07-03 07:39:56 +0000 (Tue, 03 Jul 2012) Log Message: ----------- Skip tokens with not ok reception code in export Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-02 15:17:02 UTC (rev 807) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-03 07:39:56 UTC (rev 808) @@ -160,7 +160,12 @@ */ protected function _isTokenInFilter(Gems_Tracker_Token $token) { - return true; + // Only if token has a success code + if ($token->getReceptionCode()->isSuccess()) { + return true; + } + + return false; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-12 12:46:35
|
Revision: 832 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=832&view=rev Author: michieltcs Date: 2012-07-12 12:46:26 +0000 (Thu, 12 Jul 2012) Log Message: ----------- Refactor to more generic export command using sprintf Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-12 10:15:39 UTC (rev 831) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-12 12:46:26 UTC (rev 832) @@ -43,7 +43,7 @@ */ class Gems_Export_RespondentExport extends Gems_Registry_TargetAbstract { - public $_wkhtmltopdfLocation = ""; + public $_pdfExportCommand = ""; protected $_reportFooter = 'Export_ReportFooterSnippet'; protected $_reportHeader = 'Export_ReportHeaderSnippet'; @@ -95,8 +95,8 @@ parent::afterRegistry(); // Load the pdf class from the project settings if available - if (isset($this->project->export) && isset($this->project->export['wkhtmltopdf'])) { - $this->_wkhtmltopdfLocation = $this->project->export['wkhtmltopdf']; + if (isset($this->project->export) && isset($this->project->export['pdfExportCommand'])) { + $this->_pdfExportCommand = $this->project->export['pdfExportCommand']; } } @@ -117,15 +117,17 @@ if (!file_exists($tempInputFilename)) { throw new Exception("Unable to create temporary file '{$tempInputFilename}'"); } + + $command = sprintf($this->_pdfExportCommand, escapeshellarg($tempInputFilename), + escapeshellarg($tempOutputFilename)); - $lastLine = exec(escapeshellarg($this->_wkhtmltopdfLocation) . ' ' . escapeshellarg($tempInputFilename) - . ' ' . escapeshellarg($tempOutputFilename), $outputLines, $return); + $lastLine = exec($command, $outputLines, $return); if ($return > 0) { @unlink($tempInputFilename); @unlink($tempOutputFilename); - throw new Exception(sprintf($this->_('Unable to run PDF conversion: "%s"'), $lastLine)); + throw new Exception(sprintf($this->_('Unable to run PDF conversion (%s): "%s"'), $command, $lastLine)); } $pdfContents = file_get_contents($tempOutputFilename); @@ -326,7 +328,7 @@ $element = new Zend_Form_Element_Select('format'); $element->setLabel($this->_('Output format')); $outputFormats = array('html' => 'HTML'); - if (!empty($this->_wkhtmltopdfLocation)) { + if (!empty($this->_pdfExportCommand)) { $outputFormats['pdf'] = 'PDF'; $element->setValue('pdf'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-19 13:04:59
|
Revision: 860 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=860&view=rev Author: michieltcs Date: 2012-07-19 13:04:48 +0000 (Thu, 19 Jul 2012) Log Message: ----------- Fix double echo Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-19 13:04:06 UTC (rev 859) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-19 13:04:48 UTC (rev 860) @@ -351,10 +351,10 @@ $filename = 'respondent-export-' . strtolower($respondentId) . '.pdf'; $content = $this->_pdf->convertFromHtml($content); $this->_pdf->echoPdfContent($content, $filename, true); + } else { + echo $content; } - echo $content; - $this->escort->menu->setVisible(true); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-25 14:28:22
|
Revision: 1155 http://sourceforge.net/p/gemstracker/code/1155 Author: michieltcs Date: 2013-02-25 14:28:18 +0000 (Mon, 25 Feb 2013) Log Message: ----------- Properly andle single string value Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2013-02-25 08:34:41 UTC (rev 1154) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2013-02-25 14:28:18 UTC (rev 1155) @@ -201,12 +201,14 @@ 'grouped' => $groupSurveys); $snippets = $token->getAnswerSnippetNames(); - - if (is_array($snippets)) { - list($snippets, $snippetParams) = MUtil_Ra::keySplit($snippets); - $params = $params + $snippetParams; + + if (!is_array($snippets)) { + $snippets = array($snippets); } + list($snippets, $snippetParams) = MUtil_Ra::keySplit($snippets); + $params = $params + $snippetParams; + $this->html->snippet('Export_SurveyHeaderSnippet', 'token', $token); foreach($snippets as $snippet) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-25 14:08:49
|
Revision: 878 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=878&view=rev Author: mennodekker Date: 2012-07-25 14:08:40 +0000 (Wed, 25 Jul 2012) Log Message: ----------- Improved printing of survey export (new page for each survey) Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-25 14:08:28 UTC (rev 877) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2012-07-25 14:08:40 UTC (rev 878) @@ -170,7 +170,7 @@ } if ($engine->getTrackType() == 'S' || !$groupSurveys) { - $this->html->span()->b($token->getSurveyName() . ($token->getRoundDescription() ? ' (' . $token->getRoundDescription() . ')' : '')); + $this->html->div($token->getSurveyName(), array('class'=>'surveyTitle')); $this->html->snippet($this->_singleSurveySnippet, 'token', $token, 'tokenId', $token->getTokenId(), 'showHeaders', false, 'showButtons', false, 'showSelected', false, 'showTakeButton', false); @@ -179,7 +179,7 @@ if (!isset($surveys[$token->getSurveyId()])) { $surveys[$token->getSurveyId()] = true; - $this->html->span()->b($token->getSurveyName()); + $this->html->div($token->getSurveyName(), array('class'=>'surveyTitle')); $this->html->snippet($this->_groupedSurveySnippet, 'token', $token, 'tokenId', $token->getTokenId(), 'showHeaders', false, 'showButtons', false, 'showSelected', false, 'showTakeButton', false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-30 12:22:45
|
Revision: 1127 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1127&view=rev Author: mennodekker Date: 2013-01-30 12:22:38 +0000 (Wed, 30 Jan 2013) Log Message: ----------- Don't rely on request for org_id filtering Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2013-01-30 10:05:29 UTC (rev 1126) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2013-01-30 12:22:38 UTC (rev 1127) @@ -282,9 +282,21 @@ protected function _exportRespondent($respondentId) { $respondentModel = $this->loader->getModels()->getRespondentModel(false); + //Insert orgId when set - $respondentModel->applyRequest(Zend_Controller_Front::getInstance()->getRequest()); - $respondentModel->addFilter(array('gr2o_patient_nr' => $respondentId)); + if (is_array($respondentId) && isset($respondentId['gr2o_id_organization'])) { + $filter['gr2o_id_organization'] = $respondentId['gr2o_id_organization']; + $respondentId = $respondentId['gr2o_patient_nr']; + } else { + // Or accept to find in current organization + $filter['gr2o_id_organization'] = $this->loader->getCurrentUser()->getCurrentOrganizationId(); + // Or use any organization? + // $allowedOrgs = $this->loader->getCurrentUser()->getAllowedOrganizations(); + // $filter[] = sprintf('%s IN(%s)', $this->db->quoteIdentifier('gto_id_organization'), array_keys($allowedOrgs)); + } + $filter['gr2o_patient_nr'] = $respondentId; + + $respondentModel->setFilter($filter); $respondentData = $respondentModel->loadFirst(); $this->html->snippet($this->_respondentSnippet, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-20 16:12:29
|
Revision: 1150 http://sourceforge.net/p/gemstracker/code/1150 Author: michieltcs Date: 2013-02-20 16:12:24 +0000 (Wed, 20 Feb 2013) Log Message: ----------- Fix multiple tables of same survey even if groupsurveys is true Modified Paths: -------------- trunk/library/classes/Gems/Export/RespondentExport.php Modified: trunk/library/classes/Gems/Export/RespondentExport.php =================================================================== --- trunk/library/classes/Gems/Export/RespondentExport.php 2013-02-20 15:16:59 UTC (rev 1149) +++ trunk/library/classes/Gems/Export/RespondentExport.php 2013-02-20 16:12:24 UTC (rev 1150) @@ -186,6 +186,7 @@ // as the snippet takes care of showing the other tokens if (!isset($surveys[$token->getSurveyId()])) { $showToken = true; + $surveys[$token->getSurveyId()] = 1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |