Commit c93f16dd authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #207 in ZP/z-push from bugfix/ZP-896-warnings-in-mapiprovider to develop

* commit 'a8b37615':
  ZP-896 initialize as empty array by default, remove first mapi_getprops() as it's redundant.
  ZP-896 Check for variables and set them to 'false' if they are not set.
parents bd1aca3c a8b37615
...@@ -2718,6 +2718,16 @@ class MAPIProvider { ...@@ -2718,6 +2718,16 @@ class MAPIProvider {
if (!isset($this->storeProps) || empty($this->storeProps)) { if (!isset($this->storeProps) || empty($this->storeProps)) {
ZLog::Write(LOGLEVEL_DEBUG, "MAPIProvider->getStoreProps(): Getting store properties."); ZLog::Write(LOGLEVEL_DEBUG, "MAPIProvider->getStoreProps(): Getting store properties.");
$this->storeProps = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_OUTBOX_ENTRYID, PR_IPM_WASTEBASKET_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID, PR_IPM_FAVORITES_ENTRYID, PR_MAILBOX_OWNER_ENTRYID)); $this->storeProps = mapi_getprops($this->store, array(PR_IPM_SUBTREE_ENTRYID, PR_IPM_OUTBOX_ENTRYID, PR_IPM_WASTEBASKET_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_ENTRYID, PR_IPM_PUBLIC_FOLDERS_ENTRYID, PR_IPM_FAVORITES_ENTRYID, PR_MAILBOX_OWNER_ENTRYID));
// make sure all properties are set
if(!isset($this->storeProps[PR_IPM_WASTEBASKET_ENTRYID])) {
$this->storeProps[PR_IPM_WASTEBASKET_ENTRYID] = false;
}
if(!isset($this->storeProps[PR_IPM_SENTMAIL_ENTRYID])) {
$this->storeProps[PR_IPM_SENTMAIL_ENTRYID] = false;
}
if(!isset($this->storeProps[PR_IPM_OUTBOX_ENTRYID])) {
$this->storeProps[PR_IPM_OUTBOX_ENTRYID] = false;
}
} }
return $this->storeProps; return $this->storeProps;
} }
...@@ -2731,8 +2741,33 @@ class MAPIProvider { ...@@ -2731,8 +2741,33 @@ class MAPIProvider {
private function getInboxProps() { private function getInboxProps() {
if (!isset($this->inboxProps) || empty($this->inboxProps)) { if (!isset($this->inboxProps) || empty($this->inboxProps)) {
ZLog::Write(LOGLEVEL_DEBUG, "MAPIProvider->getInboxProps(): Getting inbox properties."); ZLog::Write(LOGLEVEL_DEBUG, "MAPIProvider->getInboxProps(): Getting inbox properties.");
$this->inboxProps = array();
$inbox = mapi_msgstore_getreceivefolder($this->store); $inbox = mapi_msgstore_getreceivefolder($this->store);
if ($inbox) {
$this->inboxProps = mapi_getprops($inbox, array(PR_ENTRYID, PR_IPM_DRAFTS_ENTRYID, PR_IPM_TASK_ENTRYID, PR_IPM_APPOINTMENT_ENTRYID, PR_IPM_CONTACT_ENTRYID, PR_IPM_NOTE_ENTRYID, PR_IPM_JOURNAL_ENTRYID)); $this->inboxProps = mapi_getprops($inbox, array(PR_ENTRYID, PR_IPM_DRAFTS_ENTRYID, PR_IPM_TASK_ENTRYID, PR_IPM_APPOINTMENT_ENTRYID, PR_IPM_CONTACT_ENTRYID, PR_IPM_NOTE_ENTRYID, PR_IPM_JOURNAL_ENTRYID));
// make sure all properties are set
if(!isset($this->inboxProps[PR_ENTRYID])) {
$this->inboxProps[PR_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_DRAFTS_ENTRYID])) {
$this->inboxProps[PR_IPM_DRAFTS_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_TASK_ENTRYID])) {
$this->inboxProps[PR_IPM_TASK_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_APPOINTMENT_ENTRYID])) {
$this->inboxProps[PR_IPM_APPOINTMENT_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_CONTACT_ENTRYID])) {
$this->inboxProps[PR_IPM_CONTACT_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_NOTE_ENTRYID])) {
$this->inboxProps[PR_IPM_NOTE_ENTRYID] = false;
}
if(!isset($this->inboxProps[PR_IPM_JOURNAL_ENTRYID])) {
$this->inboxProps[PR_IPM_JOURNAL_ENTRYID] = false;
}
}
} }
return $this->inboxProps; return $this->inboxProps;
} }
......
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