当前位置: 首页>>代码示例>>PHP>>正文


PHP Reminder::saveRemindersDataJson方法代码示例

本文整理汇总了PHP中Reminder::saveRemindersDataJson方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::saveRemindersDataJson方法的具体用法?PHP Reminder::saveRemindersDataJson怎么用?PHP Reminder::saveRemindersDataJson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reminder的用法示例。


在下文中一共展示了Reminder::saveRemindersDataJson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 function save($check_notify = FALSE)
 {
     global $timedate, $current_user;
     if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
         $td = $timedate->fromDb($this->date_start);
         if ($td) {
             $this->date_end = $td->modify("+{$this->duration_hours} hours {$this->duration_minutes} mins")->asDb();
         }
     }
     if (!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') {
         $check_notify = true;
     } else {
         $check_notify = false;
     }
     if (empty($_REQUEST['send_invites'])) {
         if (!empty($this->id)) {
             $old_record = new Call();
             $old_record->retrieve($this->id);
             $old_assigned_user_id = $old_record->assigned_user_id;
         }
         if (empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id'] || isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) {
             $this->special_notification = true;
             if (!isset($GLOBALS['resavingRelatedBeans']) || $GLOBALS['resavingRelatedBeans'] == false) {
                 $check_notify = true;
             }
             if (isset($_REQUEST['assigned_user_name'])) {
                 $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
             }
         }
     }
     if (empty($this->status)) {
         $this->status = $this->getDefaultStatus();
     }
     // prevent a mass mailing for recurring meetings created in Calendar module
     if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) {
         $check_notify = false;
     }
     /*nsingh 7/3/08  commenting out as bug #20814 is invalid
     		if($current_user->getPreference('reminder_time')!= -1 &&  isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0  && $_POST['reminder_time']==-1){
     			$this->reminder_checked = '1';
     			$this->reminder_time = $current_user->getPreference('reminder_time');
     		}*/
     $return_id = parent::save($check_notify);
     global $current_user;
     if ($this->update_vcal) {
         vCal::cache_sugar_vcal($current_user);
     }
     if (isset($_REQUEST['reminders_data'])) {
         Reminder::saveRemindersDataJson('Calls', $return_id, html_entity_decode($_REQUEST['reminders_data']));
     }
     return $return_id;
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:52,代码来源:Call.php

示例2: save

 function save($check_notify = FALSE)
 {
     global $timedate;
     global $current_user;
     global $disable_date_format;
     if (isset($this->date_start)) {
         $td = $timedate->fromDb($this->date_start);
         if (!$td) {
             $this->date_start = $timedate->to_db($this->date_start);
             $td = $timedate->fromDb($this->date_start);
         }
         if ($td) {
             if (isset($this->duration_hours) && $this->duration_hours != '') {
                 $td->modify("+{$this->duration_hours} hours");
             }
             if (isset($this->duration_minutes) && $this->duration_minutes != '') {
                 $td->modify("+{$this->duration_minutes} mins");
             }
             $this->date_end = $td->asDb();
         }
     }
     $check_notify = !empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1' ? true : false;
     if (empty($_REQUEST['send_invites'])) {
         if (!empty($this->id)) {
             $old_record = new Meeting();
             $old_record->retrieve($this->id);
             $old_assigned_user_id = $old_record->assigned_user_id;
         }
         if (empty($this->id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $GLOBALS['current_user']->id != $_REQUEST['assigned_user_id'] || isset($old_assigned_user_id) && !empty($old_assigned_user_id) && isset($_REQUEST['assigned_user_id']) && !empty($_REQUEST['assigned_user_id']) && $old_assigned_user_id != $_REQUEST['assigned_user_id']) {
             $this->special_notification = true;
             $check_notify = true;
             if (isset($_REQUEST['assigned_user_name'])) {
                 $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
             }
         }
     }
     /*nsingh 7/3/08  commenting out as bug #20814 is invalid
     		if($current_user->getPreference('reminder_time')!= -1 &&  isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0  && $_POST['reminder_time']==-1){
     			$this->reminder_checked = '1';
     			$this->reminder_time = $current_user->getPreference('reminder_time');
     		}*/
     // prevent a mass mailing for recurring meetings created in Calendar module
     if (empty($this->id) && !empty($_REQUEST['module']) && $_REQUEST['module'] == "Calendar" && !empty($_REQUEST['repeat_type']) && !empty($this->repeat_parent_id)) {
         $check_notify = false;
     }
     if (empty($this->status)) {
         $this->status = $this->getDefaultStatus();
     }
     // Do any external API saving
     // Clear out the old external API stuff if we have changed types
     if (isset($this->fetched_row) && $this->fetched_row['type'] != $this->type) {
         $this->join_url = '';
         $this->host_url = '';
         $this->external_id = '';
         $this->creator = '';
     }
     if (!empty($this->type) && $this->type != 'Sugar') {
         require_once 'include/externalAPI/ExternalAPIFactory.php';
         $api = ExternalAPIFactory::loadAPI($this->type);
     }
     if (empty($this->type)) {
         $this->type = 'Sugar';
     }
     if (isset($api) && is_a($api, 'WebMeeting') && empty($this->in_relationship_update)) {
         // Make sure the API initialized and it supports Web Meetings
         // Also make suer we have an ID, the external site needs something to reference
         if (!isset($this->id) || empty($this->id)) {
             $this->id = create_guid();
             $this->new_with_id = true;
         }
         $response = $api->scheduleMeeting($this);
         if ($response['success'] == TRUE) {
             // Need to send out notifications
             if ($api->canInvite) {
                 $notifyList = $this->get_notification_recipients();
                 foreach ($notifyList as $person) {
                     $api->inviteAttendee($this, $person, $check_notify);
                 }
             }
         } else {
             // Generic Message Provides no value to End User - Log the issue with message detail and continue
             // SugarApplication::appendErrorMessage($GLOBALS['app_strings']['ERR_EXTERNAL_API_SAVE_FAIL']);
             $GLOBALS['log']->warn('ERR_EXTERNAL_API_SAVE_FAIL' . ": " . $this->type . " - " . $response['errorMessage']);
         }
         $api->logoff();
     }
     $return_id = parent::save($check_notify);
     if ($this->update_vcal) {
         vCal::cache_sugar_vcal($current_user);
     }
     if (isset($_REQUEST['reminders_data'])) {
         $reminderData = json_encode($this->removeUnInvitedFromReminders(json_decode(html_entity_decode($_REQUEST['reminders_data']), true)));
         Reminder::saveRemindersDataJson('Meetings', $return_id, $reminderData);
     }
     return $return_id;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:96,代码来源:Meeting.php


注:本文中的Reminder::saveRemindersDataJson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。