X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttOrgExportHelper.class.php;h=2dd54f1b3560a5a090d62e84287e94d3a7a810e8;hb=75a1eedb8977b8f2db459128bab9aaf367e3b58b;hp=aa9c9051d2357d08da0f292ca793b26752bd40b7;hpb=46e93b281cb1460848b14c9e6109789b7949072b;p=timetracker.git 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; + } }