import('ttTimeHelper');
import('ttGroupExportHelper');
-// ttOrgExportHelper - this class is a future replacement for ttExportHelper.
-// Currently, it is work in progress.
-// When done, it should handle export of organizations containing multiple groups.
+// ttOrgExportHelper handles export of organizations consisting of multiple groups
+// into XML file for import (migrating) to another server.
class ttOrgExportHelper {
var $fileName = null; // Name of file with data.
// Write XML to the file.
fwrite($file, "<?xml version=\"1.0\"?>\n");
- fwrite($file, "<org>\n");
+ $org_part = "<org schema=\"".$this->getVersion()."\">\n";
+ fwrite($file, $org_part);
// Use ttGroupExportHelper to export all groups.
$groupExportHelper = new ttGroupExportHelper($user->group_id, $file, ' '); // 2 spaces indentation for home group.
fclose ($in_file);
return true;
}
+
+ private function getVersion() {
+ $mdb2 = getConnection();
+ $sql = "select param_value from tt_site_config where param_name = 'version_db'";
+ $res = $mdb2->query($sql);
+ if (!is_a($res, 'PEAR_Error')) {
+ $val = $res->fetchRow();
+ return $val['param_value'];
+ $result[] = $val;
+ }
+ return false;
+ }
}