Commit cf877ef6 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-939 Now with file.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 4ef1cf1f
...@@ -772,10 +772,16 @@ class ZPushAdminCLI { ...@@ -772,10 +772,16 @@ class ZPushAdminCLI {
if ($device->GetFolderUUID($folderid)) { if ($device->GetFolderUUID($folderid)) {
$synchedFolders++; $synchedFolders++;
$type = $device->GetFolderType($folderid); $type = $device->GetFolderType($folderid);
$name = $device->GetHierarchyCache()->GetFolder($folderid)->displayname;
switch($type) { switch($type) {
case SYNC_FOLDER_TYPE_APPOINTMENT: case SYNC_FOLDER_TYPE_APPOINTMENT:
case SYNC_FOLDER_TYPE_USER_APPOINTMENT: case SYNC_FOLDER_TYPE_USER_APPOINTMENT:
$gentype = "Calendars"; if (KOE_GAB_NAME != "" && $name == KOE_GAB_NAME) {
$gentype = "GAB";
}
else {
$gentype = "Calendars";
}
break; break;
case SYNC_FOLDER_TYPE_CONTACT: case SYNC_FOLDER_TYPE_CONTACT:
case SYNC_FOLDER_TYPE_USER_CONTACT: case SYNC_FOLDER_TYPE_USER_CONTACT:
...@@ -800,8 +806,7 @@ class ZPushAdminCLI { ...@@ -800,8 +806,7 @@ class ZPushAdminCLI {
// set the folder name for all folders which are not fully synchronized yet // set the folder name for all folders which are not fully synchronized yet
$fstatus = $device->GetFolderSyncStatus($folderid); $fstatus = $device->GetFolderSyncStatus($folderid);
if ($fstatus !== false && is_array($fstatus)) { if ($fstatus !== false && is_array($fstatus)) {
// TODO would be nice if we could see the real name of the folder, right now we use the folder type as name $fstatus['name'] = $name ? $name : $gentype;
$fstatus['name'] = $gentype;
$device->SetFolderSyncStatus($folderid, $fstatus); $device->SetFolderSyncStatus($folderid, $fstatus);
$syncedFoldersInProgress++; $syncedFoldersInProgress++;
} }
...@@ -859,7 +864,10 @@ class ZPushAdminCLI { ...@@ -859,7 +864,10 @@ class ZPushAdminCLI {
$percent = round($d['done']*100/$d['total']); $percent = round($d['done']*100/$d['total']);
$status = sprintf("Status: %s%d%% (%d/%d)", ($percent < 10)?" ":"", $percent, $d['done'], $d['total']); $status = sprintf("Status: %s%d%% (%d/%d)", ($percent < 10)?" ":"", $percent, $d['done'], $d['total']);
} }
printf("\tFolder: %s%s Sync: %s %s\n", $d['name'], str_repeat(" ", 12-strlen($d['name'])), $d['status'], $status); if (strlen($d['name']) > 20) {
$d['name'] = substr($d['name'], 0, 18) . "..";
}
printf("\tFolder: %s Sync: %s %s\n", str_pad($d['name'], 20), str_pad($d['status'], 13), $status);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment