X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/40263b0f447ad572e5ba029bbaf9e5c47c4329bb..725af06a89e5a7014dfdc9081222f313a58a6bb6:/WEB-INF/lib/ttGroupExportHelper.class.php
diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php
index 56533e10..af49e19e 100644
--- a/WEB-INF/lib/ttGroupExportHelper.class.php
+++ b/WEB-INF/lib/ttGroupExportHelper.class.php
@@ -102,7 +102,7 @@ class ttGroupExportHelper {
$mdb2 = getConnection();
$result = array();
- $sql = "select * from tt_roles where group_id = $this->group_id"; // and org_id = $user->org_id <-- add this when possible
+ $sql = "select * from tt_roles where group_id = $this->group_id and org_id = $user->org_id";
$res = $mdb2->query($sql);
$result = array();
if (!is_a($res, 'PEAR_Error')) {
@@ -143,6 +143,20 @@ class ttGroupExportHelper {
foreach ($clients as $key=>$client_item)
$this->clientMap[$client_item['id']] = $key + 1;
+ // Write roles.
+ fwrite($this->file, $this->indentation."\n");
+ foreach ($roles as $role) {
+ $role_part = $this->indentation.' '."roleMap[$role['id']]."\"";
+ $role_part .= " name=\"".htmlentities($role['name'])."\"";
+ $role_part .= " description=\"".htmlentities($role['description'])."\"";
+ $role_part .= " rank=\"".$role['rank']."\"";
+ $role_part .= " rights=\"".htmlentities($role['rights'])."\"";
+ $role_part .= " status=\"".$role['status']."\"";
+ $role_part .= ">\n";
+ fwrite($this->file, $role_part);
+ }
+ fwrite($this->file, $this->indentation."\n");
+
// Write users.
fwrite($this->file, $this->indentation."\n");
foreach ($users as $user_item) {