Commit 9c1987d8 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-556 Added a few dots. Added descriptions.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 85dbce30
...@@ -237,7 +237,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -237,7 +237,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
*/ */
/** /**
* Initializes the state and flags * Initializes the state and flags.
* *
* @param string $state * @param string $state
* @param int $flags * @param int $flags
...@@ -263,7 +263,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -263,7 +263,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Configures additional parameters used for content synchronization * Configures additional parameters used for content synchronization.
* *
* @param ContentParameters $contentparameters * @param ContentParameters $contentparameters
* *
...@@ -277,7 +277,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -277,7 +277,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Reads and returns the current state * Reads and returns the current state.
* *
* @access public * @access public
* @return string * @return string
...@@ -324,8 +324,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -324,8 +324,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
*/ */
/** /**
* Loads objects which are expected to be exported with the state * Loads objects which are expected to be exported with the state.
* Before importing/saving the actual message from the mobile, a conflict detection should be done * Before importing/saving the actual message from the mobile, a conflict detection should be done.
* *
* @param ContentParameters $contentparameters * @param ContentParameters $contentparameters
* @param string $state * @param string $state
...@@ -340,7 +340,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -340,7 +340,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
/** /**
* Imports a single message * Imports a single message.
* *
* @param string $id * @param string $id
* @param SyncObject $message * @param SyncObject $message
...@@ -354,7 +354,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -354,7 +354,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a deletion. This may conflict if the local object has been modified * Imports a deletion. This may conflict if the local object has been modified.
* *
* @param string $id * @param string $id
* *
...@@ -367,8 +367,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -367,8 +367,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a change in 'read' flag * Imports a change in 'read' flag.
* This can never conflict * This can never conflict.
* *
* @param string $id * @param string $id
* @param int $flags * @param int $flags
...@@ -382,7 +382,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -382,7 +382,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a move of a message. This occurs when a user moves an item to another folder * Imports a move of a message. This occurs when a user moves an item to another folder.
* *
* @param string $id * @param string $id
* @param string $newfolder destination folder * @param string $newfolder destination folder
...@@ -393,8 +393,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -393,8 +393,8 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
*/ */
public function ImportMessageMove($id, $newfolder) { public function ImportMessageMove($id, $newfolder) {
$this->didMove = true; $this->didMove = true;
// Wwhen we setup the $current importer, we didn't know what we needed to do, so we look only at the src folder. // When we setup the $current importer, we didn't know what we needed to do, so we look only at the src folder for permissions.
// Now the $newfolder could be read only as well. So we need to check it's permissions and then switch to a ReplyBackImExporter if its r/o. // Now the $newfolder could be read only as well. So we need to check it's permissions and then switch to a ReplyBackImExporter if it's r/o.
if (!$this->isReplyBackExporter()) { if (!$this->isReplyBackExporter()) {
if (!self::$backend->HasSecretaryACLs($this->store, $newfolder)) { if (!self::$backend->HasSecretaryACLs($this->store, $newfolder)) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoChangesWrapper->ImportMessageMove(): destination folderid '%s' is missing permissions. Switching to ReplyBackImExporter.", Utils::PrintAsString($newfolder))); ZLog::Write(LOGLEVEL_DEBUG, sprintf("KopanoChangesWrapper->ImportMessageMove(): destination folderid '%s' is missing permissions. Switching to ReplyBackImExporter.", Utils::PrintAsString($newfolder)));
...@@ -412,11 +412,11 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -412,11 +412,11 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Implement interfaces which are never used * Implement interfaces which are never used.
*/ */
/** /**
* Imports a change on a folder * Imports a change on a folder.
* *
* @param object $folder SyncFolder * @param object $folder SyncFolder
* *
...@@ -429,7 +429,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -429,7 +429,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a folder deletion * Imports a folder deletion.
* *
* @param SyncFolder $folder at least "serverid" needs to be set * @param SyncFolder $folder at least "serverid" needs to be set
* *
...@@ -447,7 +447,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -447,7 +447,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
*/ */
/** /**
* Initializes the Exporter where changes are synchronized to * Initializes the Exporter where changes are synchronized to.
* *
* @param IImportChanges $importer * @param IImportChanges $importer
* *
...@@ -459,7 +459,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -459,7 +459,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Returns the amount of changes to be exported * Returns the amount of changes to be exported.
* *
* @access public * @access public
* @return int * @return int
...@@ -469,7 +469,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -469,7 +469,7 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
} }
/** /**
* Synchronizes a change. The previously imported messages are now retrieved from the backend * Synchronizes a change. The previously imported messages are now retrieved from the backend.
* and sent back to the mobile. * and sent back to the mobile.
* *
* @access public * @access public
......
...@@ -92,7 +92,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -92,7 +92,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Initializes the state and flags * Initializes the state and flags.
* *
* @param string $state * @param string $state
* @param int $flags * @param int $flags
...@@ -110,7 +110,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -110,7 +110,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Configures additional parameters used for content synchronization * Configures additional parameters used for content synchronization.
* *
* @param ContentParameters $contentparameters * @param ContentParameters $contentparameters
* *
...@@ -124,7 +124,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -124,7 +124,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Reads and returns the current state * Reads and returns the current state.
* *
* @access public * @access public
* @return string * @return string
...@@ -177,12 +177,12 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -177,12 +177,12 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
/** /**
* Implement interfaces which are never used * Implement interfaces which are never used.
*/ */
/** /**
* Loads objects which are expected to be exported with the state * Loads objects which are expected to be exported with the state.
* Before importing/saving the actual message from the mobile, a conflict detection should be done * Before importing/saving the actual message from the mobile, a conflict detection should be done.
* *
* @param ContentParameters $contentparameters * @param ContentParameters $contentparameters
* @param string $state * @param string $state
...@@ -196,7 +196,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -196,7 +196,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a move of a message. This occurs when a user moves an item to another folder * Imports a move of a message. This occurs when a user moves an item to another folder.
* *
* @param string $id * @param string $id
* @param string $newfolder destination folder * @param string $newfolder destination folder
...@@ -230,7 +230,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -230,7 +230,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a change on a folder * Imports a change on a folder.
* *
* @param object $folder SyncFolder * @param object $folder SyncFolder
* *
...@@ -243,7 +243,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -243,7 +243,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a folder deletion * Imports a folder deletion.
* *
* @param SyncFolder $folder at least "serverid" needs to be set * @param SyncFolder $folder at least "serverid" needs to be set
* *
...@@ -261,7 +261,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -261,7 +261,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
*/ */
/** /**
* Imports a message change, which is imported into memory * Imports a message change, which is imported into memory.
* *
* @param string $id id of message which is changed * @param string $id id of message which is changed
* @param SyncObject $message message to be changed * @param SyncObject $message message to be changed
...@@ -303,7 +303,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -303,7 +303,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a message deletion, which is imported into memory * Imports a message deletion, which is imported into memory.
* *
* @param string $id id of message which is deleted * @param string $id id of message which is deleted
* *
...@@ -316,8 +316,8 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -316,8 +316,8 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Imports a change in 'read' flag * Imports a change in 'read' flag.
* This can never conflict * This can never conflict.
* *
* @param string $id * @param string $id
* @param int $flags * @param int $flags
...@@ -338,7 +338,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -338,7 +338,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
*/ */
/** /**
* Initializes the Exporter where changes are synchronized to * Initializes the Exporter where changes are synchronized to.
* *
* @param IImportChanges $importer * @param IImportChanges $importer
* *
...@@ -352,7 +352,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -352,7 +352,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Returns the amount of changes to be exported * Returns the amount of changes to be exported.
* *
* @access public * @access public
* @return int * @return int
...@@ -362,7 +362,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges { ...@@ -362,7 +362,7 @@ class ReplyBackImExporter implements IImportChanges, IExportChanges {
} }
/** /**
* Synchronizes a change. The previously imported messages are now retrieved from the backend * Synchronizes a change. The previously imported messages are now retrieved from the backend.
* and sent back to the mobile. * and sent back to the mobile.
* *
* @access public * @access public
......
...@@ -48,6 +48,12 @@ class ReplyBackState extends StateObject { ...@@ -48,6 +48,12 @@ class ReplyBackState extends StateObject {
'icsstate' => "", 'icsstate' => "",
); );
/**
* Returns a ReplyBackState from a state.
*
* @param mixed $state
* @return ReplyBackState
*/
static public function FromState($state) { static public function FromState($state) {
if (strpos($state, 'ReplyBackState') !== false) { if (strpos($state, 'ReplyBackState') !== false) {
return unserialize($state); return unserialize($state);
...@@ -60,6 +66,11 @@ class ReplyBackState extends StateObject { ...@@ -60,6 +66,11 @@ class ReplyBackState extends StateObject {
} }
} }
/**
* Gets the state from a ReplyBackState object.
*
* @param mixed $state
*/
static public function ToState($state) { static public function ToState($state) {
if (!empty($state->GetReplyBackState())) { if (!empty($state->GetReplyBackState())) {
return serialize($state); return serialize($state);
......
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