當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SyncObject::SetCategoryFromColor方法代碼示例

本文整理匯總了PHP中SyncObject::SetCategoryFromColor方法的典型用法代碼示例。如果您正苦於以下問題:PHP SyncObject::SetCategoryFromColor方法的具體用法?PHP SyncObject::SetCategoryFromColor怎麽用?PHP SyncObject::SetCategoryFromColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SyncObject的用法示例。


在下文中一共展示了SyncObject::SetCategoryFromColor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ImportMessageChange

 /**
  * Imports a single message
  *
  * @param string        $id
  * @param SyncObject    $message
  *
  * @access public
  * @return boolean
  */
 public function ImportMessageChange($id, $message)
 {
     // ignore other SyncObjects
     if (!$message instanceof $this->classAsString) {
         return false;
     }
     // KOE ZO-42: to sync Notes to Outlook we sync them as Appointments
     if ($this->classAsString == "SyncNote") {
         if (KOE_CAPABILITY_NOTES && ZPush::GetDeviceManager()->IsKoe()) {
             // update category from SyncNote->Color
             $message->SetCategoryFromColor();
             $appointment = new SyncAppointment();
             $appointment->busystatus = 0;
             $appointment->sensitivity = 0;
             $appointment->alldayevent = 0;
             $appointment->reminder = 0;
             $appointment->meetingstatus = 0;
             $appointment->responserequested = 0;
             $appointment->flags = $message->flags;
             if (isset($message->asbody)) {
                 $appointment->asbody = $message->asbody;
             }
             if (isset($message->categories)) {
                 $appointment->categories = $message->categories;
             }
             if (isset($message->subject)) {
                 $appointment->subject = $message->subject;
             }
             if (isset($message->lastmodified)) {
                 $appointment->dtstamp = $message->lastmodified;
             }
             $appointment->starttime = time();
             $appointment->endtime = $appointment->starttime + 1;
             $message = $appointment;
         } else {
             if (Request::IsOutlook()) {
                 ZLog::Write(LOGLEVEL_WARN, "MS Outlook is synchronizing Notes folder without active KOE settings or extension. Not streaming SyncNote change!");
                 return false;
             }
         }
     }
     // prevent sending the same object twice in one request
     if (in_array($id, $this->seenObjects)) {
         ZLog::Write(LOGLEVEL_DEBUG, sprintf("Object '%s' discarded! Object already sent in this request.", $id));
         return true;
     }
     $this->importedMsgs++;
     $this->seenObjects[] = $id;
     // checks if the next message may cause a loop or is broken
     if (ZPush::GetDeviceManager()->DoNotStreamMessage($id, $message)) {
         ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesStream->ImportMessageChange('%s'): message ignored and requested to be removed from mobile", $id));
         // this is an internal operation & should not trigger an update in the device manager
         $this->checkForIgnoredMessages = false;
         $stat = $this->ImportMessageDeletion($id);
         $this->checkForIgnoredMessages = true;
         return $stat;
     }
     // KOE ZO-3: Stream reply/forward flag and time as additional category to KOE
     if (ZPush::GetDeviceManager()->IsKoe() && KOE_CAPABILITY_RECEIVEFLAGS && isset($message->lastverbexectime) && isset($message->lastverbexecuted) && $message->lastverbexecuted > 0) {
         ZLog::Write(LOGLEVEL_DEBUG, "ImportChangesStream->ImportMessageChange('%s'): KOE detected. Adding LastVerb information as category.");
         if (!isset($message->categories)) {
             $message->categories = array();
         }
         $s = "Push: Email ";
         if ($message->lastverbexecuted == 1) {
             $s .= "replied";
         } elseif ($message->lastverbexecuted == 2) {
             $s .= "replied-to-all";
         } elseif ($message->lastverbexecuted == 3) {
             $s .= "forwarded";
         }
         $s .= " on " . gmdate("d-m-Y H:i:s", $message->lastverbexectime) . " GMT";
         $message->categories[] = $s;
     }
     if ($message->flags === false || $message->flags === SYNC_NEWMESSAGE) {
         $this->encoder->startTag(SYNC_ADD);
     } else {
         // on update of an SyncEmail we only export the flags and categories
         if ($message instanceof SyncMail && (isset($message->flag) && $message->flag instanceof SyncMailFlags || isset($message->categories))) {
             $newmessage = new SyncMail();
             $newmessage->read = $message->read;
             if (isset($message->flag)) {
                 $newmessage->flag = $message->flag;
             }
             if (isset($message->lastverbexectime)) {
                 $newmessage->lastverbexectime = $message->lastverbexectime;
             }
             if (isset($message->lastverbexecuted)) {
                 $newmessage->lastverbexecuted = $message->lastverbexecuted;
             }
             if (isset($message->categories)) {
//.........這裏部分代碼省略.........
開發者ID:EGroupware,項目名稱:z-push,代碼行數:101,代碼來源:streamimporter.php


注:本文中的SyncObject::SetCategoryFromColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。