X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/46e93b281cb1460848b14c9e6109789b7949072b..2d3de45e7035c94e64bf54d6e610ac613724b912:/WEB-INF/lib/ttOrgExportHelper.class.php diff --git a/WEB-INF/lib/ttOrgExportHelper.class.php b/WEB-INF/lib/ttOrgExportHelper.class.php index aa9c9051..2dd54f1b 100644 --- a/WEB-INF/lib/ttOrgExportHelper.class.php +++ b/WEB-INF/lib/ttOrgExportHelper.class.php @@ -30,9 +30,8 @@ import('ttTeamHelper'); 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. @@ -51,7 +50,8 @@ class ttOrgExportHelper { // Write XML to the file. fwrite($file, "\n"); - fwrite($file, "\n"); + $org_part = "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. @@ -98,4 +98,16 @@ class ttOrgExportHelper { 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; + } }