Commit 13bd3352 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #414 in ZP/z-push from bugfix/ZP-1091-fix-phpwarning-and-clean-code to develop

* commit '357a7acf':
  ZP-1091 Fix phpwarnings and clean code. Released under the Affero GNU General Public License (AGPL) version 3.
parents d17f6a4f 357a7acf
......@@ -736,7 +736,6 @@ class SyncCollections implements Iterator {
*/
private function countHierarchyChange($exportChanges = false) {
$folderid = false;
$spa = $this->GetCollection($folderid);
// Check with device manager if the hierarchy should be reloaded.
// New additional folders are loaded here.
......
......@@ -308,7 +308,7 @@ class Search extends RequestProcessor {
}
$searchprovider->Disconnect();
self::$topCollector->AnnounceInformation(sprintf("'%s' search found %d results", $searchname, $rows['searchtotal']), true);
self::$topCollector->AnnounceInformation(sprintf("'%s' search found %d results", $searchname, (isset($rows['searchtotal']) ? $rows['searchtotal'] : 0) ), true);
self::$encoder->startWBXML();
self::$encoder->startTag(SYNC_SEARCH_SEARCH);
......
......@@ -52,7 +52,6 @@ class SendMail extends RequestProcessor {
* @return boolean
*/
public function Handle($commandCode) {
$status = SYNC_COMMONSTATUS_SUCCESS;
$sm = new SyncSendMail();
$reply = $forward = $parent = $sendmail = $smartreply = $smartforward = false;
......@@ -141,6 +140,7 @@ class SendMail extends RequestProcessor {
self::$topCollector->AnnounceInformation(sprintf("SendMail(): Sending email with %d bytes", strlen($sm->mime)), true);
$statusMessage = '';
try {
$status = self::$backend->SendMail($sm);
}
......
......@@ -133,14 +133,16 @@ class ZPushAdmin {
if ($fstatus !== false && isset($fstatus[ASDevice::FOLDERSYNCSTATUS])) {
$spa = $sc->GetCollection($folderid);
$total = $spa->GetFolderSyncTotal();
$todo = $spa->GetFolderSyncRemaining();
$fstatus['status'] = ($fstatus[ASDevice::FOLDERSYNCSTATUS] == 1)?'Initialized':'Synchronizing';
$fstatus['total'] = $total;
$fstatus['done'] = $total - $todo;
$fstatus['todo'] = $todo;
$device->SetFolderSyncStatus($folderid, $fstatus);
if ($spa) {
$total = $spa->GetFolderSyncTotal();
$todo = $spa->GetFolderSyncRemaining();
$fstatus['status'] = ($fstatus[ASDevice::FOLDERSYNCSTATUS] == 1) ? 'Initialized' : 'Synchronizing';
$fstatus['total'] = $total;
$fstatus['done'] = $total - $todo;
$fstatus['todo'] = $todo;
$device->SetFolderSyncStatus($folderid, $fstatus);
}
}
}
}
......
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