View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
09883 | Bug reports | Import/Export | public | 2015-09-14 21:04 | 2015-11-10 12:28 |
Reporter | nwinter | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.06+ | ||||
Fixed in Version | 2.06+ | ||||
Summary | 09883: Stata (xml) plugin needs small edits to match element IDs in 2.06 | ||||
Description | The ExportSTATAxml.php file that sets up the Stata XML export plugin needs the element IDs changed to match those used in 2.06. I have attached an updated version of this file that I believe addresses the issue. | ||||
Steps To Reproduce | Select "STATA (.xml)" on the Export Results page. Note that it does not automatically select options as it should, and the console reports an error from the getElementById() calls. | ||||
Tags | No tags attached. | ||||
Attached Files | ExportSTATAxml.php (2,655 bytes)
<?php class ExportSTATAxml extends \ls\pluginmanager\PluginBase { protected $storage = 'DbStorage'; static protected $description = 'Core: Export survey results to a STATA xml file'; static protected $name = 'STATA Export'; public function init() { /** * Here you should handle subscribing to the events your plugin will handle */ $this->subscribe('listExportPlugins'); $this->subscribe('listExportOptions'); $this->subscribe('newExport'); } protected $settings = array( 'statafileversion' => array( 'type' => 'select', 'label' => 'Export for Stata', 'options' => array('113' => 'version 8 through 12', '117' => 'version 13 and up'), 'default' => '113', 'submitonchange'=> false ) ); public function listExportOptions() { $event = $this->getEvent(); $type = $event->get('type'); switch ($type) { case 'stataxml': $event->set('label', gT("STATA (.xml)")); $event->set('onclick', ' document.getElementById("answers-short").checked=true; document.getElementById("answers-long").disabled=true; document.getElementById("converty").checked=true; document.getElementById("convertn").checked=true; document.getElementById("convertnto").value=0; document.getElementById("convertyto").value=1; document.getElementById("headstyle-code").disabled=true; document.getElementById("headstyle-abbreviated").disabled=true; document.getElementById("headstyle-full").checked=true; document.getElementById("headstyle-codetext").disabled=true; '); break; default: break; } } /** * Registers this export type */ public function listExportPlugins() { $event = $this->getEvent(); $exports = $event->get('exportplugins'); // Yes we overwrite existing classes if available $exports['stataxml'] = get_class(); $event->set('exportplugins', $exports); } /** * Returns the required IWriter */ public function newExport() { $event = $this->getEvent(); $type = $event->get('type'); $pluginsettings=$this->getPluginSettings(true); $writer = new STATAxmlWriter($pluginsettings); $event->set('writer', $writer); } } | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 150911 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | All | ||||
Database type & version | 184 | ||||
Server OS (if known) | centOS | ||||
Webserver software & version (if known) | apache 2.4.6 | ||||
PHP Version | 5.4.16 | ||||
@nwinter : can you make a pull request on our github repo ? |
|
I have no idea how to make a pull request; if you point me to something online that explains this a bit I can probably work it out, though. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=16041 |
|
Thank you! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2015-09-14 21:04 | nwinter | New Issue | |
2015-09-14 21:04 | nwinter | File Added: ExportSTATAxml.php | |
2015-09-28 18:55 | DenisChenu | Note Added: 33191 | |
2015-09-28 18:57 | nwinter | Note Added: 33192 | |
2015-09-29 16:18 | c_schmitz | Assigned To | => c_schmitz |
2015-09-29 16:18 | c_schmitz | Status | new => assigned |
2015-09-30 13:05 | c_schmitz | Changeset attached | => LimeSurvey master 5ff7e2f1 |
2015-09-30 13:05 | c_schmitz | Note Added: 33246 | |
2015-09-30 13:05 | c_schmitz | Resolution | open => fixed |
2015-09-30 13:05 | c_schmitz | Note Added: 33247 | |
2015-09-30 13:05 | c_schmitz | Status | assigned => resolved |
2015-09-30 13:05 | c_schmitz | Fixed in Version | => 2.06+ |
2015-11-10 12:28 | c_schmitz | Status | resolved => closed |